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/tricore | |
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/tricore')
-rw-r--r-- | target/tricore/cpu.c | 5 | ||||
-rw-r--r-- | target/tricore/translate.c | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 871eb35453..cd93806d47 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -109,10 +109,6 @@ static void tricore_cpu_initfn(Object *obj) CPUTriCoreState *env = &cpu->env; cs->env_ptr = env; - - if (tcg_enabled()) { - tricore_tcg_init(); - } } static ObjectClass *tricore_cpu_class_by_name(const char *cpu_model) @@ -182,6 +178,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->set_pc = tricore_cpu_set_pc; cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb; cc->get_phys_page_attrs_debug = tricore_cpu_get_phys_page_attrs_debug; + cc->tcg_initialize = tricore_tcg_init; } static void cpu_register(const TriCoreCPUInfo *info) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 4e4198e887..b6cfbdfa9f 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8880,10 +8880,7 @@ static void tricore_tcg_init_csfr(void) void tricore_tcg_init(void) { int i; - static int inited; - if (inited) { - return; - } + cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); tcg_ctx.tcg_env = cpu_env; /* reg init */ |