aboutsummaryrefslogtreecommitdiff
path: root/target-cris/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-05 15:41:21 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:57 +0100
commitca45f8b0440358ccca63446cf0df05772791b2a1 (patch)
treeceac1af5a70acf5fa14d7cf09723a3b400d8ed8f /target-cris/cpu.c
parent4776ce600338e17f75d200d1ad17d4ce9effa57f (diff)
target-cris: Introduce QOM realizefn for CRISCPU
Introduce realizefn and set realized = true from cpu_cris_init(). Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-cris/cpu.c')
-rw-r--r--target-cris/cpu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/target-cris/cpu.c b/target-cris/cpu.c
index 3f64a5747e..34c4f75a44 100644
--- a/target-cris/cpu.c
+++ b/target-cris/cpu.c
@@ -55,6 +55,17 @@ static void cris_cpu_reset(CPUState *s)
#endif
}
+static void cris_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ CRISCPU *cpu = CRIS_CPU(dev);
+ CRISCPUClass *ccc = CRIS_CPU_GET_CLASS(dev);
+
+ cpu_reset(CPU(cpu));
+ qemu_init_vcpu(&cpu->env);
+
+ ccc->parent_realize(dev, errp);
+}
+
static void cris_cpu_initfn(Object *obj)
{
CRISCPU *cpu = CRIS_CPU(obj);
@@ -65,9 +76,13 @@ static void cris_cpu_initfn(Object *obj)
static void cris_cpu_class_init(ObjectClass *oc, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
CRISCPUClass *ccc = CRIS_CPU_CLASS(oc);
+ ccc->parent_realize = dc->realize;
+ dc->realize = cris_cpu_realizefn;
+
ccc->parent_reset = cc->reset;
cc->reset = cris_cpu_reset;
}