aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2012-06-19 15:39:46 +0200
committerIgor Mammedov <imammedo@redhat.com>2012-06-25 15:40:03 +0200
commitd65e9815b1ff90dff35e4e679bfb231c24e408f7 (patch)
tree2f4019a11fdeae624184db916e7b15e686a9c81b /target-i386/cpu.c
parent84e3b6025930cd474d3ca9f1885801dbc100cecb (diff)
target-i386: move tcg initialization into x86_cpu_initfn()
In order to make cpu object not depended on external ad-hoc initialization routines, move tcg initialization from cpu_x86_init inside cpu object "x86_cpu_initfn()". Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index fdd95be8cf..445274c97d 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1716,6 +1716,7 @@ static void x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
CPUX86State *env = &cpu->env;
+ static int inited;
cpu_exec_init(env);
@@ -1745,6 +1746,15 @@ static void x86_cpu_initfn(Object *obj)
x86_cpuid_set_tsc_freq, NULL, NULL, NULL);
env->cpuid_apic_id = env->cpu_index;
+
+ /* init various static tables used in TCG mode */
+ if (tcg_enabled() && !inited) {
+ inited = 1;
+ optimize_flags_init();
+#ifndef CONFIG_USER_ONLY
+ cpu_set_debug_excp_handler(breakpoint_handler);
+#endif
+ }
}
static void x86_cpu_common_class_init(ObjectClass *oc, void *data)