aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-29 17:03:55 +0200
committerPeter Maydell <peter.maydell@linaro.org>2011-10-17 15:41:07 +0000
commitdfc7a4ce48fdb5cb727557fd338b7d995fb34e89 (patch)
treecd79b29fdd247fb7be48ecb2d96b53984447b4d9
parent62963f02e6c6282e365fd0645b3c2d9e8a8777cc (diff)
downloadqemu-arm-dfc7a4ce48fdb5cb727557fd338b7d995fb34e89.tar.gz
Prepare Windows port for thread-local cpu_single_env
Windows does not execute cpu_signal in VCPU-thread context, so it won't be able to use cpu_single_env there. However, it has the CPUState available, so nothing is lost. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--cpus.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/cpus.c b/cpus.c
index 89787794e8..822ce7a10d 100644
--- a/cpus.c
+++ b/cpus.c
@@ -176,10 +176,10 @@ static void cpu_handle_guest_debug(CPUState *env)
env->stopped = 1;
}
-static void cpu_signal(int sig)
+static inline void do_cpu_kick(CPUState *env)
{
- if (cpu_single_env) {
- cpu_exit(cpu_single_env);
+ if (env) {
+ cpu_exit(env);
}
exit_request = 1;
}
@@ -437,6 +437,11 @@ static void qemu_kvm_init_cpu_signals(CPUState *env)
}
}
+static void cpu_signal(int sig)
+{
+ do_cpu_kick(cpu_single_env);
+}
+
static void qemu_tcg_init_cpu_signals(void)
{
sigset_t set;
@@ -708,7 +713,7 @@ static void qemu_cpu_kick_thread(CPUState *env)
#else /* _WIN32 */
if (!qemu_cpu_is_self(env)) {
SuspendThread(env->thread->thread);
- cpu_signal(0);
+ do_cpu_kick(env);
ResumeThread(env->thread->thread);
}
#endif