diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-23 18:16:02 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-02-16 14:50:57 +0100 |
commit | 55acb588dd184a1e33be0ff1fe23f8c19f88fd6c (patch) | |
tree | ff02717758cb0f6f49e24871aa110eb3bbdf2aac /target-sh4/cpu.c | |
parent | 1f1366322b21678c33003a373366697a4542d2d4 (diff) |
target-sh4: Introduce QOM realizefn for SuperHCPU
Introduce a realizefn and set realized = true in cpu_sh4_init().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-sh4/cpu.c')
-rw-r--r-- | target-sh4/cpu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c index d2831226b9..c66442f445 100644 --- a/target-sh4/cpu.c +++ b/target-sh4/cpu.c @@ -54,6 +54,17 @@ static void superh_cpu_reset(CPUState *s) set_default_nan_mode(1, &env->fp_status); } +static void superh_cpu_realizefn(DeviceState *dev, Error **errp) +{ + SuperHCPU *cpu = SUPERH_CPU(dev); + SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(dev); + + cpu_reset(CPU(cpu)); + qemu_init_vcpu(&cpu->env); + + scc->parent_realize(dev, errp); +} + static void superh_cpu_initfn(Object *obj) { SuperHCPU *cpu = SUPERH_CPU(obj); @@ -75,6 +86,9 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) CPUClass *cc = CPU_CLASS(oc); SuperHCPUClass *scc = SUPERH_CPU_CLASS(oc); + scc->parent_realize = dc->realize; + dc->realize = superh_cpu_realizefn; + scc->parent_reset = cc->reset; cc->reset = superh_cpu_reset; |