mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
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>
This commit is contained in:
parent
11f4e8f8bf
commit
55c3ceef61
32 changed files with 40 additions and 163 deletions
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue