From patchwork Thu Sep 28 16:54:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9976399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A03B760375 for ; Thu, 28 Sep 2017 17:00:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90A3729665 for ; Thu, 28 Sep 2017 17:00:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85854296BD; Thu, 28 Sep 2017 17:00:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2006D296BA for ; Thu, 28 Sep 2017 17:00:05 +0000 (UTC) Received: from localhost ([::1]:60076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxcAP-0008UZ-4o for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Sep 2017 13:00:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxc4z-0004p3-G0 for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxc4y-0004NM-OJ for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:29 -0400 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:49170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxc4y-0004Mv-J2 for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:28 -0400 Received: by mail-pf0-x22a.google.com with SMTP id l188so1140971pfc.6 for ; Thu, 28 Sep 2017 09:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=9jTezQxIQpWR86xwYVtlpM0ZzOCIAOo9yXmgBX78bRY=; b=g4l17OZiqIU7EIJKiXgyDDMgSWS9024YD+BlJN/4YivhWBx0Yug6+zkwuwZS1MN2yn 238rXkVrruSyFfbE75FQcYVwi/VbzSbw+1nnaFjNPtGXpRhcZIztN+jci/WPHzxEtjSe 28FNyYZ2kcT8E9z+Gw+ImBDwLVl23m+fVXUXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9jTezQxIQpWR86xwYVtlpM0ZzOCIAOo9yXmgBX78bRY=; b=DeP/cneZl0uPO/tay5g48DNQgLlKqFzKDBmGxE6esSnQTEESIemh8QrKtkShaAdc/z I0YIQw4e8NSu2cho2kwsZiINqth2MiHRFB8VKlw//5cKyp3UD4xH35xwNhxehItapDlz dwzoEaMrlgNU7RPg0n94n9tMyBJBR7FTQr89yNFUeB6xzdbgJ+nsM/dQLZKk0BO0aPB4 zPnW+/Evc7lgZijPdAcRjjT23oVcFAWfuzZbhR0el9dZw8KkFG+myaAUxJjgxu4brVxb Ouy0eWMj2XtW6Hm6ULchgupDLJXKYH8SicAy3Jwfq64JW1PW+dR02eMbTcomW068gBOq Y/fw== X-Gm-Message-State: AHPjjUgQDt0bxfH0tEyxdEAXZG45oGOlKZCc8qms2HKtHoYN27yW6L5U OlcXT9p/O7dl9As2Cy0wB9YFpAcXS54= X-Google-Smtp-Source: AOwi7QDpQPyzOoSHzoyq/lBIbRQLUDmh0QBRLFzQbr5Ma8IveJUDLQRiPxRYmZW1ZImtEBU/MjUeQQ== X-Received: by 10.99.53.205 with SMTP id c196mr4793527pga.430.1506617667312; Thu, 28 Sep 2017 09:54:27 -0700 (PDT) Received: from bigtime.twiddle.net ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id e133sm3062332pfh.177.2017.09.28.09.54.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Sep 2017 09:54:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Sep 2017 09:54:12 -0700 Message-Id: <20170928165414.7339-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170928165414.7339-1-richard.henderson@linaro.org> References: <20170928165414.7339-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22a Subject: [Qemu-devel] [PATCH v4 7/9] ppc: Support Capstone in disas_set_info X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- disas.c | 4 ++++ target/ppc/translate_init.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/disas.c b/disas.c index 23c4742f8d..0d212f2ac5 100644 --- a/disas.c +++ b/disas.c @@ -449,6 +449,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 2863e2c0b0..69a9485f66 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 @@ -10699,6 +10700,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[] = {