提交 20984673 编写于 作者: P Peter Crosthwaite 提交者: Andreas Färber

disas: QOMify lm32 specific disas setup

Move the target_disas() lm32 specifics to the CPUClass::disas_set_info()
hook and delete the #ifdef specific code in disas.c.
Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: NMichael Walle <michael@walle.cc>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 df0900eb
...@@ -242,9 +242,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code, ...@@ -242,9 +242,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
#elif defined(TARGET_ALPHA) #elif defined(TARGET_ALPHA)
s.info.mach = bfd_mach_alpha_ev6; s.info.mach = bfd_mach_alpha_ev6;
s.info.print_insn = print_insn_alpha; s.info.print_insn = print_insn_alpha;
#elif defined(TARGET_LM32)
s.info.mach = bfd_mach_lm32;
s.info.print_insn = print_insn_lm32;
#endif #endif
if (s.info.print_insn == NULL) { if (s.info.print_insn == NULL) {
s.info.print_insn = print_insn_od_target; s.info.print_insn = print_insn_od_target;
...@@ -442,9 +439,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu, ...@@ -442,9 +439,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu,
#elif defined(TARGET_SH4) #elif defined(TARGET_SH4)
s.info.mach = bfd_mach_sh4; s.info.mach = bfd_mach_sh4;
s.info.print_insn = print_insn_sh; s.info.print_insn = print_insn_sh;
#elif defined(TARGET_LM32)
s.info.mach = bfd_mach_lm32;
s.info.print_insn = print_insn_lm32;
#endif #endif
if (!s.info.print_insn) { if (!s.info.print_insn) {
monitor_printf(mon, "0x" TARGET_FMT_lx monitor_printf(mon, "0x" TARGET_FMT_lx
......
...@@ -131,6 +131,12 @@ static void lm32_cpu_reset(CPUState *s) ...@@ -131,6 +131,12 @@ static void lm32_cpu_reset(CPUState *s)
tlb_flush(s, 1); tlb_flush(s, 1);
} }
static void lm32_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
{
info->mach = bfd_mach_lm32;
info->print_insn = print_insn_lm32;
}
static void lm32_cpu_realizefn(DeviceState *dev, Error **errp) static void lm32_cpu_realizefn(DeviceState *dev, Error **errp)
{ {
CPUState *cs = CPU(dev); CPUState *cs = CPU(dev);
...@@ -275,6 +281,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) ...@@ -275,6 +281,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data)
cc->gdb_num_core_regs = 32 + 7; cc->gdb_num_core_regs = 32 + 7;
cc->gdb_stop_before_watchpoint = true; cc->gdb_stop_before_watchpoint = true;
cc->debug_excp_handler = lm32_debug_excp_handler; cc->debug_excp_handler = lm32_debug_excp_handler;
cc->disas_set_info = lm32_cpu_disas_set_info;
/* /*
* Reason: lm32_cpu_initfn() calls cpu_exec_init(), which saves * Reason: lm32_cpu_initfn() calls cpu_exec_init(), which saves
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册