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,6 +476,7 @@ static void flush_windows(CPUSPARCState *env) | ||
476 | void cpu_loop (CPUSPARCState *env) | 476 | void cpu_loop (CPUSPARCState *env) |
477 | { | 477 | { |
478 | int trapnr, ret; | 478 | int trapnr, ret; |
479 | + target_siginfo_t info; | ||
479 | 480 | ||
480 | while (1) { | 481 | while (1) { |
481 | trapnr = cpu_sparc_exec (env); | 482 | trapnr = cpu_sparc_exec (env); |
@@ -510,6 +511,17 @@ void cpu_loop (CPUSPARCState *env) | @@ -510,6 +511,17 @@ void cpu_loop (CPUSPARCState *env) | ||
510 | case TT_WIN_UNF: /* window underflow */ | 511 | case TT_WIN_UNF: /* window underflow */ |
511 | restore_window(env); | 512 | restore_window(env); |
512 | break; | 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 | case 0x100: // XXX, why do we get these? | 525 | case 0x100: // XXX, why do we get these? |
514 | break; | 526 | break; |
515 | default: | 527 | default: |