do not use syscall to quit emulation. this can fix issues #147 & #148

This commit is contained in:
Nguyen Anh Quynh
2015-09-26 16:49:00 +08:00
parent 79b81e6ae4
commit 886946dcf4
22 changed files with 57 additions and 29 deletions

View File

@@ -10974,7 +10974,8 @@ static void disas_a64_insn(CPUARMState *env, DisasContext *s)
// Unicorn: end address tells us to stop emulation
if (s->pc == s->uc->addr_end) {
gen_exception_insn(s, 0, EXCP_SWI, 0);
// imitate WFI instruction to halt emulation
s->is_jmp = DISAS_WFI;
return;
}
@@ -11107,8 +11108,9 @@ void gen_intermediate_code_internal_a64(ARMCPU *cpu,
// Unicorn: early check to see if the address of this block is the until address
if (tb->pc == env->uc->addr_end) {
// imitate WFI instruction to halt emulation
gen_tb_start(tcg_ctx);
gen_exception_insn(dc, 0, EXCP_SWI, 0);
dc->is_jmp = DISAS_WFI;
goto done_generating;
}