aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/cpu.c
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/s390x/cpu.c
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/s390x/cpu.c')
-rw-r--r--target/s390x/cpu.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 95f4283188..824dfd6b65 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -241,7 +241,6 @@ static void s390_cpu_initfn(Object *obj)
CPUState *cs = CPU(obj);
S390CPU *cpu = S390_CPU(obj);
CPUS390XState *env = &cpu->env;
- static bool inited;
#if !defined(CONFIG_USER_ONLY)
struct tm tm;
#endif
@@ -259,11 +258,6 @@ static void s390_cpu_initfn(Object *obj)
env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
s390_cpu_set_state(CPU_STATE_STOPPED, cpu);
#endif
-
- if (tcg_enabled() && !inited) {
- inited = true;
- s390x_translate_init();
- }
}
static void s390_cpu_finalize(Object *obj)
@@ -503,6 +497,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
#endif
#endif
cc->disas_set_info = s390_cpu_disas_set_info;
+ cc->tcg_initialize = s390x_translate_init;
cc->gdb_num_core_regs = S390_NUM_CORE_REGS;
cc->gdb_core_xml_file = "s390x-core64.xml";