From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wf-0000KE-C1 for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SX1wb-0005ZJ-8m for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:04 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35547 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wb-0005Yb-0P for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:01 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id EC809978B8 for ; Wed, 23 May 2012 05:08:59 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 23 May 2012 05:07:30 +0200 Message-Id: <1337742502-28565-8-git-send-email-afaerber@suse.de> In-Reply-To: <1337742502-28565-1-git-send-email-afaerber@suse.de> References: <1337742502-28565-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-next 07/59] cpu: Move thread_kicked to CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Change field type to bool. Signed-off-by: Andreas F=C3=A4rber --- cpu-defs.h | 1 - cpus.c | 14 +++++++++----- include/qemu/cpu.h | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cpu-defs.h b/cpu-defs.h index be89684..4018b88 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -209,7 +209,6 @@ typedef struct CPUWatchpoint { uint32_t stop; /* Stop request */ = \ uint32_t stopped; /* Artificially stopped */ = \ struct QemuCond *halt_cond; = \ - int thread_kicked; = \ struct qemu_work_item *queued_work_first, *queued_work_last; = \ const char *cpu_model_str; = \ struct KVMState *kvm_state; = \ diff --git a/cpus.c b/cpus.c index b12890b..7d8e2ad 100644 --- a/cpus.c +++ b/cpus.c @@ -686,13 +686,15 @@ static void flush_queued_work(CPUArchState *env) =20 static void qemu_wait_io_event_common(CPUArchState *env) { + CPUState *cpu =3D ENV_GET_CPU(env); + if (env->stop) { env->stop =3D 0; env->stopped =3D 1; qemu_cond_signal(&qemu_pause_cond); } flush_queued_work(env); - env->thread_kicked =3D false; + cpu->thread_kicked =3D false; } =20 static void qemu_tcg_wait_io_event(void) @@ -866,11 +868,12 @@ static void qemu_cpu_kick_thread(CPUArchState *env) void qemu_cpu_kick(void *_env) { CPUArchState *env =3D _env; + CPUState *cpu =3D ENV_GET_CPU(env); =20 qemu_cond_broadcast(env->halt_cond); - if (!tcg_enabled() && !env->thread_kicked) { + if (!tcg_enabled() && !cpu->thread_kicked) { qemu_cpu_kick_thread(env); - env->thread_kicked =3D true; + cpu->thread_kicked =3D true; } } =20 @@ -878,10 +881,11 @@ void qemu_cpu_kick_self(void) { #ifndef _WIN32 assert(cpu_single_env); + CPUState *cpu_single_cpu =3D ENV_GET_CPU(cpu_single_env); =20 - if (!cpu_single_env->thread_kicked) { + if (!cpu_single_cpu->thread_kicked) { qemu_cpu_kick_thread(cpu_single_env); - cpu_single_env->thread_kicked =3D true; + cpu_single_cpu->thread_kicked =3D true; } #else abort(); diff --git a/include/qemu/cpu.h b/include/qemu/cpu.h index d20644b..ad706a6 100644 --- a/include/qemu/cpu.h +++ b/include/qemu/cpu.h @@ -66,6 +66,7 @@ struct CPUState { #ifdef _WIN32 HANDLE hThread; #endif + bool thread_kicked; =20 /* TODO Move common fields from CPUArchState here. */ }; --=20 1.7.7