diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-03-20 12:43:29 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-03-20 12:43:29 +0000 |
commit | c3278b7bf0be16b06f51aa82ffbf4807e608e7b1 (patch) | |
tree | b07018f2567798b25b4e3063d1133ccc0f4c94de /translate-all.c | |
parent | 86bd2ca58a99c5dec1372809236640bcc8ede2cd (diff) |
sparc exception fix (we go up to the shell prompt)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1343 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'translate-all.c')
-rw-r--r-- | translate-all.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/translate-all.c b/translate-all.c index fd7cc668cf..e4f7c9c19e 100644 --- a/translate-all.c +++ b/translate-all.c @@ -52,6 +52,7 @@ uint8_t gen_opc_instr_start[OPC_BUF_SIZE]; uint8_t gen_opc_cc_op[OPC_BUF_SIZE]; #elif defined(TARGET_SPARC) target_ulong gen_opc_npc[OPC_BUF_SIZE]; +target_ulong gen_opc_jump_pc[2]; #endif int code_copy_enabled = 1; @@ -244,9 +245,23 @@ int cpu_restore_state(TranslationBlock *tb, #elif defined(TARGET_ARM) env->regs[15] = gen_opc_pc[j]; #elif defined(TARGET_SPARC) - /* XXX: restore npc too */ - env->pc = gen_opc_pc[j]; - env->npc = gen_opc_npc[j]; + { + target_ulong npc; + env->pc = gen_opc_pc[j]; + npc = gen_opc_npc[j]; + if (npc == 1) { + /* dynamic NPC: already stored */ + } else if (npc == 2) { + target_ulong t2 = (target_ulong)puc; + /* jump PC: use T2 and the jump targets of the translation */ + if (t2) + env->npc = gen_opc_jump_pc[0]; + else + env->npc = gen_opc_jump_pc[1]; + } else { + env->npc = npc; + } + } #elif defined(TARGET_PPC) { int type; |