diff options
author | aurel32 | 2008-09-15 08:42:30 +0200 |
---|---|---|
committer | aurel32 | 2008-09-15 08:42:30 +0200 |
commit | f24f381b2de01c37a811ac06c7d60644fd74a5b5 (patch) | |
tree | 1c3bcbc8ddb98f506c76ab38c2bffac32f7e184f /target-sh4 | |
parent | Fix array subscript above array bounds error (diff) | |
download | qemu-f24f381b2de01c37a811ac06c7d60644fd74a5b5.tar.gz qemu-f24f381b2de01c37a811ac06c7d60644fd74a5b5.tar.xz qemu-f24f381b2de01c37a811ac06c7d60644fd74a5b5.zip |
SH4: sleep instruction bug fix
fix a bug on 'sleep' instruction, which have caused halt of idle task.
As i386 'hlt' instruction does, it should save PC before sleep.
(Shin-ichiro KAWASAKI)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5220 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sh4')
-rw-r--r-- | target-sh4/helper.h | 2 | ||||
-rw-r--r-- | target-sh4/op_helper.c | 3 | ||||
-rw-r--r-- | target-sh4/translate.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/target-sh4/helper.h b/target-sh4/helper.h index 994dc0820d..cb157cdb86 100644 --- a/target-sh4/helper.h +++ b/target-sh4/helper.h @@ -6,7 +6,7 @@ DEF_HELPER(void, helper_ldtlb, (void)) DEF_HELPER(void, helper_raise_illegal_instruction, (void)) DEF_HELPER(void, helper_raise_slot_illegal_instruction, (void)) DEF_HELPER(void, helper_debug, (void)) -DEF_HELPER(void, helper_sleep, (void)) +DEF_HELPER(void, helper_sleep, (uint32_t)) DEF_HELPER(void, helper_trapa, (uint32_t)) DEF_HELPER(uint32_t, helper_addv, (uint32_t, uint32_t)) diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c index 48a170f79c..e5b3c98ab4 100644 --- a/target-sh4/op_helper.c +++ b/target-sh4/op_helper.c @@ -94,10 +94,11 @@ void helper_debug(void) cpu_loop_exit(); } -void helper_sleep(void) +void helper_sleep(uint32_t next_pc) { env->halted = 1; env->exception_index = EXCP_HLT; + env->pc = next_pc; cpu_loop_exit(); } diff --git a/target-sh4/translate.c b/target-sh4/translate.c index 8e97696e68..3943ab3c7b 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -505,7 +505,7 @@ void _decode_opc(DisasContext * ctx) return; case 0x001b: /* sleep */ if (ctx->memidx) { - tcg_gen_helper_0_0(helper_sleep); + tcg_gen_helper_0_1(helper_sleep, tcg_const_i32(ctx->pc + 2)); } else { tcg_gen_helper_0_0(helper_raise_illegal_instruction); ctx->bstate = BS_EXCP; |