[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/47] target-unicore32: Introduce QOM realizefn for
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 15/47] target-unicore32: Introduce QOM realizefn for UniCore32CPU |
Date: |
Sat, 16 Feb 2013 16:45:10 +0100 |
Introduce a realizefn and set realized = true in uc32_cpu_init().
Acked-by: Guan Xuetao <address@hidden>
[AF: Invoke the parent's realizefn]
Signed-off-by: Andreas Färber <address@hidden>
---
target-unicore32/cpu-qom.h | 3 +++
target-unicore32/cpu.c | 14 ++++++++++++++
target-unicore32/helper.c | 3 ++-
3 Dateien geändert, 19 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/target-unicore32/cpu-qom.h b/target-unicore32/cpu-qom.h
index fe40b2d..625c614 100644
--- a/target-unicore32/cpu-qom.h
+++ b/target-unicore32/cpu-qom.h
@@ -25,6 +25,7 @@
/**
* UniCore32CPUClass:
+ * @parent_realize: The parent class' realize handler.
*
* A UniCore32 CPU model.
*/
@@ -32,6 +33,8 @@ typedef struct UniCore32CPUClass {
/*< private >*/
CPUClass parent_class;
/*< public >*/
+
+ DeviceRealize parent_realize;
} UniCore32CPUClass;
/**
diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index 4e4177f..8de17a4 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -81,6 +81,16 @@ static const UniCore32CPUInfo uc32_cpus[] = {
{ .name = "any", .instance_init = uc32_any_cpu_initfn },
};
+static void uc32_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ UniCore32CPU *cpu = UNICORE32_CPU(dev);
+ UniCore32CPUClass *ucc = UNICORE32_CPU_GET_CLASS(dev);
+
+ qemu_init_vcpu(&cpu->env);
+
+ ucc->parent_realize(dev, errp);
+}
+
static void uc32_cpu_initfn(Object *obj)
{
UniCore32CPU *cpu = UNICORE32_CPU(obj);
@@ -108,6 +118,10 @@ static void uc32_cpu_class_init(ObjectClass *oc, void
*data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
+ UniCore32CPUClass *ucc = UNICORE32_CPU_CLASS(oc);
+
+ ucc->parent_realize = dc->realize;
+ dc->realize = uc32_cpu_realizefn;
cc->class_by_name = uc32_cpu_class_by_name;
dc->vmsd = &vmstate_uc32_cpu;
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index 3a92232..2442133 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -45,7 +45,8 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
uc32_translate_init();
}
- qemu_init_vcpu(env);
+ object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+
return env;
}
--
1.7.10.4
- [Qemu-devel] [PATCH 01/47] cpu: Prepare QOM realizefn, (continued)
- [Qemu-devel] [PATCH 01/47] cpu: Prepare QOM realizefn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 03/47] target-arm: Update ARMCPU to QOM realizefn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 04/47] target-i386: Update X86CPU to QOM realizefn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 05/47] target-openrisc: Update OpenRISCCPU to QOM realizefn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 10/47] target-microblaze: Introduce QOM realizefn for MicroBlazeCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 08/47] target-lm32: Introduce QOM realizefn for LM32CPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 06/47] target-ppc: Update PowerPCCPU to QOM realizefn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 07/47] target-cris: Introduce QOM realizefn for CRISCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 09/47] target-m68k: Introduce QOM realizefn for M68kCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 12/47] target-s390x: Introduce QOM realizefn for S390CPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 15/47] target-unicore32: Introduce QOM realizefn for UniCore32CPU,
Andreas Färber <=
- [Qemu-devel] [PATCH 11/47] target-mips: Introduce QOM realizefn for MIPSCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 13/47] target-sh4: Introduce QOM realizefn for SuperHCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 19/47] target-lm32: Move TCG initialization to LM32CPU initfn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 18/47] target-cris: Move TCG initialization to CRISCPU initfn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 17/47] target-arm: Move TCG initialization to ARMCPU initfn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 14/47] target-sparc: Introduce QOM realizefn for SPARCCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 20/47] target-m68k: Move TCG initialization to M68kCPU initfn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 21/47] target-microblaze: Move TCG initialization to MicroBlazeCPU initfn, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 16/47] target-xtensa: Introduce QOM realizefn for XtensaCPU, Andreas Färber, 2013/02/16
- [Qemu-devel] [PATCH 24/47] target-s390x: Move TCG initialization to S390CPU initfn, Andreas Färber, 2013/02/16