From nobody Tue Feb 10 17:08:08 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550013007076216.88062974553168; Tue, 12 Feb 2019 15:10:07 -0800 (PST) Received: from localhost ([127.0.0.1]:47553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gthBf-00067q-0D for importer@patchew.org; Tue, 12 Feb 2019 18:09:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gthAM-0005NW-4w for qemu-devel@nongnu.org; Tue, 12 Feb 2019 18:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gthAL-0002sW-Bo for qemu-devel@nongnu.org; Tue, 12 Feb 2019 18:08:38 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:37070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gthAL-0002qb-4G for qemu-devel@nongnu.org; Tue, 12 Feb 2019 18:08:37 -0500 Received: by mail-pf1-x442.google.com with SMTP id s22so190999pfh.4 for ; Tue, 12 Feb 2019 15:08:35 -0800 (PST) Received: from rohan.sifive.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id y134sm4266708pfb.175.2019.02.12.15.08.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 15:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xf4bRx6j/bwpTEm7Vgnjf3FbAauofrWR7TzR9TjFWbc=; b=nWJMQvMoMMhFiLO8um+ZR41iNDdeD2y+K+gVK5/GC7ETupfSlmmkVXylY9uMVuylLi +1vktUlpyEVhJqzU/3tE9CmcSJ07H5AvEFGlJcWvyTddYowxxFj/NuGQO2Yb9VETa1fo xzItB/wiZ49zrxkfL8oSiByNwlI5dlrcnxD5PiIin/MRCmUNav9CQPm6B1Xo9arPD36q LDYQ0S4Ideuogzi+TNt6kRV+3aTha4+q+OMH3gKxshTDJPfYyrl5UP8X+PpRM77sYbok S/idJmEd4osJRanDykfcVfQpEEeMYfFYDMUtPySLJEyFGZMtOqH5PXKPtkGFrl6Hk80F bBgA== 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=xf4bRx6j/bwpTEm7Vgnjf3FbAauofrWR7TzR9TjFWbc=; b=Q211GuXQ8L38kZ5b+r/TsNDgxNHtZS9z59JMHpkj7GkGonnZginpZktSdif0CeuY4H 1DbTZJ4oRxRopvHqRp8LVxY6Td0tmdldw7h3TOWkSoX4RLpPEGkl/Z8AdMiYlVFY10On 16WRn22nAo/RTxmC3PB6YXSJrFnZer8BdfxSRI2OQ38LgOVid/CIh4KqRVvUOLS62MjN Dfd5EVw6x9eZPmpgpu9V+cw2Lx73WDDK+iUrJhyZDf42VxKX4iMnydPf2kE2HBvHtfzb Iwg2usC7rrcW/HApJL9UnQKrxI30XomVi18q8MGvdUOthxqB4EPz0sJw6H1I7wAUlodE ImoA== X-Gm-Message-State: AHQUAub3NZ+9XNvvlmfRMIEvwIyx7dH4CRjf5xysWtoj14cYmea/bxtj NSKtlhPlkouzIvb9PmTFF2/amnK/eu0= X-Google-Smtp-Source: AHgI3IahJCO5Na1/yw6g4yOpyE06a/qwU3uet80YiAPIN24gBqGej9uavvpqZFCmhvC3FcHWQAUfeg== X-Received: by 2002:a62:3603:: with SMTP id d3mr6571713pfa.146.1550012914586; Tue, 12 Feb 2019 15:08:34 -0800 (PST) From: Jim Wilson To: qemu-devel@nongnu.org Date: Tue, 12 Feb 2019 15:08:30 -0800 Message-Id: <20190212230830.9160-1-jimw@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH v4 3/5] RISC-V: Fixes to CSR_* register macros. 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: qemu-riscv@nongnu.org, Jim Wilson 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" This adds some missing CSR_* register macros, and documents some as being priv v1.9.1 specific. Signed-off-by: Jim Wilson Reviewed-by: Alistair Francis --- target/riscv/cpu_bits.h | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h index 5439f47..316d500 100644 --- a/target/riscv/cpu_bits.h +++ b/target/riscv/cpu_bits.h @@ -135,16 +135,22 @@ /* Legacy Counter Setup (priv v1.9.1) */ #define CSR_MUCOUNTEREN 0x320 #define CSR_MSCOUNTEREN 0x321 +#define CSR_MHCOUNTEREN 0x322 =20 /* Machine Trap Handling */ #define CSR_MSCRATCH 0x340 #define CSR_MEPC 0x341 #define CSR_MCAUSE 0x342 -#define CSR_MBADADDR 0x343 +#define CSR_MTVAL 0x343 #define CSR_MIP 0x344 =20 +/* Legacy Machine Trap Handling (priv v1.9.1) */ +#define CSR_MBADADDR 0x343 + /* Supervisor Trap Setup */ #define CSR_SSTATUS 0x100 +#define CSR_SEDELEG 0x102 +#define CSR_SIDELEG 0x103 #define CSR_SIE 0x104 #define CSR_STVEC 0x105 #define CSR_SCOUNTEREN 0x106 @@ -153,9 +159,12 @@ #define CSR_SSCRATCH 0x140 #define CSR_SEPC 0x141 #define CSR_SCAUSE 0x142 -#define CSR_SBADADDR 0x143 +#define CSR_STVAL 0x143 #define CSR_SIP 0x144 =20 +/* Legacy Supervisor Trap Handling (priv v1.9.1) */ +#define CSR_SBADADDR 0x143 + /* Supervisor Protection and Translation */ #define CSR_SPTBR 0x180 #define CSR_SATP 0x180 @@ -282,6 +291,28 @@ #define CSR_MHPMCOUNTER30H 0xb9e #define CSR_MHPMCOUNTER31H 0xb9f =20 +/* Legacy Hypervisor Trap Setup (priv v1.9.1) */ +#define CSR_HSTATUS 0x200 +#define CSR_HEDELEG 0x202 +#define CSR_HIDELEG 0x203 +#define CSR_HIE 0x204 +#define CSR_HTVEC 0x205 + +/* Legacy Hypervisor Trap Handling (priv v1.9.1) */ +#define CSR_HSCRATCH 0x240 +#define CSR_HEPC 0x241 +#define CSR_HCAUSE 0x242 +#define CSR_HBADADDR 0x243 +#define CSR_HIP 0x244 + +/* Legacy Machine Protection and Translation (priv v1.9.1) */ +#define CSR_MBASE 0x380 +#define CSR_MBOUND 0x381 +#define CSR_MIBASE 0x382 +#define CSR_MIBOUND 0x383 +#define CSR_MDBASE 0x384 +#define CSR_MDBOUND 0x385 + /* mstatus CSR bits */ #define MSTATUS_UIE 0x00000001 #define MSTATUS_SIE 0x00000002 --=20 2.7.4