From 55c3ceef61fcf06fc98ddc752b7cce788ce7680b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 15 Oct 2017 19:02:42 -0700 Subject: qom: Introduce CPUClass.tcg_initialize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move target cpu tcg initialization to common code, called from cpu_exec_realizefn. Acked-by: Andreas Färber Reviewed-by: Emilio G. Cota Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/nios2/cpu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'target/nios2') diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 5b02fb67ea..4742e52c78 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -69,18 +69,12 @@ static void nios2_cpu_initfn(Object *obj) CPUState *cs = CPU(obj); Nios2CPU *cpu = NIOS2_CPU(obj); CPUNios2State *env = &cpu->env; - static bool tcg_initialized; cs->env_ptr = env; #if !defined(CONFIG_USER_ONLY) mmu_init(env); #endif - - if (tcg_enabled() && !tcg_initialized) { - tcg_initialized = true; - nios2_tcg_init(); - } } static ObjectClass *nios2_cpu_class_by_name(const char *cpu_model) @@ -215,6 +209,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = nios2_cpu_gdb_read_register; cc->gdb_write_register = nios2_cpu_gdb_write_register; cc->gdb_num_core_regs = 49; + cc->tcg_initialize = nios2_tcg_init; } static const TypeInfo nios2_cpu_type_info = { -- cgit v1.2.3