From patchwork Wed Oct 25 12:30:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117116 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1690857edm; Wed, 25 Oct 2017 05:31:48 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RbLBNGm058bVFNqVh292LJIrO5w83Sua4jF+SdbsOSQBf8UxnkXfK3z+fdpfOhEIX0fGPK X-Received: by 10.129.157.79 with SMTP id u76mr12881813ywg.382.1508934708245; Wed, 25 Oct 2017 05:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508934708; cv=none; d=google.com; s=arc-20160816; b=a4wIH3vQQZ46h/vz715JY53XxddPfPcuvvn5KfzPTiefYTUCe3pyGbxMSxoDGcoOeY nQkliGm9zIuciGOLkxemKH3e4G7y6qyLRXY3mjXUsx4R1soUo0ruYjfeLPl7BUSky49T kBVCgzN2qdA+W1fvvyXxnmjiGPuTRR1V9tth07Mtfeq3fGjx0M5fJ5RZwQ2VLDfNkPup ujIeqHPbGVZoYeBNPmmiD7A7Hqdv6Aczo/oJBn1Khi28zktqbK5FEIANULcpmmsFL6oB YPFRv1sAJjwMF9Xr/7fdh1ZBGWf0JStBy6KxITD+YEWZxcpU1+n/PwXXpgmnppQGYJVS 3LuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=J9WMN9zt50J+oUerKnsIhYym35E8jwe6efwCEMhjR7o=; b=Q7DMCsCouaJyPSzNRrbKoqCM/lz6aZBZNXhfXGR5FoLjEsHS42gloszlrOCrQFRMMN 1F/WcMa//A9Qq+o1zXjV/tu/z49t/mVJxkCQrlzXCiLF/vw1zvFt3MYSyQgc6mj9tSFp Ne7eYSPgIkWBZFph9qijBQSU7sGC4BikYFkEWG7wAKwtlznXUZLp6TwXea2NXXa+SKj0 WOVkh/NAsSDz2Fi63WC0Ko2GCf8K5BgpPclvgg2ca5a+FOXtBReq2IgO8vhPLnZ4Ijjp S75+b5UqCjzHwy3lzLLS5i7ZVnnKUlBMsHhPZPhrtcqMoMWONTYDd1kCAGc9tylt0j3q tqAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K8pdeJSq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b3si413603ybi.247.2017.10.25.05.31.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 25 Oct 2017 05:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K8pdeJSq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7KqZ-0007b9-Jq for patch@linaro.org; Wed, 25 Oct 2017 08:31:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Kq5-0007YP-C8 for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Kq4-00084D-H7 for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:17 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:46932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7Kq4-00083z-BN for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:16 -0400 Received: by mail-wm0-x242.google.com with SMTP id m72so1587507wmc.1 for ; Wed, 25 Oct 2017 05:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J9WMN9zt50J+oUerKnsIhYym35E8jwe6efwCEMhjR7o=; b=K8pdeJSqUc2Eyxqnlw3bxMchAYOo12PCoDmd04Ui/DtkQ9rCnQh5RtZe7KbUWMqQF8 TOfXRYZp1rLMdWwctMOFxWJhFnhfZQxUVNuJ3qe5VTUEaJDNcKy5QlS88F/+J9s+LVU6 s527ByGpJrhjKSgHo8OCQ8PVvLjaACuiq+bio= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J9WMN9zt50J+oUerKnsIhYym35E8jwe6efwCEMhjR7o=; b=Kw/ISXxur1WVEcrb1o6usMgGcrdPmyrd7eMPXL0iS9cR9au8i3TM5J5iA22rlN+VFJ 09+SsAPgD2N1ZQPqUGK0IpE31qzY6Qk4YABy5mEIVmEbvM9owrdr7EAwpB1GYPWa2XEu YwtTiqsIBMv6ATBf8Ky0jc4UNW7xKz+MDRIp9bZyTNM+6Y3mqpdKFFZdZrTTqoNn5jGL FDXLh6t6zlSOzCfZXeww8vwp/heUHt6o5WaMsaHyqO11p5bQkgXf3NmjogSTsczotuWU 7CCkdj7zFKE5/g393YaRp7PdrYN+QkWKs8zVNQqYZvFWsRjMy8mE6hxFGIAEO5IqxWyz Y2og== X-Gm-Message-State: AMCzsaVZVexhb2EGUrFW1I8ircXasTFiMHIlPH3WRWJyd8fc9XaKqV+m y1LJ3+AelQwCPGBRqiCFDGPW1W2jKyg= X-Received: by 10.28.17.7 with SMTP id 7mr1605034wmr.66.1508934675125; Wed, 25 Oct 2017 05:31:15 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.105]) by smtp.gmail.com with ESMTPSA id 61sm2263446wrg.58.2017.10.25.05.31.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 05:31:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 14:30:54 +0200 Message-Id: <20171025123056.3165-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025123056.3165-1-richard.henderson@linaro.org> References: <20171025123056.3165-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 09/11] 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: , Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cc: qemu-ppc@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- disas.c | 4 ++++ target/ppc/translate_init.c | 6 ++++++ 2 files changed, 10 insertions(+) -- 2.13.6 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[] = {