Patchwork [RFC,qom-cpu,v2,23/28] target-ppc: Move TCG initialization to PowerPCCPU initfn

login
register
mail settings
Submitter Andreas Färber
Date Jan. 20, 2013, 7:22 a.m.
Message ID <1358666571-1737-24-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/213945/
State New
Headers show

Comments

Andreas Färber - Jan. 20, 2013, 7:22 a.m.
Ensures that a QOM-created PowerPCCPU is usable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-ppc/translate_init.c |    9 ++++-----
 1 Datei geändert, 4 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 63ba4a5..786d871 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -10337,11 +10337,6 @@  PowerPCCPU *cpu_ppc_init(const char *cpu_model)
 
     cpu = POWERPC_CPU(object_new(object_class_get_name(oc)));
     env = &cpu->env;
-
-    if (tcg_enabled()) {
-        ppc_translate_init();
-    }
-
     env->cpu_model_str = cpu_model;
 
     object_property_set_bool(OBJECT(cpu), true, "realized", &err);
@@ -10559,6 +10554,10 @@  static void ppc_cpu_initfn(Object *obj)
         env->sps = defsps;
     }
 #endif /* defined(TARGET_PPC64) */
+
+    if (tcg_enabled()) {
+        ppc_translate_init();
+    }
 }
 
 static void ppc_cpu_class_init(ObjectClass *oc, void *data)