Received: from eggs.gnu.org ([208.118.235.92]:38807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMRgV-0002aa-Cn for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMRgT-0003sd-AS for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:55 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49223 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMRgT-0003sE-1V for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:53 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 12 Oct 2012 00:56:35 +0200 Message-Id: <1349996197-11054-4-git-send-email-afaerber@suse.de> In-Reply-To: <1349996197-11054-1-git-send-email-afaerber@suse.de> References: <1349996197-11054-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 v2 3/5] target-mips: Pass MIPSCPU to mips_vpe_is_wfi() 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?= , aurelien@aurel32.net Needed for moving halted field to CPUState. The variable name "c" is retained for MIPSCPU to leave "cpu" for CPUState= . Also change return type to bool while at it. Signed-off-by: Andreas F=C3=A4rber --- target-mips/op_helper.c | 12 ++++++++---- 1 Datei ge=C3=A4ndert, 8 Zeilen hinzugef=C3=BCgt(+), 4 Zeilen entfernt(-= ) diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index e721a4d..9770741 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -714,11 +714,13 @@ void helper_sdm(CPUMIPSState *env, target_ulong add= r, target_ulong reglist, =20 #ifndef CONFIG_USER_ONLY /* SMP helpers. */ -static int mips_vpe_is_wfi(CPUMIPSState *c) +static bool mips_vpe_is_wfi(MIPSCPU *c) { + CPUMIPSState *env =3D &c->env; + /* If the VPE is halted but otherwise active, it means it's waiting = for an interrupt. */ - return c->halted && mips_vpe_active(c); + return env->halted && mips_vpe_active(env); } =20 static inline void mips_vpe_wake(CPUMIPSState *c) @@ -742,7 +744,7 @@ static inline void mips_tc_wake(MIPSCPU *cpu, int tc) CPUMIPSState *c =3D &cpu->env; =20 /* FIXME: TC reschedule. */ - if (mips_vpe_active(c) && !mips_vpe_is_wfi(c)) { + if (mips_vpe_active(c) && !mips_vpe_is_wfi(cpu)) { mips_vpe_wake(c); } } @@ -1899,9 +1901,11 @@ target_ulong helper_evpe(CPUMIPSState *env) target_ulong prev =3D env->mvp->CP0_MVPControl; =20 do { + MIPSCPU *other_cpu =3D mips_env_get_cpu(other_cpu_env); + if (other_cpu_env !=3D env /* If the VPE is WFI, don't disturb its sleep. */ - && !mips_vpe_is_wfi(other_cpu_env)) { + && !mips_vpe_is_wfi(other_cpu)) { /* Enable the VPE. */ other_cpu_env->mvp->CP0_MVPControl |=3D (1 << CP0MVPCo_EVP); mips_vpe_wake(other_cpu_env); /* And wake it up. */ --=20 1.7.10.4