mirror of https://github.com/xqemu/xqemu.git
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
This commit is contained in:
parent
9f4576f08b
commit
f24f381b2d
|
@ -6,7 +6,7 @@ DEF_HELPER(void, helper_ldtlb, (void))
|
||||||
DEF_HELPER(void, helper_raise_illegal_instruction, (void))
|
DEF_HELPER(void, helper_raise_illegal_instruction, (void))
|
||||||
DEF_HELPER(void, helper_raise_slot_illegal_instruction, (void))
|
DEF_HELPER(void, helper_raise_slot_illegal_instruction, (void))
|
||||||
DEF_HELPER(void, helper_debug, (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(void, helper_trapa, (uint32_t))
|
||||||
|
|
||||||
DEF_HELPER(uint32_t, helper_addv, (uint32_t, uint32_t))
|
DEF_HELPER(uint32_t, helper_addv, (uint32_t, uint32_t))
|
||||||
|
|
|
@ -94,10 +94,11 @@ void helper_debug(void)
|
||||||
cpu_loop_exit();
|
cpu_loop_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void helper_sleep(void)
|
void helper_sleep(uint32_t next_pc)
|
||||||
{
|
{
|
||||||
env->halted = 1;
|
env->halted = 1;
|
||||||
env->exception_index = EXCP_HLT;
|
env->exception_index = EXCP_HLT;
|
||||||
|
env->pc = next_pc;
|
||||||
cpu_loop_exit();
|
cpu_loop_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -505,7 +505,7 @@ void _decode_opc(DisasContext * ctx)
|
||||||
return;
|
return;
|
||||||
case 0x001b: /* sleep */
|
case 0x001b: /* sleep */
|
||||||
if (ctx->memidx) {
|
if (ctx->memidx) {
|
||||||
tcg_gen_helper_0_0(helper_sleep);
|
tcg_gen_helper_0_1(helper_sleep, tcg_const_i32(ctx->pc + 2));
|
||||||
} else {
|
} else {
|
||||||
tcg_gen_helper_0_0(helper_raise_illegal_instruction);
|
tcg_gen_helper_0_0(helper_raise_illegal_instruction);
|
||||||
ctx->bstate = BS_EXCP;
|
ctx->bstate = BS_EXCP;
|
||||||
|
|
Loading…
Reference in New Issue