| 133 |
env->cpsr = psr & ~0xf0000000; |
env->cpsr = psr & ~0xf0000000; |
| 134 |
} |
} |
| 135 |
#elif defined(TARGET_SPARC) |
#elif defined(TARGET_SPARC) |
| 136 |
|
#elif defined(TARGET_PPC) |
| 137 |
#else |
#else |
| 138 |
#error unsupported target CPU |
#error unsupported target CPU |
| 139 |
#endif |
#endif |
| 229 |
env->cpsr &= ~0xf0000000; |
env->cpsr &= ~0xf0000000; |
| 230 |
#elif defined(TARGET_SPARC) |
#elif defined(TARGET_SPARC) |
| 231 |
cpu_sparc_dump_state (env, logfile, 0); |
cpu_sparc_dump_state (env, logfile, 0); |
| 232 |
|
#elif defined(TARGET_PPC) |
| 233 |
|
cpu_ppc_dump_state(env, logfile, 0); |
| 234 |
#else |
#else |
| 235 |
#error unsupported target CPU |
#error unsupported target CPU |
| 236 |
#endif |
#endif |
| 249 |
cs_base = 0; |
cs_base = 0; |
| 250 |
pc = (uint8_t *)env->regs[15]; |
pc = (uint8_t *)env->regs[15]; |
| 251 |
#elif defined(TARGET_SPARC) |
#elif defined(TARGET_SPARC) |
| 252 |
flags = 0; |
flags = 0; |
| 253 |
cs_base = 0; |
cs_base = 0; |
| 254 |
if (env->npc) { |
if (env->npc) { |
| 255 |
env->pc = env->npc; |
env->pc = env->npc; |
| 256 |
env->npc = 0; |
env->npc = 0; |
| 257 |
} |
} |
| 258 |
pc = (uint8_t *) env->pc; |
pc = (uint8_t *) env->pc; |
| 259 |
|
#elif defined(TARGET_PPC) |
| 260 |
|
flags = 0; |
| 261 |
|
cs_base = 0; |
| 262 |
|
pc = (uint8_t *)env->nip; |
| 263 |
#else |
#else |
| 264 |
#error unsupported CPU |
#error unsupported CPU |
| 265 |
#endif |
#endif |
| 383 |
#elif defined(TARGET_ARM) |
#elif defined(TARGET_ARM) |
| 384 |
env->cpsr = compute_cpsr(); |
env->cpsr = compute_cpsr(); |
| 385 |
#elif defined(TARGET_SPARC) |
#elif defined(TARGET_SPARC) |
| 386 |
|
#elif defined(TARGET_PPC) |
| 387 |
#else |
#else |
| 388 |
#error unsupported target CPU |
#error unsupported target CPU |
| 389 |
#endif |
#endif |
| 521 |
{ |
{ |
| 522 |
return 0; |
return 0; |
| 523 |
} |
} |
| 524 |
|
#elif defined (TARGET_PPC) |
| 525 |
|
static inline int handle_cpu_signal(unsigned long pc, unsigned long address, |
| 526 |
|
int is_write, sigset_t *old_set) |
| 527 |
|
{ |
| 528 |
|
TranslationBlock *tb; |
| 529 |
|
|
| 530 |
|
#if 0 |
| 531 |
|
if (cpu_single_env) |
| 532 |
|
env = cpu_single_env; /* XXX: find a correct solution for multithread */ |
| 533 |
|
#endif |
| 534 |
|
#if defined(DEBUG_SIGNAL) |
| 535 |
|
printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", |
| 536 |
|
pc, address, is_write, *(unsigned long *)old_set); |
| 537 |
|
#endif |
| 538 |
|
/* XXX: locking issue */ |
| 539 |
|
if (is_write && page_unprotect(address)) { |
| 540 |
|
return 1; |
| 541 |
|
} |
| 542 |
|
|
| 543 |
|
/* now we have a real cpu fault */ |
| 544 |
|
tb = tb_find_pc(pc); |
| 545 |
|
if (tb) { |
| 546 |
|
/* the PC is inside the translated code. It means that we have |
| 547 |
|
a virtual CPU fault */ |
| 548 |
|
cpu_restore_state(tb, env, pc); |
| 549 |
|
} |
| 550 |
|
#if 0 |
| 551 |
|
printf("PF exception: EIP=0x%08x CR2=0x%08x error=0x%x\n", |
| 552 |
|
env->eip, env->cr[2], env->error_code); |
| 553 |
|
#endif |
| 554 |
|
/* we restore the process signal mask as the sigreturn should |
| 555 |
|
do it (XXX: use sigsetjmp) */ |
| 556 |
|
sigprocmask(SIG_SETMASK, old_set, NULL); |
| 557 |
|
raise_exception_err(EXCP_PROGRAM, env->error_code); |
| 558 |
|
/* never comes here */ |
| 559 |
|
return 1; |
| 560 |
|
} |
| 561 |
#else |
#else |
| 562 |
#error unsupported target CPU |
#error unsupported target CPU |
| 563 |
#endif |
#endif |