Index: cpu-exec.c =================================================================== RCS file: /cvsroot/qemu/qemu/cpu-exec.c,v retrieving revision 1.38 diff -u -r1.38 cpu-exec.c --- cpu-exec.c 14 Jul 2004 17:20:55 -0000 1.38 +++ cpu-exec.c 23 Aug 2004 12:11:19 -0000 @@ -859,6 +859,7 @@ * From Wine */ #ifdef linux +# define HANDLER_DEF(name) int name( int host_signum, struct siginfo *info, void *puc ) /* All Registers access - only for local access */ # define REG_sig(reg_name, context) ((context)->uc_mcontext.regs->reg_name) /* Gpr Registers access */ @@ -881,6 +882,8 @@ #ifdef __APPLE__ # include typedef struct ucontext SIGCONTEXT; +typedef siginfo_t siginfo; +# define HANDLER_DEF(name) int name( int host_signum, siginfo *info, SIGCONTEXT *puc ) /* All Registers access - only for local access */ # define REG_sig(reg_name, context) ((context)->uc_mcontext->ss.reg_name) # define FLOATREG_sig(reg_name, context) ((context)->uc_mcontext->fs.reg_name) @@ -903,14 +906,15 @@ # define TRAP_sig(context) EXCEPREG_sig(exception, context) /* number of powerpc exception taken */ #endif /* __APPLE__ */ -int cpu_signal_handler(int host_signum, struct siginfo *info, - void *puc) +HANDLER_DEF(cpu_signal_handler) { struct ucontext *uc = puc; - unsigned long pc; + unsigned long pc, target_mem; int is_write; pc = IAR_sig(uc); + /* Use the DAR, since on darwin si_addr isn't correctly set */ + target_mem = DAR_sig(uc); is_write = 0; #if 0 /* ppc 4xx case */ @@ -920,7 +924,7 @@ if (TRAP_sig(uc) != 0x400 && (DSISR_sig(uc) & 0x02000000)) is_write = 1; #endif - return handle_cpu_signal(pc, (unsigned long)info->si_addr, + return handle_cpu_signal(pc, target_mem, is_write, &uc->uc_sigmask, puc); }