From: hasheddan <georgedanielmangum@gmail.com>
To: binutils@sourceware.org
Cc: georgedanielmangum@gmail.com, palmer@dabbelt.com,
andrew@sifive.com, nelson.chu@sifive.com,
jim.wilson.gcc@gmail.com
Subject: [PATCH] RISC-V: add new mconfigptr CSR
Date: Thu, 30 Dec 2021 18:03:32 -0500 [thread overview]
Message-ID: <20211230230332.1160764-1-georgedanielmangum@gmail.com> (raw)
Adds the new mconfigptr CSR, which, if non-zero, holds the physical
address of a configuration data structure.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
---
gas/testsuite/gas/riscv/csr-version-1p10.d | 2 ++
gas/testsuite/gas/riscv/csr-version-1p10.l | 3 +++
gas/testsuite/gas/riscv/csr-version-1p11.d | 2 ++
gas/testsuite/gas/riscv/csr-version-1p11.l | 3 +++
gas/testsuite/gas/riscv/csr-version-1p12.d | 2 ++
gas/testsuite/gas/riscv/csr-version-1p12.l | 1 +
gas/testsuite/gas/riscv/csr-version-1p9p1.d | 2 ++
gas/testsuite/gas/riscv/csr-version-1p9p1.l | 3 +++
gas/testsuite/gas/riscv/csr.s | 1 +
include/opcode/riscv-opc.h | 2 ++
10 files changed, 21 insertions(+)
diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.d b/gas/testsuite/gas/riscv/csr-version-1p10.d
index ee56ae31f0c..af3d498630d 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p10.d
+++ b/gas/testsuite/gas/riscv/csr-version-1p10.d
@@ -185,6 +185,8 @@ Disassembly of section .text:
[ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1
[ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid
[ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1
+[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15
+[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1
[ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus
[ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1
[ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa
diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.l b/gas/testsuite/gas/riscv/csr-version-1p10.l
index ed6773e637c..cbeef8d2941 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p10.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p10.l
@@ -131,6 +131,9 @@
.*Warning: read-only CSR is written `csrw marchid,a1'
.*Warning: read-only CSR is written `csrw mimpid,a1'
.*Warning: read-only CSR is written `csrw mhartid,a1'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.10'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.10'
+.*Warning: read-only CSR is written `csrw mconfigptr,a1'
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg3' for the current ISA
diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.d b/gas/testsuite/gas/riscv/csr-version-1p11.d
index a1d8169d7f7..4971b9f3ba0 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p11.d
+++ b/gas/testsuite/gas/riscv/csr-version-1p11.d
@@ -185,6 +185,8 @@ Disassembly of section .text:
[ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1
[ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid
[ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1
+[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15
+[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1
[ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus
[ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1
[ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa
diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.l b/gas/testsuite/gas/riscv/csr-version-1p11.l
index 44d9611fe49..73c34c6582e 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p11.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p11.l
@@ -131,6 +131,9 @@
.*Warning: read-only CSR is written `csrw marchid,a1'
.*Warning: read-only CSR is written `csrw mimpid,a1'
.*Warning: read-only CSR is written `csrw mhartid,a1'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.11'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.11'
+.*Warning: read-only CSR is written `csrw mconfigptr,a1'
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg3' for the current ISA
diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.d b/gas/testsuite/gas/riscv/csr-version-1p12.d
index c4c211829b2..2bf8429515c 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p12.d
+++ b/gas/testsuite/gas/riscv/csr-version-1p12.d
@@ -185,6 +185,8 @@ Disassembly of section .text:
[ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1
[ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid
[ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1
+[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,mconfigptr
+[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+mconfigptr,a1
[ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus
[ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1
[ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa
diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.l b/gas/testsuite/gas/riscv/csr-version-1p12.l
index 237cb8a1699..82103d0e7e7 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p12.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p12.l
@@ -131,6 +131,7 @@
.*Warning: read-only CSR is written `csrw marchid,a1'
.*Warning: read-only CSR is written `csrw mimpid,a1'
.*Warning: read-only CSR is written `csrw mhartid,a1'
+.*Warning: read-only CSR is written `csrw mconfigptr,a1'
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg1' for the current ISA
.*Warning: invalid CSR `pmpcfg3' for the current ISA
diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.d b/gas/testsuite/gas/riscv/csr-version-1p9p1.d
index 01e05ae4fbc..ffec248e527 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p9p1.d
+++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.d
@@ -185,6 +185,8 @@ Disassembly of section .text:
[ ]+[0-9a-f]+:[ ]+f1359073[ ]+csrw[ ]+mimpid,a1
[ ]+[0-9a-f]+:[ ]+f1402573[ ]+csrr[ ]+a0,mhartid
[ ]+[0-9a-f]+:[ ]+f1459073[ ]+csrw[ ]+mhartid,a1
+[ ]+[0-9a-f]+:[ ]+f1502573[ ]+csrr[ ]+a0,0xf15
+[ ]+[0-9a-f]+:[ ]+f1559073[ ]+csrw[ ]+0xf15,a1
[ ]+[0-9a-f]+:[ ]+30002573[ ]+csrr[ ]+a0,mstatus
[ ]+[0-9a-f]+:[ ]+30059073[ ]+csrw[ ]+mstatus,a1
[ ]+[0-9a-f]+:[ ]+30102573[ ]+csrr[ ]+a0,misa
diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.l b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
index 00d46f509de..62c560f5e91 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p9p1.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
@@ -139,6 +139,9 @@
.*Warning: read-only CSR is written `csrw marchid,a1'
.*Warning: read-only CSR is written `csrw mimpid,a1'
.*Warning: read-only CSR is written `csrw mhartid,a1'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `mconfigptr' for the privileged spec `1.9.1'
+.*Warning: read-only CSR is written `csrw mconfigptr,a1'
.*Warning: invalid CSR `mcounteren' for the privileged spec `1.9.1'
.*Warning: invalid CSR `mcounteren' for the privileged spec `1.9.1'
.*Warning: invalid CSR `mtval' for the privileged spec `1.9.1'
diff --git a/gas/testsuite/gas/riscv/csr.s b/gas/testsuite/gas/riscv/csr.s
index 568328d70d9..e269868f2c5 100644
--- a/gas/testsuite/gas/riscv/csr.s
+++ b/gas/testsuite/gas/riscv/csr.s
@@ -106,6 +106,7 @@
csr marchid
csr mimpid
csr mhartid
+ csr mconfigptr # Added in 1.12
# Machine Trap Setup
csr mstatus
diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h
index 6ca2f8d9309..0accbf92916 100644
--- a/include/opcode/riscv-opc.h
+++ b/include/opcode/riscv-opc.h
@@ -2118,6 +2118,7 @@
#define CSR_MARCHID 0xf12
#define CSR_MIMPID 0xf13
#define CSR_MHARTID 0xf14
+#define CSR_MCONFIGPTR 0xf15
#define CSR_MSTATUS 0x300
#define CSR_MISA 0x301
#define CSR_MEDELEG 0x302
@@ -2719,6 +2720,7 @@ DECLARE_CSR(mvendorid, CSR_MVENDORID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_S
DECLARE_CSR(marchid, CSR_MARCHID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
DECLARE_CSR(mimpid, CSR_MIMPID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
DECLARE_CSR(mhartid, CSR_MHARTID, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
+DECLARE_CSR(mconfigptr, CSR_MCONFIGPTR, CSR_CLASS_I, PRIV_SPEC_CLASS_1P12, PRIV_SPEC_CLASS_DRAFT)
DECLARE_CSR(mstatus, CSR_MSTATUS, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
DECLARE_CSR(misa, CSR_MISA, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
DECLARE_CSR(medeleg, CSR_MEDELEG, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
--
2.25.1
reply other threads:[~2021-12-30 23:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211230230332.1160764-1-georgedanielmangum@gmail.com \
--to=georgedanielmangum@gmail.com \
--cc=andrew@sifive.com \
--cc=binutils@sourceware.org \
--cc=jim.wilson.gcc@gmail.com \
--cc=nelson.chu@sifive.com \
--cc=palmer@dabbelt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).