Skip to content

Commit

Permalink
disas: QOMify s390x specific disas setup
Browse files Browse the repository at this point in the history
Move the target_disas() s390 specifics to the CPUClass::disas_set_info()
hook and delete the #ifdef specific code in disas.c.

Cc: Alexander Graf <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Acked-by: Richard Henderson <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
  • Loading branch information
pcrost authored and afaerber committed Oct 22, 2015
1 parent ca3e40e commit dbad6b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
#elif defined(TARGET_ALPHA)
s.info.mach = bfd_mach_alpha_ev6;
s.info.print_insn = print_insn_alpha;
#elif defined(TARGET_S390X)
s.info.mach = bfd_mach_s390_64;
s.info.print_insn = print_insn_s390;
#elif defined(TARGET_MOXIE)
s.info.mach = bfd_arch_moxie;
s.info.print_insn = print_insn_moxie;
Expand Down Expand Up @@ -462,9 +459,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu,
#elif defined(TARGET_SH4)
s.info.mach = bfd_mach_sh4;
s.info.print_insn = print_insn_sh;
#elif defined(TARGET_S390X)
s.info.mach = bfd_mach_s390_64;
s.info.print_insn = print_insn_s390;
#elif defined(TARGET_MOXIE)
s.info.mach = bfd_arch_moxie;
s.info.print_insn = print_insn_moxie;
Expand Down
8 changes: 8 additions & 0 deletions target-s390x/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ static void s390_cpu_machine_reset_cb(void *opaque)
}
#endif

static void s390_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
{
info->mach = bfd_mach_s390_64;
info->print_insn = print_insn_s390;
}

static void s390_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
Expand Down Expand Up @@ -351,6 +357,8 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
cc->cpu_exec_interrupt = s390_cpu_exec_interrupt;
cc->debug_excp_handler = s390x_cpu_debug_excp_handler;
#endif
cc->disas_set_info = s390_cpu_disas_set_info;

cc->gdb_num_core_regs = S390_NUM_CORE_REGS;
cc->gdb_core_xml_file = "s390x-core64.xml";

Expand Down

0 comments on commit dbad6b7

Please sign in to comment.