aboutsummaryrefslogtreecommitdiff
path: root/target-m68k/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-05 15:15:30 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:57 +0100
commit6d1bbc6273d45520c5ce6475186bfa30d8afb47c (patch)
tree94cbc3b1f80f3e9d01eff253ce922b494907c61a /target-m68k/cpu.c
parent9c23169e8cd54b490d55221b6498d42966f964f3 (diff)
target-m68k: Introduce QOM realizefn for M68kCPU
Introduce realizefn and set realized = true in cpu_m68k_init(). Split off GDB registration to a new m68k_cpu_init_gdb() so that it can be called from the realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-m68k/cpu.c')
-rw-r--r--target-m68k/cpu.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c
index c71f715174..e3eaffc9ed 100644
--- a/target-m68k/cpu.c
+++ b/target-m68k/cpu.c
@@ -139,6 +139,19 @@ static const M68kCPUInfo m68k_cpus[] = {
{ .name = "any", .instance_init = any_cpu_initfn },
};
+static void m68k_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ M68kCPU *cpu = M68K_CPU(dev);
+ M68kCPUClass *mcc = M68K_CPU_GET_CLASS(dev);
+
+ m68k_cpu_init_gdb(cpu);
+
+ cpu_reset(CPU(cpu));
+ qemu_init_vcpu(&cpu->env);
+
+ mcc->parent_realize(dev, errp);
+}
+
static void m68k_cpu_initfn(Object *obj)
{
M68kCPU *cpu = M68K_CPU(obj);
@@ -158,6 +171,9 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data)
CPUClass *cc = CPU_CLASS(c);
DeviceClass *dc = DEVICE_CLASS(c);
+ mcc->parent_realize = dc->realize;
+ dc->realize = m68k_cpu_realizefn;
+
mcc->parent_reset = cc->reset;
cc->reset = m68k_cpu_reset;