From d9c27f00b174df070470d48d6577042d2186d969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 20 Jan 2013 01:36:47 +0100 Subject: target-unicore32: Move TCG initialization to UniCore32CPU initfn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Normalize the "inited" logic and add a tcg_enabled() check to suppress it for qtest. Ensures that a QOM-created UniCore32CPU is usable. Acked-by: Guan Xuetao Signed-off-by: Andreas Färber --- target-unicore32/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'target-unicore32/cpu.c') diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c index 8de17a4..7bcf3b3 100644 --- a/target-unicore32/cpu.c +++ b/target-unicore32/cpu.c @@ -95,6 +95,7 @@ static void uc32_cpu_initfn(Object *obj) { UniCore32CPU *cpu = UNICORE32_CPU(obj); CPUUniCore32State *env = &cpu->env; + static bool inited; cpu_exec_init(env); @@ -107,6 +108,11 @@ static void uc32_cpu_initfn(Object *obj) #endif tlb_flush(env, 1); + + if (tcg_enabled() && !inited) { + inited = true; + uc32_translate_init(); + } } static const VMStateDescription vmstate_uc32_cpu = { -- cgit v1.1