From patchwork Thu Oct 19 15:51:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 116411 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp650753qgn; Thu, 19 Oct 2017 08:57:46 -0700 (PDT) X-Received: by 10.200.53.12 with SMTP id y12mr2945278qtb.84.1508428666530; Thu, 19 Oct 2017 08:57:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508428666; cv=none; d=google.com; s=arc-20160816; b=VXZScLnA12U9GTMZ/YcorhYYZdKzohvUBIXZmCwCvi8KYaoahZzOErJjQKW4dMS/z1 3zWvRvJ36Lc0Gj1rGtjcOB5PndZX08EZSf8uy5W9UXepN0y6dawljiLx8k5hshV38YAc XgLs2NcnQPJFPSBZl0HF1twAau5+MO40q5Tgy4htuI+zW1sHwTwEDaboS+5+P8cRsgTY IIrLnW4oxLiGy/g2n9hyNkHJ6W0xgwGZ1CTAoBGedBs8CO2NdzabMiVpjhWUhTOZhjUP r6yYfkMkOt65jd7TJ8YhxIeUzLK+1DdpDU8+B0rXG+dLioAELPlZAt0tU4O8y6qS+uDo vn2g== 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=Cr3X9rpwfshfBHQIdaWHzBRIQbD8oDc8jCp7PvTszgD1w2kc9mvKj60KvlSbPpy3SH GkRjAJrATAHC9cKFV4PSmUJtMudlllNG3XupLZwn9+eZzZ4H33Ggrrc46kgny+5jh1i1 vKwWhl7U2DOfM1N9JfCVMr2IU6K+N1+5rF8zGy0GzwBEfk6rtFq/VGEDvIUkcvdAnRmH u6cf31xPqnZRCqAWklEX7aMwKxwZfBNpYpztWswcBShqHAOV5CaIxn2JDqUcSkosVpd+ AzJq9nCycwblVay7sD7vMP0teIAeSoNuVjHGePxxWayBgaie5eybLyZLDxrTeCgpRAfA 6QEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Eg/qrf51; 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 54si4717023qts.209.2017.10.19.08.57.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 Oct 2017 08:57:46 -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=Eg/qrf51; 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]:49852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DCa-00035s-G8 for patch@linaro.org; Thu, 19 Oct 2017 11:57:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5D73-0007DP-3E for qemu-devel@nongnu.org; Thu, 19 Oct 2017 11:52:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5D72-0000HH-9e for qemu-devel@nongnu.org; Thu, 19 Oct 2017 11:52:01 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:54107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5D72-0000Ge-4p for qemu-devel@nongnu.org; Thu, 19 Oct 2017 11:52:00 -0400 Received: by mail-pg0-x241.google.com with SMTP id s2so7522578pge.10 for ; Thu, 19 Oct 2017 08:51:59 -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=Eg/qrf51wMOftowIBt875SYqHJXLKYMxfh/uBg7LBiTNa0O24LnU65c+djeK8QDYbh Y3Q1znhPL76W79ceEgoob9/OuOf25dN5c5JEGpExeqixaj9f1/lntCchsRQL5ZSOu5Kn x920g/HHo0sc6M+TvLQ5gE5GVFUIYL0QAhDO8= 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=PcBu7peyWOu2888CTFW6K712UGcFdoHmGgqkMnA8eOLLd4B/1qxL1+75UxR5odHch/ 9rh0kVFJHgz/zCwppcCP8FLFWQyANHhDJ15kOGr9W5L24P+izGhcPA9KVpSiavu7diaw lz+TsQ4lEFPyEK0KZ+JYv+SDuDESLx/IozH1fF8lh/3aznFkhbFNmiTNV6G0p19rKCvW KWmpANGDIZmAqkjMk6OWcagFisq4rXEZYhWecOKD8O0vz8QyktySkVgmBX+E6kdrm+hg LtLIPpN8RYaj6FgB/IEB3EjZme7fy/rqTe/AgRW0AIFLxux0Bevbdv6yVx0tM+yvqkme uHeA== X-Gm-Message-State: AMCzsaWI/8LdW8D+KH27T81Ny1LKk3mClx2Vok7kkmR13gCQycBRAxA/ QIKZXy9lZe1NnVdL4SUlkkpsbpk81TM= X-Google-Smtp-Source: ABhQp+TLcAhXlkIQ6+fZgj2bRPadyTpqK8W9ZagL0exnGaOV0tFuZAWiS6iQGDZRxWFauMHBlqML1Q== X-Received: by 10.99.97.149 with SMTP id v143mr1772567pgb.413.1508428318906; Thu, 19 Oct 2017 08:51:58 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-165-104.tukw.qwest.net. [97.113.165.104]) by smtp.gmail.com with ESMTPSA id 76sm27971114pfq.4.2017.10.19.08.51.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2017 08:51:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 19 Oct 2017 08:51:44 -0700 Message-Id: <20171019155146.30434-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171019155146.30434-1-richard.henderson@linaro.org> References: <20171019155146.30434-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: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH v6 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: , Cc: qemu-ppc@nongnu.org, kraxel@redhat.com 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[] = {