From patchwork Tue Sep 19 15:03:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 113027 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5057287qgf; Tue, 19 Sep 2017 08:33:39 -0700 (PDT) X-Received: by 10.200.53.67 with SMTP id z3mr2744309qtb.145.1505835219084; Tue, 19 Sep 2017 08:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505835219; cv=none; d=google.com; s=arc-20160816; b=e44inNp/zM9UiIjVN9bmK5UT27Uxsr4QDJke6BoVGP/0+/LDOtKKg45anwviXcTtLh wKf+tL3QqOJ6pDPHzrF6Wiqvj+Ja8nSpa+eJ2e22mYg/lQ6ZI8TV2OU45pfrCd79dvaK YPlE0W44vqWWJ5UXckSVPtLozVuFTAOLlqj6og8IkrX+8rZUO8WlQUj5gd99FwQNMf2J 5YO8mDqmsIU/A4GXT0FrPpWQ42X6NPR1zpNN7U5GmGj+zfSUv1L2iJLE1xfiqxw12vEy ASgHToUnPkLW5/cnkYryzVCiCazquOnT97pILw5/MyDRDfYks2Wlp9hnpqcgwv92zSI5 bf3Q== 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=xuhcGN2ZgOQi+3F+2TkD26ARrCHdGH2GiS55rAY47pU=; b=at6zNVLgM54PTGk/GOh6peXN8ueXOJkuQuhiLN7AiR6NfLySxQifeLUok1xGTobr4w DnNQNru5hcQ5aWqMq/I0XnpAxfRGEs3ybDR4NRG55YU04cCa+lOe/9nTH73tqYWp2y/b yx1RDr1/uxCOHjD4Y5+0waj1EB0Z5iw8NS8SONKcvtQin2UJ/h1zPCAjLcRJzqhVX4WE UX1FeF9BoKhRLuQxv5wZHD/6LIaLy3I8bOyLYVzd5Jx91d841QbP4woEXZDDwB0jcwoK OTkW+6n5s2UWUuba5XX6hg6qm6t69qpb7n7xmHzeF0AtLLVlAjHY4gGgX2TbZ+HBfOWX bBvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ozqt07nG; 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 n4si9124181qkf.318.2017.09.19.08.33.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Sep 2017 08:33:39 -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=Ozqt07nG; 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]:43576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duKWn-0001pm-0m for patch@linaro.org; Tue, 19 Sep 2017 11:33:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duK3h-00088G-S3 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duK3g-0003lY-Ig for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:33 -0400 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]:49511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duK3g-0003lA-CC for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:32 -0400 Received: by mail-io0-x233.google.com with SMTP id 21so725884iof.6 for ; Tue, 19 Sep 2017 08:03:32 -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=xuhcGN2ZgOQi+3F+2TkD26ARrCHdGH2GiS55rAY47pU=; b=Ozqt07nG3eLGK1qdm1k1Z4j0KskZtSgAxuCERxqONDhDg+wqOzsbEkvd4UruElfGiE YoYsFeaCI8ixQwJMaOozXsq6IEZj1GoHse7wYE3GB80Jfdtpl74bUkYSdyksRji2E0XT mLgQYNFS6V6XG2YqR25XW2roiGlMtVXoNsaBU= 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=xuhcGN2ZgOQi+3F+2TkD26ARrCHdGH2GiS55rAY47pU=; b=Kn8lzJQGrHNVKGmZTLwf3usCgb3CNdiDUGop/52X3OCrlrjgYv2A0KVqqpeptmpv+w l0T1K2al/vdQyJtVIhKF02cV0OqIsVLmyWjlzQSa4+eOfpvIZ3CImmwphWDxzleAeG7F z2S7YG803k1AKJJacHqH5ieb7fyToK9dKKTeL/9Ypt2z+ia+e+9R1mlQqtTeodzB8xaD r232AXaK7yblm5s5tyM1Ev99LMInI4+NkxYeAIQiSLlBBl1AgvlzS0s4Xf668EvnYVP4 tBre7gfbUiT7JYZ5NJ4NrDIzuPMPGmji3I5GQYQ52qJeRDv9IU5gM02jpkrpBXaJYtUz yGGQ== X-Gm-Message-State: AHPjjUiab2gjlU3KfK+HIGHfdEpEO/o3ekqbunEQXGjLrqfDJVWs3N01 5I+efMYjZ3glO1gDxxC5wOjc2PZoibY= X-Google-Smtp-Source: AOwi7QAD0KYvmUOXPRQFHmYmFhKaB0f/FpEk8r4jjFeEHYV55vJoxyct6hIMjfkrARvc6v+aDuroBw== X-Received: by 10.202.95.137 with SMTP id t131mr1851531oib.194.1505833411116; Tue, 19 Sep 2017 08:03:31 -0700 (PDT) Received: from bigtime.twiddle.net (162.189-204-159.bestel.com.mx. [189.204.159.162]) by smtp.gmail.com with ESMTPSA id h63sm360621otb.59.2017.09.19.08.03.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Sep 2017 08:03:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 10:03:12 -0500 Message-Id: <20170919150313.10833-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170919150313.10833-1-richard.henderson@linaro.org> References: <20170919150313.10833-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::233 Subject: [Qemu-devel] [PATCH v2 7/8] 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: David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Cc: David Gibson 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 ea295f9cfc..b4e4fc409e 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 c7b4a7c02a..b976784d21 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 @@ -10662,6 +10663,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[] = {