All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PULL 09/11] ppc: Support Capstone in disas_set_info
Date: Wed, 25 Oct 2017 14:30:54 +0200	[thread overview]
Message-ID: <20171025123056.3165-10-richard.henderson@linaro.org> (raw)
In-Reply-To: <20171025123056.3165-1-richard.henderson@linaro.org>

Cc: qemu-ppc@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 disas.c                     | 4 ++++
 target/ppc/translate_init.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/disas.c b/disas.c
index 8d9bd4901c..e52e776a60 100644
--- a/disas.c
+++ b/disas.c
@@ -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;
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index 9b4353437a..41f46193a1 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -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
@@ -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[] = {
-- 
2.13.6

  parent reply	other threads:[~2017-10-25 12:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 12:30 [Qemu-devel] [PULL 00/11] Disassembler patches Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 01/11] target/i386: Convert to disas_set_info hook Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 02/11] target/ppc: " Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 03/11] target/arm: Move BE32 disassembler fixup Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 04/11] target/arm: Don't set INSN_ARM_BE32 for CONFIG_USER_ONLY Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 05/11] disas: Remove unused flags arguments Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 06/11] disas: Support the Capstone disassembler library Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 07/11] i386: Support Capstone in disas_set_info Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 08/11] arm: " Richard Henderson
2017-10-25 12:30 ` Richard Henderson [this message]
2017-10-25 12:30 ` [Qemu-devel] [PULL 10/11] disas: Remove monitor_disas_is_physical Richard Henderson
2017-10-25 12:30 ` [Qemu-devel] [PULL 11/11] disas: Add capstone as submodule Richard Henderson
2017-10-25 12:43 ` [Qemu-devel] [PULL 00/11] Disassembler patches no-reply
2017-10-26  6:07 ` Peter Maydell
2017-10-26  6:16   ` Peter Maydell
2017-10-26  7:06     ` Daniel P. Berrange
2017-10-26  7:21       ` Peter Maydell
2017-10-26 10:04         ` Richard Henderson
2017-10-26 10:06         ` Daniel P. Berrange
2017-10-26 13:29           ` Philippe Mathieu-Daudé
2017-10-26 13:50             ` Daniel P. Berrange
2017-10-26 14:25           ` Peter Maydell
2017-10-26  7:10   ` Richard Henderson
2017-10-27 15:07 ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171025123056.3165-10-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.