mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
Use a dedicated function to request exit from execution loop
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
9e995645b5
commit
3098dba01c
9 changed files with 48 additions and 39 deletions
14
vl.c
14
vl.c
|
@ -1181,7 +1181,7 @@ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
|
|||
}
|
||||
/* Interrupt execution to force deadline recalculation. */
|
||||
if (use_icount && cpu_single_env) {
|
||||
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(cpu_single_env);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1348,7 +1348,7 @@ static void host_alarm_handler(int host_signum)
|
|||
|
||||
if (env) {
|
||||
/* stop the currently executing cpu because a timer occured */
|
||||
cpu_interrupt(env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(env);
|
||||
#ifdef USE_KQEMU
|
||||
if (env->kqemu_enabled) {
|
||||
kqemu_cpu_interrupt(env);
|
||||
|
@ -3326,7 +3326,7 @@ void qemu_service_io(void)
|
|||
{
|
||||
CPUState *env = cpu_single_env;
|
||||
if (env) {
|
||||
cpu_interrupt(env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(env);
|
||||
#ifdef USE_KQEMU
|
||||
if (env->kqemu_enabled) {
|
||||
kqemu_cpu_interrupt(env);
|
||||
|
@ -3407,7 +3407,7 @@ void qemu_bh_schedule(QEMUBH *bh)
|
|||
bh->idle = 0;
|
||||
/* stop the currently executing CPU to execute the BH ASAP */
|
||||
if (env) {
|
||||
cpu_interrupt(env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(env);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3618,21 +3618,21 @@ void qemu_system_reset_request(void)
|
|||
reset_requested = 1;
|
||||
}
|
||||
if (cpu_single_env)
|
||||
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(cpu_single_env);
|
||||
}
|
||||
|
||||
void qemu_system_shutdown_request(void)
|
||||
{
|
||||
shutdown_requested = 1;
|
||||
if (cpu_single_env)
|
||||
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(cpu_single_env);
|
||||
}
|
||||
|
||||
void qemu_system_powerdown_request(void)
|
||||
{
|
||||
powerdown_requested = 1;
|
||||
if (cpu_single_env)
|
||||
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
|
||||
cpu_exit(cpu_single_env);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue