mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
disas: QOMify alpha specific disas setup
Move the target_disas() alpha specifics to the CPUClass::disas_set_info()
hook and delete the #ifdef specific code in disas.c.
This also makes monitor_disas() consistent with target_disas(), as
monitor_disas() was missing a set of the BFD (This was an omission from
commit b9bec751c8
).
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
63a946c7e3
commit
0960be7cff
2 changed files with 8 additions and 5 deletions
5
disas.c
5
disas.c
|
@ -230,9 +230,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
|
|||
}
|
||||
s.info.disassembler_options = (char *)"any";
|
||||
s.info.print_insn = print_insn_ppc;
|
||||
#elif defined(TARGET_ALPHA)
|
||||
s.info.mach = bfd_mach_alpha_ev6;
|
||||
s.info.print_insn = print_insn_alpha;
|
||||
#endif
|
||||
if (s.info.print_insn == NULL) {
|
||||
s.info.print_insn = print_insn_od_target;
|
||||
|
@ -404,8 +401,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu,
|
|||
s.info.mach = bfd_mach_i386_i386;
|
||||
}
|
||||
s.info.print_insn = print_insn_i386;
|
||||
#elif defined(TARGET_ALPHA)
|
||||
s.info.print_insn = print_insn_alpha;
|
||||
#elif defined(TARGET_PPC)
|
||||
if (flags & 0xFFFF) {
|
||||
/* If we have a precise definition of the instruction set, use it. */
|
||||
|
|
|
@ -46,6 +46,12 @@ static bool alpha_cpu_has_work(CPUState *cs)
|
|||
| CPU_INTERRUPT_MCHK);
|
||||
}
|
||||
|
||||
static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
info->mach = bfd_mach_alpha_ev6;
|
||||
info->print_insn = print_insn_alpha;
|
||||
}
|
||||
|
||||
static void alpha_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cs = CPU(dev);
|
||||
|
@ -297,6 +303,8 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data)
|
|||
cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug;
|
||||
dc->vmsd = &vmstate_alpha_cpu;
|
||||
#endif
|
||||
cc->disas_set_info = alpha_cpu_disas_set_info;
|
||||
|
||||
cc->gdb_num_core_regs = 67;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue