From patchwork Tue Sep 26 20:14:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 114291 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4242335qgf; Tue, 26 Sep 2017 13:21:12 -0700 (PDT) X-Received: by 10.55.98.214 with SMTP id w205mr15721059qkb.355.1506457271903; Tue, 26 Sep 2017 13:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506457271; cv=none; d=google.com; s=arc-20160816; b=polldpPDD9dNNRgF9qbgdch/qvfOEaBwNm7tkiuoHhpiIJfp4rfVHqZw+iKGbsys8P WQSMGUAp9F6vZhkvXFEYr3k9ZD+6ku1pCN9F6SjWHhBFUoOmBj8vB17NfpntMGruknNk COY3leBxC+0KrtRUvtFq2EMEUI1v+Olkdt+O21SDFHFKhi3fzS48bO99iEf3VmwNS34E +GhxczaXsC8WnhJ+V/05l1MDSpgslNciISv17sFt+f5q7/5jg0sYldELaXP3gTScjsXk LBiIOgkHblD4veI3mGpYvp4S3yAs/MibSDgFohsm8mkn8pC1Jpi35k8Q49FKZMjMzWqo Cp2Q== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=cJ5l6HNXUfgpDzEpHbSOX+oIRbEB2raX+y/0EHEZpJo=; b=aeMMdzuTB/Xb6tf3jL9f1rF0rKebmu4lLzfSGAz46OFU4LaymLH+xBYatw8M8qtT78 9COM52t2bQrx6W5/xtS8L+GSoWnQmb6YR6eIg3MSPS0slx3KoSjriz2jC4nPA4m8iyFJ CNmJu3+/J4hEeYxDgt9nPoufTriMZiRSyPVxVmwTJ3AaQJnTYg/PFHY2UEtD5fVdzkK2 2R7TwMkpvVyLRisldXN2BISFhB/yRaU7++IS6oIfnq/dIEaiazLyPrPL3TRp7VLB1lKK 7CYjPMUsvp6LDYAPqTZ1lvsLjTtHibP2G3laVJ7EVmyYekHsN/cvkU/w1gX+ruUmADbc Rkeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IkeI6/fe; 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 133si5110263qki.523.2017.09.26.13.21.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Sep 2017 13:21:11 -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=IkeI6/fe; 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]:51012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwLt-0008LZ-Qy for patch@linaro.org; Tue, 26 Sep 2017 16:21:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwFf-0002xH-8V for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwwFe-0003Fc-7p for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:43 -0400 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]:48917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwwFe-0003F9-2J for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:42 -0400 Received: by mail-pg0-x22d.google.com with SMTP id v23so6516366pgc.5 for ; Tue, 26 Sep 2017 13:14:42 -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; bh=cJ5l6HNXUfgpDzEpHbSOX+oIRbEB2raX+y/0EHEZpJo=; b=IkeI6/fe4NDEHT62WSoPxKmuACX+DIZj6g9H4rRPscAWG2oUjIxT4r47b+tpkbw/aI bFlA2KGu1Qie7AcFyeDsoTXaTQHLhZkNZzVlOUTwBzgtLVTOA0tCgGK5HNtv7xOmfMYM sC6yYneEomp1TjffuUWQfwWq7QHF0krX1JctE= 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; bh=cJ5l6HNXUfgpDzEpHbSOX+oIRbEB2raX+y/0EHEZpJo=; b=VeC0+Zj2lsxbFZTSAuDzXYMiprYoql/93ajhUWDQLCSGE/1eHroNFvBlpLGXsCcMqH s+fGa+MyVwnxUudn1ZxaYT1cXtx3D2zu2xfeJWz3dKZFONlPhtgfhXlnjjDTwdc+OS0W Hg8iYMU1BPnKtPgmyxmATu9ImdyGq141zLXpAZI6ir24Rx6Vxm1dTye0o1hRIFRPHv7P t95AXfQKZmyAj3JPJBC0LHcakSEqytvPx2Cpg1YQlUc9YDqQzOq7qu1TLGz7c0qHLhSU 6neXXyNjVoYkoCDTJj2u6qFb/XhMV7qe8h26IewmKIKc6yRT7SEjNN4YWfuLsWoLI/kj LTLA== X-Gm-Message-State: AHPjjUgNxDgwc+gS6mc3keuSJ4wegwD/v8IgXbLAO1pfXrYLsFwn5Rfz FR/zTSYOB2Bnaja/QwzVaK3lNi3V1p0= X-Google-Smtp-Source: AOwi7QCKm13meHOnQGnrBgJy4VQ7M1NIvTD4uVU0f2UXCV7Z8KGoMnFq27Fw3poIZuKunBK/Xil0KA== X-Received: by 10.159.197.6 with SMTP id bj6mr11806542plb.178.1506456880939; Tue, 26 Sep 2017 13:14:40 -0700 (PDT) Received: from bigtime.twiddle.net ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id r138sm15582470pgr.12.2017.09.26.13.14.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Sep 2017 13:14:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 13:14:25 -0700 Message-Id: <20170926201427.2833-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170926201427.2833-1-richard.henderson@linaro.org> References: <20170926201427.2833-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:c05::22d Subject: [Qemu-devel] [PATCH v3 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: peter.maydell@linaro.org, qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- disas.c | 4 ++++ target/ppc/translate_init.c | 6 ++++++ 2 files changed, 10 insertions(+) -- 2.13.5 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 5524b171e0..599068cb22 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 @@ -10661,6 +10662,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[] = {