diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-16 02:37:56 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-30 11:32:13 +0200 |
commit | 5b0c40f7460a017d0322d942a6abda9e8815676b (patch) | |
tree | 796f55d91077ee7b61f23b59d8f36174b9bce1f1 /target-mips/cpu.c | |
parent | 0f71a7095db6bc055bc5bb520d85ea650cca8a33 (diff) | |
download | qemu-5b0c40f7460a017d0322d942a6abda9e8815676b.zip qemu-5b0c40f7460a017d0322d942a6abda9e8815676b.tar.gz qemu-5b0c40f7460a017d0322d942a6abda9e8815676b.tar.bz2 |
target-mips: Start QOM'ifying CPU init
Move code not dependent on mips_def_t from cpu_mips_init() into a
QOM initfn, as a start.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-mips/cpu.c')
-rw-r--r-- | target-mips/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target-mips/cpu.c b/target-mips/cpu.c index d573ec8..0044062 100644 --- a/target-mips/cpu.c +++ b/target-mips/cpu.c @@ -34,6 +34,14 @@ static void mips_cpu_reset(CPUState *s) cpu_state_reset(env); } +static void mips_cpu_initfn(Object *obj) +{ + MIPSCPU *cpu = MIPS_CPU(obj); + CPUMIPSState *env = &cpu->env; + + cpu_exec_init(env); +} + static void mips_cpu_class_init(ObjectClass *c, void *data) { MIPSCPUClass *mcc = MIPS_CPU_CLASS(c); @@ -47,6 +55,7 @@ static const TypeInfo mips_cpu_type_info = { .name = TYPE_MIPS_CPU, .parent = TYPE_CPU, .instance_size = sizeof(MIPSCPU), + .instance_init = mips_cpu_initfn, .abstract = false, .class_size = sizeof(MIPSCPUClass), .class_init = mips_cpu_class_init, |