aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-microblaze/cpu.c11
-rw-r--r--target-microblaze/translate.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 6f00b0d13a..9c3b74ea8a 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -83,6 +83,16 @@ static void mb_cpu_reset(CPUState *s)
#endif
}
+static void mb_cpu_initfn(Object *obj)
+{
+ MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj);
+ CPUMBState *env = &cpu->env;
+
+ cpu_exec_init(env);
+
+ set_float_rounding_mode(float_round_nearest_even, &env->fp_status);
+}
+
static void mb_cpu_class_init(ObjectClass *oc, void *data)
{
CPUClass *cc = CPU_CLASS(oc);
@@ -96,6 +106,7 @@ static const TypeInfo mb_cpu_type_info = {
.name = TYPE_MICROBLAZE_CPU,
.parent = TYPE_CPU,
.instance_size = sizeof(MicroBlazeCPU),
+ .instance_init = mb_cpu_initfn,
.class_size = sizeof(MicroBlazeCPUClass),
.class_init = mb_cpu_class_init,
};
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index e730c3261c..742b3957c0 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1899,10 +1899,8 @@ CPUMBState *cpu_mb_init (const char *cpu_model)
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
env = &cpu->env;
- cpu_exec_init(env);
cpu_reset(CPU(cpu));
qemu_init_vcpu(env);
- set_float_rounding_mode(float_round_nearest_even, &env->fp_status);
if (tcg_initialized)
return env;