aboutsummaryrefslogtreecommitdiff
path: root/target-mips/translate.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-mips/translate.c')
-rw-r--r--target-mips/translate.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 578cd9a25c..ac439d27a1 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -6725,13 +6725,21 @@ void cpu_dump_state (CPUState *env, FILE *f,
#endif
}
-CPUMIPSState *cpu_mips_init (void)
+#include "translate_init.c"
+
+CPUMIPSState *cpu_mips_init (const char *cpu_model)
{
CPUMIPSState *env;
+ const mips_def_t *def;
+ def = cpu_mips_find_by_name(cpu_model);
+ if (!def)
+ return NULL;
env = qemu_mallocz(sizeof(CPUMIPSState));
if (!env)
return NULL;
+ env->cpu_model = def;
+
cpu_exec_init(env);
cpu_reset(env);
return env;
@@ -6780,6 +6788,5 @@ void cpu_reset (CPUMIPSState *env)
#else
env->hflags = MIPS_HFLAG_CP0;
#endif
+ cpu_mips_register(env, env->cpu_model);
}
-
-#include "translate_init.c"