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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c
index 6a84f51bf9..5f167340e4 100644
--- a/target-lm32/cpu.c
+++ b/target-lm32/cpu.c
@@ -58,10 +58,16 @@ static void lm32_cpu_initfn(Object *obj)
{
LM32CPU *cpu = LM32_CPU(obj);
CPULM32State *env = &cpu->env;
+ static bool tcg_initialized;
cpu_exec_init(env);
env->flags = 0;
+
+ if (tcg_enabled() && !tcg_initialized) {
+ tcg_initialized = true;
+ lm32_translate_init();
+ }
}
static void lm32_cpu_class_init(ObjectClass *oc, void *data)