Commit 2b413144dcb22ff1852c46d3be7aa4bd9095723f

Authored by bellard
1 parent 3ebcc707

cosmetics


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@173 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 16 additions and 13 deletions
exec-i386.c
... ... @@ -324,10 +324,8 @@ void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector)
324 324 the effective address of the memory exception. 'is_write' is 1 if a
325 325 write caused the exception and otherwise 0'. 'old_set' is the
326 326 signal set which should be restored */
327   -static inline int handle_cpu_signal(unsigned long pc,
328   - unsigned long address,
329   - int is_write,
330   - sigset_t *old_set)
  327 +static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
  328 + int is_write, sigset_t *old_set)
331 329 {
332 330 #if defined(DEBUG_SIGNAL)
333 331 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,
355 353 }
356 354 }
357 355  
  356 +#if defined(__i386__)
  357 +
358 358 int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
359 359 void *puc)
360 360 {
361   -#if defined(__i386__)
362 361 struct ucontext *uc = puc;
363 362 unsigned long pc;
364   - sigset_t *pold_set;
365 363  
366 364 #ifndef REG_EIP
367 365 /* for glibc 2.1 */
... ... @@ -370,20 +368,23 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
370 368 #define REG_TRAPNO TRAPNO
371 369 #endif
372 370 pc = uc->uc_mcontext.gregs[REG_EIP];
373   - pold_set = &uc->uc_sigmask;
374 371 return handle_cpu_signal(pc, (unsigned long)info->si_addr,
375 372 uc->uc_mcontext.gregs[REG_TRAPNO] == 0xe ?
376 373 (uc->uc_mcontext.gregs[REG_ERR] >> 1) & 1 : 0,
377   - pold_set);
  374 + &uc->uc_sigmask);
  375 +}
  376 +
378 377 #elif defined(__powerpc)
  378 +
  379 +int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
  380 + void *puc)
  381 +{
379 382 struct ucontext *uc = puc;
380 383 struct pt_regs *regs = uc->uc_mcontext.regs;
381 384 unsigned long pc;
382   - sigset_t *pold_set;
383 385 int is_write;
384 386  
385 387 pc = regs->nip;
386   - pold_set = &uc->uc_sigmask;
387 388 is_write = 0;
388 389 #if 0
389 390 /* ppc 4xx case */
... ... @@ -394,9 +395,11 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
394 395 is_write = 1;
395 396 #endif
396 397 return handle_cpu_signal(pc, (unsigned long)info->si_addr,
397   - is_write, pold_set);
  398 + is_write, &uc->uc_sigmask);
  399 +}
  400 +
398 401 #else
  402 +
399 403 #error CPU specific signal handler needed
400   - return 0;
  404 +
401 405 #endif
402   -}
... ...