aboutsummaryrefslogtreecommitdiff
path: root/target-xtensa/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-16 04:19:35 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:57 +0100
commit5f6c964389ea5320e81e2fb8c2bc3aa40c5a8013 (patch)
treea2064dbeb9e720ff2d88c5c65bcca61a923b4b2b /target-xtensa/cpu.c
parent088383e3220776917f538d0e43933e842e16b804 (diff)
downloadqemu-5f6c964389ea5320e81e2fb8c2bc3aa40c5a8013.zip
qemu-5f6c964389ea5320e81e2fb8c2bc3aa40c5a8013.tar.gz
qemu-5f6c964389ea5320e81e2fb8c2bc3aa40c5a8013.tar.bz2
target-xtensa: Introduce QOM realizefn for XtensaCPU
Introduce realizefn and set realized = true in cpu_xtensa_init(). Signed-off-by: Andreas Färber <afaerber@suse.de>
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 ebc7e99..d3706a3 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;