diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-05-14 23:01:10 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-05-14 23:01:10 +0000 |
commit | 2b413144dcb22ff1852c46d3be7aa4bd9095723f (patch) | |
tree | 8c94088d13a0366f824cdb9be04221736bff19a6 | |
parent | 3ebcc707d20643e9fefa24a4396de577b1163755 (diff) |
cosmetics
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@173 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | exec-i386.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/exec-i386.c b/exec-i386.c index 18ea188886..7575123ec5 100644 --- a/exec-i386.c +++ b/exec-i386.c @@ -324,10 +324,8 @@ void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector) the effective address of the memory exception. 'is_write' is 1 if a write caused the exception and otherwise 0'. 'old_set' is the signal set which should be restored */ -static inline int handle_cpu_signal(unsigned long pc, - unsigned long address, - int is_write, - sigset_t *old_set) +static inline int handle_cpu_signal(unsigned long pc, unsigned long address, + int is_write, sigset_t *old_set) { #if defined(DEBUG_SIGNAL) printf("qemu: SIGSEGV pc=0x%08lx address=%08lx wr=%d oldset=0x%08lx\n", @@ -355,13 +353,13 @@ static inline int handle_cpu_signal(unsigned long pc, } } +#if defined(__i386__) + int cpu_x86_signal_handler(int host_signum, struct siginfo *info, void *puc) { -#if defined(__i386__) struct ucontext *uc = puc; unsigned long pc; - sigset_t *pold_set; #ifndef REG_EIP /* for glibc 2.1 */ @@ -370,20 +368,23 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info, #define REG_TRAPNO TRAPNO #endif pc = uc->uc_mcontext.gregs[REG_EIP]; - pold_set = &uc->uc_sigmask; return handle_cpu_signal(pc, (unsigned long)info->si_addr, uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe ? (uc->uc_mcontext.gregs[REG_ERR] >> 1) & 1 : 0, - pold_set); + &uc->uc_sigmask); +} + #elif defined(__powerpc) + +int cpu_x86_signal_handler(int host_signum, struct siginfo *info, + void *puc) +{ struct ucontext *uc = puc; struct pt_regs *regs = uc->uc_mcontext.regs; unsigned long pc; - sigset_t *pold_set; int is_write; pc = regs->nip; - pold_set = &uc->uc_sigmask; is_write = 0; #if 0 /* ppc 4xx case */ @@ -394,9 +395,11 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info, is_write = 1; #endif return handle_cpu_signal(pc, (unsigned long)info->si_addr, - is_write, pold_set); + is_write, &uc->uc_sigmask); +} + #else + #error CPU specific signal handler needed - return 0; + #endif -} |