aboutsummaryrefslogtreecommitdiff
path: root/target/ppc
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/ppc
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/ppc')
-rw-r--r--target/ppc/translate.c6
-rw-r--r--target/ppc/translate_init.c5
2 files changed, 1 insertions, 10 deletions
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 616cf8f50e..b61f4f0bad 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -84,10 +84,6 @@ void ppc_translate_init(void)
int i;
char* p;
size_t cpu_reg_names_size;
- static int done_init = 0;
-
- if (done_init)
- return;
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
tcg_ctx.tcg_env = cpu_env;
@@ -191,8 +187,6 @@ void ppc_translate_init(void)
cpu_access_type = tcg_global_mem_new_i32(cpu_env,
offsetof(CPUPPCState, access_type), "access_type");
-
- done_init = 1;
}
/* internal defines */
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index 7b9bf6a773..2cb58b855b 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -10499,10 +10499,6 @@ static void ppc_cpu_initfn(Object *obj)
env->sps = (env->mmu_model & POWERPC_MMU_64K) ? defsps_64k : defsps_4k;
}
#endif /* defined(TARGET_PPC64) */
-
- if (tcg_enabled()) {
- ppc_translate_init();
- }
}
static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr)
@@ -10582,6 +10578,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
#ifndef CONFIG_USER_ONLY
cc->virtio_is_big_endian = ppc_cpu_is_big_endian;
#endif
+ cc->tcg_initialize = ppc_translate_init;
dc->fw_name = "PowerPC,UNKNOWN";
}