qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [7243] qemu: introduce qemu_cpu_kick (Marcelo Tosatti)
@ 2009-04-24 18:03 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-04-24 18:03 UTC (permalink / raw)
  To: qemu-devel

Revision: 7243
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7243
Author:   aliguori
Date:     2009-04-24 18:03:45 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
qemu: introduce qemu_cpu_kick (Marcelo Tosatti)

To notify cpu of pending interrupt.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/exec.c
    trunk/qemu-common.h
    trunk/vl.c

Modified: trunk/exec.c
===================================================================
--- trunk/exec.c	2009-04-24 18:03:41 UTC (rev 7242)
+++ trunk/exec.c	2009-04-24 18:03:45 UTC (rev 7243)
@@ -1542,6 +1542,17 @@
     old_mask = env->interrupt_request;
     env->interrupt_request |= mask;
 
+#ifndef CONFIG_USER_ONLY
+    /*
+     * If called from iothread context, wake the target cpu in
+     * case its halted.
+     */
+    if (!qemu_cpu_self(env)) {
+        qemu_cpu_kick(env);
+        return;
+    }
+#endif
+
     if (use_icount) {
         env->icount_decr.u16.high = 0xffff;
 #ifndef CONFIG_USER_ONLY

Modified: trunk/qemu-common.h
===================================================================
--- trunk/qemu-common.h	2009-04-24 18:03:41 UTC (rev 7242)
+++ trunk/qemu-common.h	2009-04-24 18:03:45 UTC (rev 7243)
@@ -189,6 +189,10 @@
 /* Force QEMU to process pending events */
 void qemu_notify_event(void);
 
+/* Unblock cpu */
+void qemu_cpu_kick(void *env);
+int qemu_cpu_self(void *env);
+
 #ifdef CONFIG_USER_ONLY
 #define qemu_init_vcpu(env) do { } while (0)
 #else

Modified: trunk/vl.c
===================================================================
--- trunk/vl.c	2009-04-24 18:03:41 UTC (rev 7242)
+++ trunk/vl.c	2009-04-24 18:03:45 UTC (rev 7243)
@@ -3740,6 +3740,16 @@
     return;
 }
 
+int qemu_cpu_self(void *env)
+{
+    return 1;
+}
+
+void qemu_cpu_kick(void *env)
+{
+    return;
+}
+
 #ifdef _WIN32
 static void host_main_loop_wait(int *timeout)
 {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-24 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-24 18:03 [Qemu-devel] [7243] qemu: introduce qemu_cpu_kick (Marcelo Tosatti) Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).