From patchwork Tue Dec 25 20:55:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154504 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5223442ljp; Tue, 25 Dec 2018 13:21:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN7dPi2r/kuevINsf9qFZPskQW247bNzNnAhulNYPt0ytyjEy0A1sebZK4hZ+CPnbZ1sHnC9 X-Received: by 2002:ac8:3f5c:: with SMTP id w28mr16319044qtk.151.1545772912097; Tue, 25 Dec 2018 13:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545772912; cv=none; d=google.com; s=arc-20160816; b=HhMt5deTk+z85GT98p3sSy3AhE2YTe+8pQYnx4juub2WKjjmpa2itgFJpV+zHoWk5/ f6/DNITmpO4LzNwhaut+MrhflKkl/pBxtTLpVCpLBiFFuWSUc2T43UBh8GoEZmQ+ZvPE /z/6TF0Qr+Y0oGVdKXlEo9Lx0PMUE8IuHKdyO/djSP8RjZo6LGt/+Ky2oQ6xhLW5dytG KyqUSpB8DcPenU7LpYJR5H5fyZUUTAidcKkE6CLm9D3x/L7FpJe0qiE5MbP5yiX9TlkV BxoSz/7qeiNjZ9z9I4xtRiyu6rm9lTj/+lbeR4nuW9t33e4SUyHoq2r8ziO3a8wmZeTa zFeg== 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; bh=Sp+w7sUvhCyHvj3xdhW3ZNegFi+0b52HcJWEgQNBLWU=; b=Pm1HqXRMjCnNykHzGwDAH0GRkuNISrnGoZ02FMF0YA6zZ8cOrDP1n1poencRBKfalL 0UvplP45LUsgJSTDXCnrEA94TNgi+vDqovvyDu2ijOsyv5JHmg5adni6J7wB0C2Ed+xY xknb2IKuRTnSRmQN4jvcOY+ZlzGNrVoXtQyaeUcMunxnGf/yg8qNJCql0ug2Ay1tRBEZ rxNZ71PiWjBei7NsXSMt1CHcWwwZ+yUDX8DpdgUTFB/QFLA6+zfnaX/5imhQzsMuq10+ DeFJM8MJYM9aGVeqtwd0Bo6QhEq2dWvA8fzAYfPfbRM7t0PhJVJLxdbpIp4hV3cFPCQk N9mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="iQL7Y/Yw"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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. [208.118.235.17]) by mx.google.com with ESMTPS id m27si13579117qta.366.2018.12.25.13.21.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Dec 2018 13:21:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="iQL7Y/Yw"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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 ([127.0.0.1]:43256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu99-0003bm-Hx for patch@linaro.org; Tue, 25 Dec 2018 16:21:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbtmb-0006ST-5h for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:58:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtmZ-0000Oh-I3 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:58:32 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:44002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbtmY-0000NM-Ke for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:58:31 -0500 Received: by mail-pf1-x42d.google.com with SMTP id w73so7068947pfk.10 for ; Tue, 25 Dec 2018 12:58:30 -0800 (PST) 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=Sp+w7sUvhCyHvj3xdhW3ZNegFi+0b52HcJWEgQNBLWU=; b=iQL7Y/YwMPJm8aIV1rc8EXUgqveDN4l59sktjqe8p0f7qGp6nAl3I0DWtKVFShZSTN Bm8h5G9r4MXZWCNvUL7t5SVxvPBeJqj1Q6CL+ViJVsvxHUgdaOaANR3ilOjeFbigTwjr LLdFL7Iyl2JQ+FYzjLOyTsU8UnTMZU3Mi5++w= 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=Sp+w7sUvhCyHvj3xdhW3ZNegFi+0b52HcJWEgQNBLWU=; b=BnTEh0+6C5nTKGCrYXa19QNSknlzVu5smXXhPmjz90PPKCM5OMhuN7D2Kb1J/2zYl3 S9BvcQhfNp2hlJWGYAD1LDoBPeMYVnZNx3cUscZyETIQYqXpjnW2UPEm61nigO/5je0c 0CKAMLLniIgrE48Y5PZfQoo9KfBXn9M0CyIx9sXGbtUCkVh1/CoSNiuPhrz+GZ5mwTMP Yoe6NrMOsV9uh3Qpv3f0vPsIwDy6IfOZ4Ij+JlnbDx0dq0/Ife5NcaII625NumE73CbD X+/sh3aRFbpXWUgVmTbc5TQRSKifhg9bwAXYgw5Bwew+pX8taN13vOUxV6lT8xuUrW1q dLyQ== X-Gm-Message-State: AJcUukf9ghwrAVeBLLSIvpYUk9N+aW9Lk9gDUJaH4ioVYpkN4NJt5tp6 hDwcc91E13J1SjSuZlhD0ygiaYpB1Y4= X-Received: by 2002:a63:1d1d:: with SMTP id d29mr16790634pgd.49.1545771509196; Tue, 25 Dec 2018 12:58:29 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.58.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:58:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:09 +1100 Message-Id: <20181225205529.10874-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d Subject: [Qemu-devel] [PULL 22/42] disas: Add RISC-V support 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, Michael Clark , Alistair Francis Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Signed-off-by: Alistair Francis Signed-off-by: Michael Clark Reviewed-by: Richard Henderson Message-Id: Signed-off-by: Richard Henderson --- disas.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.17.2 diff --git a/disas.c b/disas.c index f9c517b358..d9aa713a40 100644 --- a/disas.c +++ b/disas.c @@ -522,8 +522,14 @@ void disas(FILE *out, void *code, unsigned long size) # ifdef _ARCH_PPC64 s.info.cap_mode = CS_MODE_64; # endif -#elif defined(__riscv__) - print_insn = print_insn_riscv; +#elif defined(__riscv) && defined(CONFIG_RISCV_DIS) +#if defined(_ILP32) || (__riscv_xlen == 32) + print_insn = print_insn_riscv32; +#elif defined(_LP64) + print_insn = print_insn_riscv64; +#else +#error unsupported RISC-V ABI +#endif #elif defined(__aarch64__) && defined(CONFIG_ARM_A64_DIS) print_insn = print_insn_arm_a64; s.info.cap_arch = CS_ARCH_ARM64;