aboutsummaryrefslogtreecommitdiff
path: root/target/lm32
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-10-15 19:02:42 -0700
committerRichard Henderson <richard.henderson@linaro.org>2017-10-24 22:00:13 +0200
commit55c3ceef61fcf06fc98ddc752b7cce788ce7680b (patch)
tree39cb3c0c16d33de6491e3dc7fa5a71933463490f /target/lm32
parent11f4e8f8bfaa2caaab24bef6bbbb8a0205015119 (diff)
qom: Introduce CPUClass.tcg_initialize
Move target cpu tcg initialization to common code, called from cpu_exec_realizefn. Acked-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/lm32')
-rw-r--r--target/lm32/cpu.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c
index bf081f56d2..7f3a292f2b 100644
--- a/target/lm32/cpu.c
+++ b/target/lm32/cpu.c
@@ -163,16 +163,10 @@ static void lm32_cpu_initfn(Object *obj)
CPUState *cs = CPU(obj);
LM32CPU *cpu = LM32_CPU(obj);
CPULM32State *env = &cpu->env;
- static bool tcg_initialized;
cs->env_ptr = env;
env->flags = 0;
-
- if (tcg_enabled() && !tcg_initialized) {
- tcg_initialized = true;
- lm32_translate_init();
- }
}
static void lm32_basic_cpu_initfn(Object *obj)
@@ -286,6 +280,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data)
cc->gdb_stop_before_watchpoint = true;
cc->debug_excp_handler = lm32_debug_excp_handler;
cc->disas_set_info = lm32_cpu_disas_set_info;
+ cc->tcg_initialize = lm32_translate_init;
}
static void lm32_register_cpu_type(const LM32CPUInfo *info)