qemu-ppc
[Top][All Lists]
Advanced

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

[Qemu-ppc] [PATCH qom-cpu 46/59] ppc: Abstract ppce500_set_mpic_proxy()


From: Andreas Färber
Subject: [Qemu-ppc] [PATCH qom-cpu 46/59] ppc: Abstract ppce500_set_mpic_proxy() with qemu_for_each_cpu()
Date: Sun, 9 Jun 2013 21:13:13 +0200

Signed-off-by: Andreas Färber <address@hidden>
---
 hw/ppc/ppc.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index fb57b42..31f3dc4 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -437,22 +437,23 @@ void ppce500_irq_init(CPUPPCState *env)
                                                   cpu, PPCE500_INPUT_NB);
 }
 
-/* Enable or Disable the E500 EPR capability */
-void ppce500_set_mpic_proxy(bool enabled)
+static void ppce500_set_mpic_proxy_one(CPUState *cs, void *data)
 {
-    CPUPPCState *env;
+    bool *enabled = data;
+    PowerPCCPU *cpu = POWERPC_CPU(cs);
 
-    for (env = first_cpu; env != NULL; env = env->next_cpu) {
-        PowerPCCPU *cpu = ppc_env_get_cpu(env);
-        CPUState *cs = CPU(cpu);
-
-        env->mpic_proxy = enabled;
-        if (kvm_enabled()) {
-            kvmppc_set_mpic_proxy(POWERPC_CPU(cs), enabled);
-        }
+    cpu->env.mpic_proxy = *enabled;
+    if (kvm_enabled()) {
+        kvmppc_set_mpic_proxy(cpu, *enabled);
     }
 }
 
+/* Enable or Disable the E500 EPR capability */
+void ppce500_set_mpic_proxy(bool enabled)
+{
+    qemu_for_each_cpu(ppce500_set_mpic_proxy_one, &enabled);
+}
+
 /*****************************************************************************/
 /* PowerPC time base and decrementer emulation */
 
-- 
1.8.1.4




reply via email to

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