aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/translate_init.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-06 15:09:01 +0200
committerAndreas Färber <afaerber@suse.de>2012-04-15 17:11:02 +0200
commit6cca7ad686de0270fe30ae303e31c6a27b53d7a9 (patch)
treef5f986015dbf22d024b88cae245a14c17d23c094 /target-ppc/translate_init.c
parent1d0cb67da9eff798420d0f6479fec6026c4dc41f (diff)
target-ppc: Start QOM'ifying CPU init
Move code not dependent on ppc_def_t from cpu_ppc_init() into an initfn. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target-ppc/translate_init.c')
-rw-r--r--target-ppc/translate_init.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index e4d15a59a8..5a7ac77457 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -10217,6 +10217,14 @@ static void ppc_cpu_reset(CPUState *s)
cpu_state_reset(env);
}
+static void ppc_cpu_initfn(Object *obj)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(obj);
+ CPUPPCState *env = &cpu->env;
+
+ cpu_exec_init(env);
+}
+
static void ppc_cpu_class_init(ObjectClass *oc, void *data)
{
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
@@ -10230,6 +10238,7 @@ static const TypeInfo ppc_cpu_type_info = {
.name = TYPE_POWERPC_CPU,
.parent = TYPE_CPU,
.instance_size = sizeof(PowerPCCPU),
+ .instance_init = ppc_cpu_initfn,
.abstract = false,
.class_size = sizeof(PowerPCCPUClass),
.class_init = ppc_cpu_class_init,