Commit 61ff6f58e90af68c572b29dccc537359b0ce1a1e
1 parent
0bee699e
sparc sigsegv support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1293 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
12 additions
and
0 deletions
linux-user/main.c
... | ... | @@ -476,6 +476,7 @@ static void flush_windows(CPUSPARCState *env) |
476 | 476 | void cpu_loop (CPUSPARCState *env) |
477 | 477 | { |
478 | 478 | int trapnr, ret; |
479 | + target_siginfo_t info; | |
479 | 480 | |
480 | 481 | while (1) { |
481 | 482 | trapnr = cpu_sparc_exec (env); |
... | ... | @@ -510,6 +511,17 @@ void cpu_loop (CPUSPARCState *env) |
510 | 511 | case TT_WIN_UNF: /* window underflow */ |
511 | 512 | restore_window(env); |
512 | 513 | break; |
514 | + case TT_TFAULT: | |
515 | + case TT_DFAULT: | |
516 | + { | |
517 | + info.si_signo = SIGSEGV; | |
518 | + info.si_errno = 0; | |
519 | + /* XXX: check env->error_code */ | |
520 | + info.si_code = TARGET_SEGV_MAPERR; | |
521 | + info._sifields._sigfault._addr = env->mmuregs[4]; | |
522 | + queue_signal(info.si_signo, &info); | |
523 | + } | |
524 | + break; | |
513 | 525 | case 0x100: // XXX, why do we get these? |
514 | 526 | break; |
515 | 527 | default: | ... | ... |