aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-mips/cpu.c9
-rw-r--r--target-mips/translate.c1
2 files changed, 9 insertions, 1 deletions
diff --git a/target-mips/cpu.c b/target-mips/cpu.c
index d573ec8be8..004406232b 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,
diff --git a/target-mips/translate.c b/target-mips/translate.c
index b10ec2196a..f5297b0392 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12703,7 +12703,6 @@ CPUMIPSState *cpu_mips_init (const char *cpu_model)
env->cpu_model = def;
env->cpu_model_str = cpu_model;
- cpu_exec_init(env);
#ifndef CONFIG_USER_ONLY
mmu_init(env, def);
#endif