diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-15 01:10:56 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-30 11:32:13 +0200 |
commit | 9b7060396e16b0b5a81e21373f27e63bdcacb5bf (patch) | |
tree | 4adfcc2d0ec73ec639719311759bec69fa5d0823 /target-m68k/cpu.c | |
parent | 11c1986817fa8ec515b87291445786734f78e4e0 (diff) |
target-m68k: Start QOM'ifying CPU init
Move model-independent code from cpu_m68k_init() into a QOM initfn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
Diffstat (limited to 'target-m68k/cpu.c')
-rw-r--r-- | target-m68k/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c index e599ece430..0bb1b2c630 100644 --- a/target-m68k/cpu.c +++ b/target-m68k/cpu.c @@ -48,6 +48,14 @@ static void m68k_cpu_reset(CPUState *s) tlb_flush(env, 1); } +static void m68k_cpu_initfn(Object *obj) +{ + M68kCPU *cpu = M68K_CPU(obj); + CPUM68KState *env = &cpu->env; + + cpu_exec_init(env); +} + static void m68k_cpu_class_init(ObjectClass *c, void *data) { M68kCPUClass *mcc = M68K_CPU_CLASS(c); @@ -61,6 +69,7 @@ static const TypeInfo m68k_cpu_type_info = { .name = TYPE_M68K_CPU, .parent = TYPE_CPU, .instance_size = sizeof(M68kCPU), + .instance_init = m68k_cpu_initfn, .abstract = false, .class_size = sizeof(M68kCPUClass), .class_init = m68k_cpu_class_init, |