Skip to content

Commit

Permalink
disas: microblaze: QOMify target specific disas setup
Browse files Browse the repository at this point in the history
Move the target_disas() MB specifics to the QOM disas_set_info hook
and delete the MB specific code in disas.c.

This also now adds support for monitor_disas() to Microblaze.

E.g.
(qemu) xp 0x90000000
0000000090000000: 0x94208001

And before this patch:
(qemu) xp/i 0x90000000
0x90000000: Asm output not supported on this arch

After:
(qemu) xp/i 0x90000000
0x90000000:  mfs    r1, rmsr

Reviewed-by: Edgar E. Iglesias <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
  • Loading branch information
pcrost authored and afaerber committed Jul 9, 2015
1 parent 4844062 commit efc6674
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
#elif defined(TARGET_S390X)
s.info.mach = bfd_mach_s390_64;
s.info.print_insn = print_insn_s390;
#elif defined(TARGET_MICROBLAZE)
s.info.mach = bfd_arch_microblaze;
s.info.print_insn = print_insn_microblaze;
#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-microblaze/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ static void mb_cpu_reset(CPUState *s)
#endif
}

static void mb_disas_set_info(CPUState *cpu, disassemble_info *info)
{
info->mach = bfd_arch_microblaze;
info->print_insn = print_insn_microblaze;
}

static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
Expand Down Expand Up @@ -256,6 +262,8 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
dc->vmsd = &vmstate_mb_cpu;
dc->props = mb_properties;
cc->gdb_num_core_regs = 32 + 5;

cc->disas_set_info = mb_disas_set_info;
}

static const TypeInfo mb_cpu_type_info = {
Expand Down

0 comments on commit efc6674

Please sign in to comment.