From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull4X-0000pS-D7 for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ull4V-0000nN-Nj for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44453 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull4V-0000n3-GS for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:14:35 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 9 Jun 2013 21:13:09 +0200 Message-Id: <1370805206-26574-43-git-send-email-afaerber@suse.de> In-Reply-To: <1370805206-26574-1-git-send-email-afaerber@suse.de> References: <1370805206-26574-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-cpu 42/59] target-mips: Abstract helper_evpe() with qemu_for_each_cpu() 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 Jarno Signed-off-by: Andreas F=C3=A4rber --- target-mips/op_helper.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 077e81c..6c64d83 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -1715,23 +1715,29 @@ target_ulong helper_dvpe(CPUMIPSState *env) return prev; } =20 +static void helper_evpe_one(CPUState *cs, void *data) +{ + MIPSCPU *self_cpu =3D data; + MIPSCPU *cpu =3D MIPS_CPU(cs); + + if (cpu =3D=3D self_cpu) { + return; + } + /* If the VPE is WFI, don't disturb its sleep. */ + if (mips_vpe_is_wfi(cpu)) { + return; + } + /* Enable the VPE. */ + cpu->env.mvp->CP0_MVPControl |=3D (1 << CP0MVPCo_EVP); + /* And wake it up. */ + mips_vpe_wake(cpu); +} + target_ulong helper_evpe(CPUMIPSState *env) { - CPUMIPSState *other_cpu_env =3D first_cpu; 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)) { - /* Enable the VPE. */ - other_cpu_env->mvp->CP0_MVPControl |=3D (1 << CP0MVPCo_EVP); - mips_vpe_wake(other_cpu); /* And wake it up. */ - } - other_cpu_env =3D other_cpu_env->next_cpu; - } while (other_cpu_env); + qemu_for_each_cpu(helper_evpe_one, mips_env_get_cpu(env)); return prev; } #endif /* !CONFIG_USER_ONLY */ --=20 1.8.1.4