qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH qom-cpu 41/59] target-mips: Abstract helper_dvpe() w


From: Andreas Färber
Subject: [Qemu-devel] [PATCH qom-cpu 41/59] target-mips: Abstract helper_dvpe() with qemu_for_each_cpu()
Date: Sun, 9 Jun 2013 21:13:08 +0200

Signed-off-by: Andreas Färber <address@hidden>
---
 target-mips/op_helper.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index f6838ec..077e81c 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1694,21 +1694,24 @@ target_ulong helper_emt(void)
     return 0;
 }
 
+static void helper_dvpe_one(CPUState *cs, void *data)
+{
+    MIPSCPU *self_cpu = data;
+    MIPSCPU *cpu = MIPS_CPU(cs);
+
+    if (cpu == self_cpu) {
+        return;
+    }
+    cpu->env.mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);
+    mips_vpe_sleep(cpu);
+}
+
 target_ulong helper_dvpe(CPUMIPSState *env)
 {
-    CPUMIPSState *other_cpu_env = first_cpu;
     target_ulong prev = env->mvp->CP0_MVPControl;
 
-    do {
-        /* Turn off all VPEs except the one executing the dvpe.  */
-        if (other_cpu_env != env) {
-            MIPSCPU *other_cpu = mips_env_get_cpu(other_cpu_env);
-
-            other_cpu_env->mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);
-            mips_vpe_sleep(other_cpu);
-        }
-        other_cpu_env = other_cpu_env->next_cpu;
-    } while (other_cpu_env);
+    /* Turn off all VPEs except the one executing the dvpe.  */
+    qemu_for_each_cpu(helper_dvpe_one, mips_env_get_cpu(env));
     return prev;
 }
 
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]