From nobody Thu Oct 2 10:16:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545772985462222.8963038489519; Tue, 25 Dec 2018 13:23:05 -0800 (PST) Received: from localhost ([127.0.0.1]:43264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbuAK-0004qO-4Q for importer@patchew.org; Tue, 25 Dec 2018 16:23:04 -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) 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) 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-Google-Smtp-Source: ALg8bN7m7tALGh/tHBUP7LvIkJol5HFxwlx/1xwwgl9ubB4ldnwaypzuizVg7DNwXA3KozzGxKP0Pg== X-Received: by 2002:a63:1d1d:: with SMTP id d29mr16790634pgd.49.1545771509196; Tue, 25 Dec 2018 12:58:29 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 =3D CS_MODE_64; # endif -#elif defined(__riscv__) - print_insn =3D print_insn_riscv; +#elif defined(__riscv) && defined(CONFIG_RISCV_DIS) +#if defined(_ILP32) || (__riscv_xlen =3D=3D 32) + print_insn =3D print_insn_riscv32; +#elif defined(_LP64) + print_insn =3D print_insn_riscv64; +#else +#error unsupported RISC-V ABI +#endif #elif defined(__aarch64__) && defined(CONFIG_ARM_A64_DIS) print_insn =3D print_insn_arm_a64; s.info.cap_arch =3D CS_ARCH_ARM64; --=20 2.17.2