diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2017-10-15 19:02:42 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2017-10-24 22:00:13 +0200 |
commit | 55c3ceef61fcf06fc98ddc752b7cce788ce7680b (patch) | |
tree | 39cb3c0c16d33de6491e3dc7fa5a71933463490f /target/sparc | |
parent | 11f4e8f8bfaa2caaab24bef6bbbb8a0205015119 (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/sparc')
-rw-r--r-- | target/sparc/cpu.c | 5 | ||||
-rw-r--r-- | target/sparc/cpu.h | 2 | ||||
-rw-r--r-- | target/sparc/translate.c | 9 |
3 files changed, 3 insertions, 13 deletions
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index beab90f3e6..47d0927707 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -784,10 +784,6 @@ static void sparc_cpu_initfn(Object *obj) cs->env_ptr = env; - if (tcg_enabled()) { - gen_intermediate_code_init(env); - } - if (scc->cpu_def) { env->def = *scc->cpu_def; } @@ -891,6 +887,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->vmsd = &vmstate_sparc_cpu; #endif cc->disas_set_info = cpu_sparc_disas_set_info; + cc->tcg_initialize = sparc_tcg_init; #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) cc->gdb_num_core_regs = 86; diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 1598f65927..bf2b8931cc 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -594,7 +594,7 @@ int sparc_cpu_memory_rw_debug(CPUState *cpu, vaddr addr, /* translate.c */ -void gen_intermediate_code_init(CPUSPARCState *env); +void sparc_tcg_init(void); /* cpu-exec.c */ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 83a7d8e3ee..65939693d7 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5857,9 +5857,8 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock * tb) #endif } -void gen_intermediate_code_init(CPUSPARCState *env) +void sparc_tcg_init(void) { - static int inited; static const char gregnames[32][4] = { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", @@ -5912,12 +5911,6 @@ void gen_intermediate_code_init(CPUSPARCState *env) unsigned int i; - /* init various static tables */ - if (inited) { - return; - } - inited = 1; - cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); tcg_ctx.tcg_env = cpu_env; |