From cd0c24f9095b1f825210bb9d9f99532c78668074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 20 Jan 2013 01:10:52 +0100 Subject: target-microblaze: Move TCG initialization to MicroBlazeCPU initfn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split off TCG initialization from cpu_mb_init() into mb_tcg_init() to call it from the initfn. Ensures that a QOM-created MicroBlazeCPU is usable. Signed-off-by: Andreas Färber --- target-microblaze/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'target-microblaze/cpu.c') diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c index baae47b2c6..28b5a88789 100644 --- a/target-microblaze/cpu.c +++ b/target-microblaze/cpu.c @@ -100,10 +100,16 @@ static void mb_cpu_initfn(Object *obj) { MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj); CPUMBState *env = &cpu->env; + static bool tcg_initialized; cpu_exec_init(env); set_float_rounding_mode(float_round_nearest_even, &env->fp_status); + + if (tcg_enabled() && !tcg_initialized) { + tcg_initialized = true; + mb_tcg_init(); + } } static const VMStateDescription vmstate_mb_cpu = { -- cgit v1.2.3