[prev in list] [next in list] [prev in thread] [next in thread]
List: binutils
Subject: [PATCH] RISC-V: add new mconfigptr CSR
From: hasheddan via Binutils <binutils () sourceware ! org>
Date: 2021-12-30 23:03:32
Message-ID: 20211230230332.1160764-1-georgedanielmangum () gmail ! com
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic