Skip to content

Commit

Permalink
ppc: Support Capstone in disas_set_info
Browse files Browse the repository at this point in the history
Cc: qemu-ppc@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Oct 25, 2017
1 parent 110f6c7 commit ac22689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions disas.c
Expand Up @@ -448,6 +448,10 @@ void disas(FILE *out, void *code, unsigned long size)
#elif defined(_ARCH_PPC)
s.info.disassembler_options = (char *)"any";
print_insn = print_insn_ppc;
s.info.cap_arch = CS_ARCH_PPC;
# ifdef _ARCH_PPC64
s.info.cap_mode = CS_MODE_64;
# endif
#elif defined(__aarch64__) && defined(CONFIG_ARM_A64_DIS)
print_insn = print_insn_arm_a64;
s.info.cap_arch = CS_ARCH_ARM64;
Expand Down
6 changes: 6 additions & 0 deletions target/ppc/translate_init.c
Expand Up @@ -35,6 +35,7 @@
#include "mmu-book3s-v3.h"
#include "sysemu/qtest.h"
#include "qemu/cutils.h"
#include "disas/capstone.h"

//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
Expand Down Expand Up @@ -10537,6 +10538,11 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info)
}
info->disassembler_options = (char *)"any";
info->print_insn = print_insn_ppc;

info->cap_arch = CS_ARCH_PPC;
#ifdef TARGET_PPC64
info->cap_mode = CS_MODE_64;
#endif
}

static Property ppc_cpu_properties[] = {
Expand Down

0 comments on commit ac22689

Please sign in to comment.