diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-13 02:32:12 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-30 11:32:10 +0200 |
commit | 2b4b49065670b46b424a329da5d35838180fc209 (patch) | |
tree | 6fba37c2f5902515a200d0f460a69dd41731135d /target-sh4/cpu.c | |
parent | c4bb0f99e797e5e5720c27544a2fc61a0b722023 (diff) |
target-sh4: Start QOM'ifying CPU init
Move code from cpu_sh4_init() into a QOM initfn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-sh4/cpu.c')
-rw-r--r-- | target-sh4/cpu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c index 84d46728aa..a1a177fa88 100644 --- a/target-sh4/cpu.c +++ b/target-sh4/cpu.c @@ -53,6 +53,16 @@ static void superh_cpu_reset(CPUState *s) set_default_nan_mode(1, &env->fp_status); } +static void superh_cpu_initfn(Object *obj) +{ + SuperHCPU *cpu = SUPERH_CPU(obj); + CPUSH4State *env = &cpu->env; + + cpu_exec_init(env); + + env->movcal_backup_tail = &(env->movcal_backup); +} + static void superh_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); @@ -66,6 +76,7 @@ static const TypeInfo superh_cpu_type_info = { .name = TYPE_SUPERH_CPU, .parent = TYPE_CPU, .instance_size = sizeof(SuperHCPU), + .instance_init = superh_cpu_initfn, .abstract = false, .class_size = sizeof(SuperHCPUClass), .class_init = superh_cpu_class_init, |