mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 16:25:31 +00:00
cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
Backports commit 8b1fe3f439eaa2f0a6ee7737942bb6c405725867 from qemu
This commit is contained in:
parent
b4b7b88f69
commit
eab60b7c77
|
@ -281,27 +281,31 @@ static inline void cpu_handle_interrupt(CPUState *cpu,
|
||||||
cpu_loop_exit(cpu);
|
cpu_loop_exit(cpu);
|
||||||
}
|
}
|
||||||
#if defined(TARGET_I386)
|
#if defined(TARGET_I386)
|
||||||
if (interrupt_request & CPU_INTERRUPT_INIT) {
|
else if (interrupt_request & CPU_INTERRUPT_INIT) {
|
||||||
cpu_svm_check_intercept_param(env, SVM_EXIT_INIT, 0);
|
cpu_svm_check_intercept_param(env, SVM_EXIT_INIT, 0);
|
||||||
do_cpu_init(x86_cpu);
|
do_cpu_init(x86_cpu);
|
||||||
cpu->exception_index = EXCP_HALTED;
|
cpu->exception_index = EXCP_HALTED;
|
||||||
cpu_loop_exit(cpu);
|
cpu_loop_exit(cpu);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (interrupt_request & CPU_INTERRUPT_RESET) {
|
else if (interrupt_request & CPU_INTERRUPT_RESET) {
|
||||||
cpu_reset(cpu);
|
cpu_reset(cpu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* The target hook has 3 exit conditions:
|
else {
|
||||||
False when the interrupt isn't processed,
|
/* The target hook has 3 exit conditions:
|
||||||
True when it is, and we should restart on a new TB,
|
False when the interrupt isn't processed,
|
||||||
and via longjmp via cpu_loop_exit. */
|
True when it is, and we should restart on a new TB,
|
||||||
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
|
and via longjmp via cpu_loop_exit. */
|
||||||
*last_tb = NULL;
|
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
|
||||||
|
*last_tb = NULL;
|
||||||
|
}
|
||||||
|
/* The target hook may have updated the 'cpu->interrupt_request';
|
||||||
|
* reload the 'interrupt_request' value */
|
||||||
|
interrupt_request = cpu->interrupt_request;
|
||||||
}
|
}
|
||||||
/* Don't use the cached interrupt_request value,
|
|
||||||
do_interrupt may have updated the EXITTB flag. */
|
if (interrupt_request & CPU_INTERRUPT_EXITTB) {
|
||||||
if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) {
|
|
||||||
cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB;
|
cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB;
|
||||||
/* ensure that no TB jump will be modified as
|
/* ensure that no TB jump will be modified as
|
||||||
the program flow was changed */
|
the program flow was changed */
|
||||||
|
|
Loading…
Reference in a new issue