target-ppc: Move TCG initialization to PowerPCCPU initfn
authorAndreas Färber <afaerber@suse.de>
Sun, 20 Jan 2013 00:26:37 +0000 (01:26 +0100)
committerAndreas Färber <afaerber@suse.de>
Sat, 16 Feb 2013 13:50:58 +0000 (14:50 +0100)
Ensures that a QOM-created PowerPCCPU is usable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-ppc/translate_init.c

index 49eaeac7c5559a3d555c69a8048e384753f26b6a..5a2acaafe8283de370604f1bf28653211f8551db 100644 (file)
@@ -10349,11 +10349,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);
@@ -10571,6 +10566,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)