From 86025ee4438e6e46eed767aad7c17ea94bb5c19b Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 12 Sep 2014 14:06:48 +0100 Subject: cpu-exec: Make debug_excp_handler a QOM CPU method Make the debug_excp_handler target specific hook into a QOM CPU method. Signed-off-by: Peter Maydell --- target-xtensa/cpu.c | 2 +- target-xtensa/cpu.h | 2 +- target-xtensa/helper.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'target-xtensa') diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c index 9d8801b70e..936d526d41 100644 --- a/target-xtensa/cpu.c +++ b/target-xtensa/cpu.c @@ -119,7 +119,6 @@ static void xtensa_cpu_initfn(Object *obj) if (tcg_enabled() && !tcg_inited) { tcg_inited = true; xtensa_translate_init(); - cpu_set_debug_excp_handler(xtensa_breakpoint_handler); } } @@ -151,6 +150,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; #endif + cc->debug_excp_handler = xtensa_breakpoint_handler; dc->vmsd = &vmstate_xtensa_cpu; } diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h index d797d2649a..9cf52758c7 100644 --- a/target-xtensa/cpu.h +++ b/target-xtensa/cpu.h @@ -390,7 +390,7 @@ static inline CPUXtensaState *cpu_init(const char *cpu_model) } void xtensa_translate_init(void); -void xtensa_breakpoint_handler(CPUXtensaState *env); +void xtensa_breakpoint_handler(CPUState *cs); int cpu_xtensa_exec(CPUXtensaState *s); void xtensa_register_core(XtensaConfigList *node); void check_interrupts(CPUXtensaState *s); diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c index 94dcd9442e..6671e40289 100644 --- a/target-xtensa/helper.c +++ b/target-xtensa/helper.c @@ -79,9 +79,10 @@ static uint32_t check_hw_breakpoints(CPUXtensaState *env) return 0; } -void xtensa_breakpoint_handler(CPUXtensaState *env) +void xtensa_breakpoint_handler(CPUState *cs) { - CPUState *cs = CPU(xtensa_env_get_cpu(env)); + XtensaCPU *cpu = XTENSA_CPU(cs); + CPUXtensaState *env = &cpu->env; if (cs->watchpoint_hit) { if (cs->watchpoint_hit->flags & BP_CPU) { -- cgit v1.2.1