aboutsummaryrefslogtreecommitdiff
path: root/target/nios2/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/nios2/cpu.c')
-rw-r--r--target/nios2/cpu.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index d56bb7245a..5b02fb67ea 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -83,13 +83,9 @@ static void nios2_cpu_initfn(Object *obj)
}
}
-Nios2CPU *cpu_nios2_init(const char *cpu_model)
+static ObjectClass *nios2_cpu_class_by_name(const char *cpu_model)
{
- Nios2CPU *cpu = NIOS2_CPU(object_new(TYPE_NIOS2_CPU));
-
- object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
-
- return cpu;
+ return object_class_by_name(TYPE_NIOS2_CPU);
}
static void nios2_cpu_realizefn(DeviceState *dev, Error **errp)
@@ -203,6 +199,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data)
ncc->parent_reset = cc->reset;
cc->reset = nios2_cpu_reset;
+ cc->class_by_name = nios2_cpu_class_by_name;
cc->has_work = nios2_cpu_has_work;
cc->do_interrupt = nios2_cpu_do_interrupt;
cc->cpu_exec_interrupt = nios2_cpu_exec_interrupt;