diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-20 01:46:45 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-02-16 14:50:59 +0100 |
commit | 25733eada6c1d4928262e77e2ee1e9ed12de18fb (patch) | |
tree | 95df16c7e4d456e212dff1dc0a602d9fda29aaa8 /target-xtensa/cpu.c | |
parent | d9c27f00b174df070470d48d6577042d2186d969 (diff) |
target-xtensa: Move TCG initialization to XtensaCPU initfn
Combine this with breakpoint handler registration, guarding both with
tcg_enabled() to suppress also TCG init for qtest. Rename the handler to
xtensa_breakpoint_handler() since it needs to become global.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-xtensa/cpu.c')
-rw-r--r-- | target-xtensa/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c index d3706a30ac..309bb169ec 100644 --- a/target-xtensa/cpu.c +++ b/target-xtensa/cpu.c @@ -71,8 +71,15 @@ static void xtensa_cpu_initfn(Object *obj) { XtensaCPU *cpu = XTENSA_CPU(obj); CPUXtensaState *env = &cpu->env; + static bool tcg_inited; cpu_exec_init(env); + + if (tcg_enabled() && !tcg_inited) { + tcg_inited = true; + xtensa_translate_init(); + cpu_set_debug_excp_handler(xtensa_breakpoint_handler); + } } static const VMStateDescription vmstate_xtensa_cpu = { |