aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/cpu.c
diff options
context:
space:
mode:
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;