@@ -2885,7 +2885,6 @@ static void x86_cpu_initfn(Object *obj)
X86CPU *cpu = X86_CPU(obj);
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
CPUX86State *env = &cpu->env;
- static int inited;
cs->env_ptr = env;
cpu_exec_init(env);
@@ -2928,12 +2927,6 @@ static void x86_cpu_initfn(Object *obj)
env->cpuid_apic_id = x86_cpu_apic_id_from_index(cs->cpu_index);
x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
-
- /* init various static tables used in TCG mode */
- if (tcg_enabled() && !inited) {
- inited = 1;
- optimize_flags_init();
- }
}
static int64_t x86_cpu_get_arch_id(CPUState *cs)
@@ -7841,7 +7841,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
return s->pc;
}
-void optimize_flags_init(void)
+void tcg_arch_init(void)
{
static const char reg_names[CPU_NB_REGS][4] = {
#ifdef TARGET_X86_64
With tcg_arch_init(), we can finally remove the "inited" variable from x86_cpu_initfn(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- target-i386/cpu.c | 7 ------- target-i386/translate.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-)