From patchwork Thu Sep 28 16:54:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 114460 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp969317qgf; Thu, 28 Sep 2017 10:00:41 -0700 (PDT) X-Received: by 10.55.162.131 with SMTP id l125mr7395350qke.29.1506618041063; Thu, 28 Sep 2017 10:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506618041; cv=none; d=google.com; s=arc-20160816; b=IFKv430SbGtwbUvUHYiP2lAZig7/ccmYSord9VfgZpKYsWBvXg1RMxMkP3prUYg9Qy JYc5gDiydwJlhUXzSeUrclNBlEn2TGXt0uUj4KhPLF41N6af0s03HJZV6lx5h65vShEu +MbprMYlTi+it1V7tRW+SY69NTU5JR+czvgsg1hcuFBSqofSQPmEZNtrZcMd5uywPuIF 2B0Z3q8wueL+DOFS0Oiq4uaPHe3Mx5F8tDhxOcBJx7lUP2OUkmWN+q4vle3X6cheAzwY etpTmR8NX39bJHXtGAbUa/XvUbOyLD487qEUWffI64S9S/lKfVpPW4SbZjowK80NaDWQ mwxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=9jTezQxIQpWR86xwYVtlpM0ZzOCIAOo9yXmgBX78bRY=; b=VFJBqM2AdlpiC7hfeL9K2rS5oQAIvXJLmrB05hIwpL/LJmjj+bgyWBfkKceEhGxfgm EVwAasq07dsQ7Mf0Nzo/XINa51iQ/r9jC2gbEaczefxdG39vpVhurOGIWdhDFQq1Aq/M IuZkO0pacyf1KljvkAXyOlfrfWgUk7VwFbAMoEG544zKh1HUHKwTn/NXem4Y0YHkl/ci h/ZNvYgxNFIb+rQwBjJ10ZVrQJ6J62qGTiibl6lvz7MA9xDSEMf9FPFLP8FlasLTLggQ XTWfTmEyn+EjyGwanO7yXExbIAviXT8a4uXEqTEEzbeZ+bt/PCb2HKS74TVW3N0LbRRh zZ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g4l17OZi; 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 s45si152691qtk.355.2017.09.28.10.00.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Sep 2017 10:00:41 -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=g4l17OZi; 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]:60079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxcAw-0000xf-V0 for patch@linaro.org; Thu, 28 Sep 2017 13:00:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxc4z-0004p3-G0 for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxc4y-0004NM-OJ for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:29 -0400 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:49170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxc4y-0004Mv-J2 for qemu-devel@nongnu.org; Thu, 28 Sep 2017 12:54:28 -0400 Received: by mail-pf0-x22a.google.com with SMTP id l188so1140971pfc.6 for ; Thu, 28 Sep 2017 09:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=9jTezQxIQpWR86xwYVtlpM0ZzOCIAOo9yXmgBX78bRY=; b=g4l17OZiqIU7EIJKiXgyDDMgSWS9024YD+BlJN/4YivhWBx0Yug6+zkwuwZS1MN2yn 238rXkVrruSyFfbE75FQcYVwi/VbzSbw+1nnaFjNPtGXpRhcZIztN+jci/WPHzxEtjSe 28FNyYZ2kcT8E9z+Gw+ImBDwLVl23m+fVXUXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9jTezQxIQpWR86xwYVtlpM0ZzOCIAOo9yXmgBX78bRY=; b=DeP/cneZl0uPO/tay5g48DNQgLlKqFzKDBmGxE6esSnQTEESIemh8QrKtkShaAdc/z I0YIQw4e8NSu2cho2kwsZiINqth2MiHRFB8VKlw//5cKyp3UD4xH35xwNhxehItapDlz dwzoEaMrlgNU7RPg0n94n9tMyBJBR7FTQr89yNFUeB6xzdbgJ+nsM/dQLZKk0BO0aPB4 zPnW+/Evc7lgZijPdAcRjjT23oVcFAWfuzZbhR0el9dZw8KkFG+myaAUxJjgxu4brVxb Ouy0eWMj2XtW6Hm6ULchgupDLJXKYH8SicAy3Jwfq64JW1PW+dR02eMbTcomW068gBOq Y/fw== X-Gm-Message-State: AHPjjUgQDt0bxfH0tEyxdEAXZG45oGOlKZCc8qms2HKtHoYN27yW6L5U OlcXT9p/O7dl9As2Cy0wB9YFpAcXS54= X-Google-Smtp-Source: AOwi7QDpQPyzOoSHzoyq/lBIbRQLUDmh0QBRLFzQbr5Ma8IveJUDLQRiPxRYmZW1ZImtEBU/MjUeQQ== X-Received: by 10.99.53.205 with SMTP id c196mr4793527pga.430.1506617667312; Thu, 28 Sep 2017 09:54:27 -0700 (PDT) Received: from bigtime.twiddle.net ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id e133sm3062332pfh.177.2017.09.28.09.54.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Sep 2017 09:54:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Sep 2017 09:54:12 -0700 Message-Id: <20170928165414.7339-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170928165414.7339-1-richard.henderson@linaro.org> References: <20170928165414.7339-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:c00::22a Subject: [Qemu-devel] [PATCH v4 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: , 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 Reviewed-by: Philippe Mathieu-Daudé 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[] = {