aboutsummaryrefslogtreecommitdiff
path: root/target-xtensa/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-xtensa/cpu.c')
-rw-r--r--target-xtensa/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c
index ebc7e9979b..d3706a30ac 100644
--- a/target-xtensa/cpu.c
+++ b/target-xtensa/cpu.c
@@ -57,6 +57,16 @@ static void xtensa_cpu_reset(CPUState *s)
reset_mmu(env);
}
+static void xtensa_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ XtensaCPU *cpu = XTENSA_CPU(dev);
+ XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(dev);
+
+ qemu_init_vcpu(&cpu->env);
+
+ xcc->parent_realize(dev, errp);
+}
+
static void xtensa_cpu_initfn(Object *obj)
{
XtensaCPU *cpu = XTENSA_CPU(obj);
@@ -76,6 +86,9 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data)
CPUClass *cc = CPU_CLASS(oc);
XtensaCPUClass *xcc = XTENSA_CPU_CLASS(cc);
+ xcc->parent_realize = dc->realize;
+ dc->realize = xtensa_cpu_realizefn;
+
xcc->parent_reset = cc->reset;
cc->reset = xtensa_cpu_reset;