aboutsummaryrefslogtreecommitdiff
path: root/target-lm32/cpu.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>2015-07-11 19:00:02 -0700
committerAndreas Färber <afaerber@suse.de>2015-10-22 15:49:40 +0200
commit20984673e68ebd069222512c876b846ff2425cc0 (patch)
tree42a2b6e72277dd3bea0509d73cb17e04975782d7 /target-lm32/cpu.c
parentdf0900eb89a0672a3f924b7e8d20163dee2383db (diff)
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: Peter Crosthwaite <crosthwaite.peter@gmail.com> Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-lm32/cpu.c')
-rw-r--r--target-lm32/cpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c
index d0ab2786ae..0bc544c1e0 100644
--- a/target-lm32/cpu.c
+++ b/target-lm32/cpu.c
@@ -131,6 +131,12 @@ static void lm32_cpu_reset(CPUState *s)
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)
{
CPUState *cs = CPU(dev);
@@ -275,6 +281,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data)
cc->gdb_num_core_regs = 32 + 7;
cc->gdb_stop_before_watchpoint = true;
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