diff options
Diffstat (limited to 'target-ppc/helper.c')
-rw-r--r-- | target-ppc/helper.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/target-ppc/helper.c b/target-ppc/helper.c index 9fd9721cde..f7df19e1c0 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -2970,20 +2970,26 @@ void cpu_ppc_reset (void *opaque) tlb_flush(env, 1); } -CPUPPCState *cpu_ppc_init (void) +CPUPPCState *cpu_ppc_init (const char *cpu_model) { CPUPPCState *env; + const ppc_def_t *def; + + def = cpu_ppc_find_by_name(cpu_model); + if (!def) + return NULL; env = qemu_mallocz(sizeof(CPUPPCState)); if (!env) return NULL; cpu_exec_init(env); - + cpu_ppc_register_internal(env, def); + cpu_ppc_reset(env); return env; } void cpu_ppc_close (CPUPPCState *env) { /* Should also remove all opcode tables... */ - free(env); + qemu_free(env); } |