From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTMfh-0007yv-KC for qemu-devel@nongnu.org; Tue, 30 Oct 2012 21:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTMfb-0005Iq-AO for qemu-devel@nongnu.org; Tue, 30 Oct 2012 21:00:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52383 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTMfb-0005IO-4J for qemu-devel@nongnu.org; Tue, 30 Oct 2012 21:00:35 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 31 Oct 2012 01:59:45 +0100 Message-Id: <1351645206-3041-15-git-send-email-afaerber@suse.de> In-Reply-To: <1351645206-3041-1-git-send-email-afaerber@suse.de> References: <1351645206-3041-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 14/35] cpus: Pass CPUState to cpu_can_run() 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?= , anthony@codemonkey.ws CPUArchState is no longer needed there. Also change its return type to bool. Signed-off-by: Andreas F=C3=A4rber --- cpus.c | 14 ++++++-------- 1 Datei ge=C3=A4ndert, 6 Zeilen hinzugef=C3=BCgt(+), 8 Zeilen entfernt(-= ) diff --git a/cpus.c b/cpus.c index 0721a96..45877ee 100644 --- a/cpus.c +++ b/cpus.c @@ -448,17 +448,15 @@ static void do_vm_stop(RunState state) } } =20 -static int cpu_can_run(CPUArchState *env) +static bool cpu_can_run(CPUState *cpu) { - CPUState *cpu =3D ENV_GET_CPU(env); - if (cpu->stop) { - return 0; + return false; } if (cpu->stopped || !runstate_is_running()) { - return 0; + return false; } - return 1; + return true; } =20 static void cpu_handle_guest_debug(CPUArchState *env) @@ -756,7 +754,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) qemu_cond_signal(&qemu_cpu_cond); =20 while (1) { - if (cpu_can_run(env)) { + if (cpu_can_run(cpu)) { r =3D kvm_cpu_exec(env); if (r =3D=3D EXCP_DEBUG) { cpu_handle_guest_debug(env); @@ -1153,7 +1151,7 @@ static void tcg_exec_all(void) qemu_clock_enable(vm_clock, (env->singlestep_enabled & SSTEP_NOTIMER) =3D=3D= 0); =20 - if (cpu_can_run(env)) { + if (cpu_can_run(cpu)) { r =3D tcg_cpu_exec(env); if (r =3D=3D EXCP_DEBUG) { cpu_handle_guest_debug(env); --=20 1.7.10.4