summaryrefslogtreecommitdiff
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, 6 insertions, 7 deletions
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 94c38e8755..f7128bc91d 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -20525,16 +20525,15 @@ void cpu_mips_realize_env(CPUMIPSState *env)
MIPSCPU *cpu_mips_init(const char *cpu_model)
{
+ ObjectClass *oc;
MIPSCPU *cpu;
- CPUMIPSState *env;
- const mips_def_t *def;
- def = cpu_mips_find_by_name(cpu_model);
- if (!def)
+ oc = cpu_class_by_name(TYPE_MIPS_CPU, cpu_model);
+ if (oc == NULL) {
return NULL;
- cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU));
- env = &cpu->env;
- env->cpu_model = def;
+ }
+
+ cpu = MIPS_CPU(object_new(object_class_get_name(oc)));
object_property_set_bool(OBJECT(cpu), true, "realized", NULL);