From patchwork Sun Oct 22 00:46:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 116622 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3189352qgn; Sat, 21 Oct 2017 17:54:21 -0700 (PDT) X-Received: by 10.200.45.178 with SMTP id p47mr13362450qta.263.1508633661158; Sat, 21 Oct 2017 17:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508633661; cv=none; d=google.com; s=arc-20160816; b=HHOCENLrLm/byw0F8zuSDAwsV1i+wvOIk258y4mTOJcS7QJ/qjiPksgTkQDR4oRn1v 1JRQMcFJlNtBJ1vPBb0Alazt8760dVW1iZ37t44+LJgHlBYhSjKgj85lPVW9B1Rr9Itj 0OC2NUiJvfb5xTpP6HD8dQ633RwbUSCbuQviA6yuo00wtQfMM9rVmogrkUDZd0JDucbV +gNMhmuh5Yi81/7GGqZlYNOxF8vyV9mo7AVWhzHdNqS0QWtXKRPmuq4O7Lyl172UWl18 64dPcXP7snmBerAXlNE5nj92G+70goMG+uvBcy+MWFj1aM2Y5mvQANBsCnpt/O7rd4jO lHfA== 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=jIsgRnOsFfFGoat1gMdCU1OANKqAjPBh66K5Lfnx221GyyHXt1QJlfumpTxb2sobEu sg8xoEiRKsPEdlaHyBWsOd5jTjLZSZCS8o6zBc/QLITp4J8QsKXWzd4jTSR+CRD84Xnw fDjZZTTh5by2tdtw2vxlT5LvAme2bCe9+HNZaP9TZ/0BTnq5hejvL+xXzi3qRtG3YMo2 6GlOP5EvhF/ZpNIWOZpaeZIRoSzsSmp4brvWQPRxlMLgiV457r7P+ZbrZ3cFYneM9mEN KDUBJ8ehk+4u2lmdE89fsylRo7VzMYOtp3h8V5rTL6YaCsNAGS5xnHKqfyy1VXD75evL eQJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X9OPDaAo; 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 w134si3575736qkw.38.2017.10.21.17.54.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 21 Oct 2017 17:54:21 -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=X9OPDaAo; 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]:59651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e64Wx-0007oF-45 for patch@linaro.org; Sat, 21 Oct 2017 20:54:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e64PZ-0002Hr-Qx for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e64PY-0008O3-3f for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:41 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:44600) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e64PX-0008NA-Tm for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:40 -0400 Received: by mail-pf0-x243.google.com with SMTP id x7so14605632pfa.1 for ; Sat, 21 Oct 2017 17:46:39 -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=X9OPDaAo4au+pmHqcbVwcpZNPXgqcyhDqlVB68YtnChAw9hVI0PckzjI82eZdyLK+V DybhgvmNUCEDmlBcl/oh/OnPW2XEn4V6FmL6UmtitU08kWYftXHo5Kx7wVuIIU/Xgf8t EVEWrT+ZDQCSmGc1ZL9nDksnn+KozF5dL8yR8= 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=kUPjnWq5YNDgQOqWD4AXiRCoGK76Q01ZwEVc28iq7lfh0OjjVB1gnujWbrar/WA6vg W0Q/Omzw2NU7T9AsTgeQHe2N3xRlgbRfHy+oFdmbSb3CvA7rOpRKPrvDRN/G62MzmXxs Qoq6m2yiG6nWbAoVrqR3LlmZ7dWv78nvuWNoRIuHXs+dHvf2RIFrll+vYGP4G7LSCsrO WM7WWX3ieogEdYk+Ze3WtWxruZGlQmxB/qcKrytjhlkk4NXKcx3p6JwnaGW68M4G6EAp 7arfRwrLZDxt/qvFtp0CgoHrqZXvqxzG+cE6xZY72b8orW6ji2rZiTV7SK3KeABTCymj CX7Q== X-Gm-Message-State: AMCzsaUbY3gLFnYnbRlCViaNH15Lgg3V9JHlE24AjpXU8um+7RELY1fC eJlO17TPb+zWdjK0U92CZ9BGKcRH0fs= X-Google-Smtp-Source: ABhQp+R7S38TmYK6abnoayrlSMrJQaF3sviJVD8zEPtl8QWELgNtDDJKKSYmVzNANUv/cvsVFeCC+A== X-Received: by 10.99.168.76 with SMTP id i12mr8213114pgp.427.1508633198441; Sat, 21 Oct 2017 17:46:38 -0700 (PDT) Received: from cloudburst.twiddle.net (174-21-9-158.tukw.qwest.net. [174.21.9.158]) by smtp.gmail.com with ESMTPSA id j12sm5766728pgs.35.2017.10.21.17.46.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2017 17:46:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 21 Oct 2017 17:46:19 -0700 Message-Id: <20171022004621.28372-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171022004621.28372-1-richard.henderson@linaro.org> References: <20171022004621.28372-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:c00::243 Subject: [Qemu-devel] [PATCH v7 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: 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[] = {