From patchwork Tue Oct 17 15:37:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 116135 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp1372039edb; Tue, 17 Oct 2017 08:40:30 -0700 (PDT) X-Received: by 10.237.37.132 with SMTP id x4mr18416250qtc.224.1508254830089; Tue, 17 Oct 2017 08:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508254830; cv=none; d=google.com; s=arc-20160816; b=I3cEqAlJPDj25esRU8n9Oesm7cEYJEh9e7/Di7HBf3XYFnIgElp8N3nPumMytPgm4m GWANmJ6/gzY74yOd71PgwU4AqchcGmqFLBG9F7+CBsth+fEoDfH1+Pmd4Jagy7/zb1FO 1Umdf2nxDp4H95BQjJzvDw/SKsF4EJ7Ltn0mZmom/UalQuOF5KNciwCSJ2xN4Z7Vcjwb oIwodOJs7os8sL1rH7205u7vzsT0P8zwSB+7eD9R8vfLhNUjUzmiqdnGx3FGQGB8pxPu 51kfpkWd1Q3hVzeI8aQQEsx9C4YZqLh3MD+gxIi8UWi5u4Ex3waxotoSMHc3ZOovxdUL g0oA== 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=chfoJBU+nyqcgO2t4lckPD6aYSbxk/BhHT57ZCjJXKc=; b=f/bd9yT4IL3ok6YYngeNTbjNyWWWxinUeo4A0bxTizVlE4O4RPYmsfbNJutsyej4Az mGQaSa06MGMTwPeXgn4SIiQ8r4f/FTNHLFS9XdCzK+5IL53yn2soTMOukohK2e5AsG5W kTVCYDK6Hc/iaLR5DLq7aiKB+s1k+q2FrgVyMif57BmQF/aLJzKcv5M5FPycM9ZCJJ6t UVFfqL1Ig15Sm8YnVHz91oEu11Zr9PKqJbk79TPo36Ku66NVMOU8Jb8mlPdUyYs/f3W0 rDMwWyAlFS6EyawToDkspv9QFBoVP8OTrCNBtlz/jBQ8NWqp7o7FAfp4z9DsWyLegJIV ZA5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FPm1df68; 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 q190si494922qke.70.2017.10.17.08.40.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Oct 2017 08:40:30 -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=FPm1df68; 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]:40098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Tyl-0005mG-KZ for patch@linaro.org; Tue, 17 Oct 2017 11:40:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4TwM-0004Jr-Nc for qemu-devel@nongnu.org; Tue, 17 Oct 2017 11:38:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4TwJ-0005rX-Rb for qemu-devel@nongnu.org; Tue, 17 Oct 2017 11:37:58 -0400 Received: from mail-pg0-x231.google.com ([2607:f8b0:400e:c05::231]:55843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4TwJ-0005pZ-Kz for qemu-devel@nongnu.org; Tue, 17 Oct 2017 11:37:55 -0400 Received: by mail-pg0-x231.google.com with SMTP id y184so508981pgd.12 for ; Tue, 17 Oct 2017 08:37:55 -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=chfoJBU+nyqcgO2t4lckPD6aYSbxk/BhHT57ZCjJXKc=; b=FPm1df68pbXeSw0DdSErvoKQB4gRSG5TZwaiv9CbeoyYjY7rep4Uk0cuhtNky3NiDk BnnNGYu1CnFQkfDNDshBmrqEsQphml4zrQii1i1d8AFko0MrT0mMe5+dhPIxvtBLNnzq LPOjl9WjOzM+V5eNKA8fYmpNLvFB/VmA5G9kA= 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=chfoJBU+nyqcgO2t4lckPD6aYSbxk/BhHT57ZCjJXKc=; b=FQP3Cdg5ONf+u9J9xap+YxTBNhICITFW4tumC+XoJYidmNHiISPmXovljQTSibsJDp CeHJ2sFVhrNA2DXTqs4EzAsNDlatm5F3Ta09O1SBaWScsGBAB7MEyFh99x2K9LHz60yr vRM49erEAXWn+ca5CQ4vlhe22qr2P7X7zM+WgIFDy24GwpJSy19t+iAecVUpoCF/G5lu EYze1MTJR9GVIHjzEP0ozNkpP55LCKlLUgX0TpBbUQX4WarybSK1h/oSDUJHMfybKmE3 KKL5QvIT5vw+yf1qePIg27tycvuJqA9mEEzpklfiOzGLwfmDwdw4zQJwHUL0ArWX31Un JqJw== X-Gm-Message-State: AMCzsaW2+Ah0DhYt8l6QJkRrQTetZUwXR7dSzC4bBxs+Lft7SPfAGJdh 4mDDRnhEhGdJLEHgpoOPjO9a+ck/cfk= X-Google-Smtp-Source: ABhQp+Q7zLrhaTrsTK+UsvekYMxEmAvVBAoDuHWtWu7HQVa6c0yXDx0YA3JAymv+5CRoCmBlb7kDag== X-Received: by 10.98.93.136 with SMTP id n8mr4549736pfj.215.1508254674288; Tue, 17 Oct 2017 08:37:54 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id y84sm20094415pff.158.2017.10.17.08.37.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 08:37:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 08:37:40 -0700 Message-Id: <20171017153742.10026-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171017153742.10026-1-richard.henderson@linaro.org> References: <20171017153742.10026-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::231 Subject: [Qemu-devel] [PATCH v5 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 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 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[] = {