mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33: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
|
@ -121,7 +121,6 @@ static void xtensa_cpu_initfn(Object *obj)
|
|||
XtensaCPU *cpu = XTENSA_CPU(obj);
|
||||
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);
|
||||
CPUXtensaState *env = &cpu->env;
|
||||
static bool tcg_inited;
|
||||
|
||||
cs->env_ptr = env;
|
||||
env->config = xcc->config;
|
||||
|
@ -131,11 +130,6 @@ static void xtensa_cpu_initfn(Object *obj)
|
|||
memory_region_init_io(env->system_er, NULL, NULL, env, "er",
|
||||
UINT64_C(0x100000000));
|
||||
address_space_init(env->address_space_er, env->system_er, "ER");
|
||||
|
||||
if (tcg_enabled() && !tcg_inited) {
|
||||
tcg_inited = true;
|
||||
xtensa_translate_init();
|
||||
}
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_xtensa_cpu = {
|
||||
|
@ -170,6 +164,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data)
|
|||
cc->do_unassigned_access = xtensa_cpu_do_unassigned_access;
|
||||
#endif
|
||||
cc->debug_excp_handler = xtensa_breakpoint_handler;
|
||||
cc->tcg_initialize = xtensa_translate_init;
|
||||
dc->vmsd = &vmstate_xtensa_cpu;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue