qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 11/18] Introduce VCPU self-signaling service


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH 11/18] Introduce VCPU self-signaling service
Date: Mon, 10 Jan 2011 09:32:04 +0100

From: Jan Kiszka <address@hidden>

Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
context. First user will be kvm.

Signed-off-by: Jan Kiszka <address@hidden>
---
 cpus.c        |   19 ++++++++++++++++++-
 qemu-common.h |    1 +
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/cpus.c b/cpus.c
index 89b4bd7..4a4d130 100644
--- a/cpus.c
+++ b/cpus.c
@@ -450,7 +450,17 @@ void pause_all_vcpus(void)
 
 void qemu_cpu_kick(void *env)
 {
-    return;
+}
+
+void qemu_cpu_kick_self(void)
+{
+#ifndef _WIN32
+    assert(cpu_single_env);
+
+    raise(SIG_IPI);
+#else
+    abort();
+#endif
 }
 
 void qemu_notify_event(void)
@@ -789,6 +799,13 @@ void qemu_cpu_kick(void *_env)
     qemu_thread_signal(env->thread, SIG_IPI);
 }
 
+void qemu_cpu_kick_self(void)
+{
+    assert(cpu_single_env);
+
+    qemu_thread_signal(cpu_single_env->thread, SIG_IPI);
+}
+
 int qemu_cpu_self(void *_env)
 {
     CPUState *env = _env;
diff --git a/qemu-common.h b/qemu-common.h
index 63d9943..220c8c8 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -287,6 +287,7 @@ void qemu_notify_event(void);
 
 /* Unblock cpu */
 void qemu_cpu_kick(void *env);
+void qemu_cpu_kick_self(void);
 int qemu_cpu_self(void *env);
 
 /* work queue */
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]