aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-05 15:27:31 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:57 +0100
commit746b03b27cac48be5a376d8635ffaf568339ebd7 (patch)
treed31abca98391864ed2c2ef09451cd5fcbf8948e8 /target-microblaze/cpu.c
parent6d1bbc6273d45520c5ce6475186bfa30d8afb47c (diff)
target-microblaze: Introduce QOM realizefn for MicroBlazeCPU
Introduce realizefn and set realized = true from cpu_mb_init(). Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-microblaze/cpu.c')
-rw-r--r--target-microblaze/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 39230fddcc..baae47b2c6 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -85,6 +85,17 @@ static void mb_cpu_reset(CPUState *s)
#endif
}
+static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ MicroBlazeCPU *cpu = MICROBLAZE_CPU(dev);
+ MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
+
+ cpu_reset(CPU(cpu));
+ qemu_init_vcpu(&cpu->env);
+
+ mcc->parent_realize(dev, errp);
+}
+
static void mb_cpu_initfn(Object *obj)
{
MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj);
@@ -106,6 +117,9 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
CPUClass *cc = CPU_CLASS(oc);
MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_CLASS(oc);
+ mcc->parent_realize = dc->realize;
+ dc->realize = mb_cpu_realizefn;
+
mcc->parent_reset = cc->reset;
cc->reset = mb_cpu_reset;