Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxPka-0004XY-N3 for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxPkZ-0004Wr-MC for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:48 -0400 Received: from [199.232.76.173] (port=36837 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxPkZ-0004We-Gj for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:47 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35166 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LxPkY-0003MO-Uw for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:47 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LxPkY-0002xB-En for qemu-devel@nongnu.org; Fri, 24 Apr 2009 18:03:46 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LxPkY-0002x7-7Y for qemu-devel@nongnu.org; Fri, 24 Apr 2009 18:03:46 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 24 Apr 2009 18:03:46 +0000 Subject: [Qemu-devel] [7243] qemu: introduce qemu_cpu_kick (Marcelo Tosatti) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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) {