diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-06 14:39:03 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-15 17:10:30 +0200 |
commit | 1d0cb67da9eff798420d0f6479fec6026c4dc41f (patch) | |
tree | 845b377b6f30e926697ff441da85fe9dd60fb9dc /target-ppc/helper.c | |
parent | 12b1143b2807a5b760e477fac0e1028a9760b6c6 (diff) | |
download | hqemu-1d0cb67da9eff798420d0f6479fec6026c4dc41f.zip hqemu-1d0cb67da9eff798420d0f6479fec6026c4dc41f.tar.gz |
target-ppc: QOM'ify CPU
Embed CPUPPCState as first member of PowerPCCPU.
Distinguish between "powerpc-cpu", "powerpc64-cpu" and
"embedded-powerpc-cpu".
Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target-ppc/helper.c')
-rw-r--r-- | target-ppc/helper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target-ppc/helper.c b/target-ppc/helper.c index b34dcbe..0d904dd 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -3186,6 +3186,7 @@ void cpu_state_reset(CPUPPCState *env) CPUPPCState *cpu_ppc_init (const char *cpu_model) { + PowerPCCPU *cpu; CPUPPCState *env; const ppc_def_t *def; @@ -3193,7 +3194,8 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model) if (!def) return NULL; - env = g_malloc0(sizeof(CPUPPCState)); + cpu = POWERPC_CPU(object_new(TYPE_POWERPC_CPU)); + env = &cpu->env; cpu_exec_init(env); if (tcg_enabled()) { ppc_translate_init(); |