aboutsummaryrefslogtreecommitdiff
path: root/target-lm32/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-lm32/cpu.c')
-rw-r--r--target-lm32/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c
index 4ce7e3bf4c..70251d0544 100644
--- a/target-lm32/cpu.c
+++ b/target-lm32/cpu.c
@@ -34,6 +34,18 @@ static void lm32_cpu_reset(CPUState *s)
cpu_state_reset(env);
}
+static void lm32_cpu_initfn(Object *obj)
+{
+ LM32CPU *cpu = LM32_CPU(obj);
+ CPULM32State *env = &cpu->env;
+
+ cpu_exec_init(env);
+
+ env->flags = 0;
+
+ cpu_reset(CPU(cpu));
+}
+
static void lm32_cpu_class_init(ObjectClass *oc, void *data)
{
LM32CPUClass *lcc = LM32_CPU_CLASS(oc);
@@ -47,6 +59,7 @@ static const TypeInfo lm32_cpu_type_info = {
.name = TYPE_LM32_CPU,
.parent = TYPE_CPU,
.instance_size = sizeof(LM32CPU),
+ .instance_init = lm32_cpu_initfn,
.abstract = false,
.class_size = sizeof(LM32CPUClass),
.class_init = lm32_cpu_class_init,