[binutils-gdb] RISC-V: Correct legacy misa register number.

Jim Wilson wilson@sourceware.org
Tue Jul 17 16:42:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ce73f310150418a9a1625ab60a527d959096a9e2

commit ce73f310150418a9a1625ab60a527d959096a9e2
Author: Jim Wilson <jimw@sifive.com>
Date:   Tue Jul 17 09:42:23 2018 -0700

    RISC-V: Correct legacy misa register number.
    
    	gdb/
    	* riscv-tdep.h (DECLARE_CSR): Use RISCV_FIRST_CSR_REGNUM instead of
    	RISCV_LAST_FP_REGNUM + 1.
    	(RSICV_CSR_LEGACY_MISA_REGNUM): Add RISCV_FIRST_CSR_REGNUM.

Diff:
---
 gdb/ChangeLog    | 6 ++++++
 gdb/riscv-tdep.h | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6f5487c..ecf360f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-17  Jim Wilson  <jimw@sifive.com>
+
+	* riscv-tdep.h (DECLARE_CSR): Use RISCV_FIRST_CSR_REGNUM instead of
+	RISCV_LAST_FP_REGNUM + 1.
+	(RSICV_CSR_LEGACY_MISA_REGNUM): Add RISCV_FIRST_CSR_REGNUM.
+
 2018-07-17  Tom Tromey  <tom@tromey.com>
 
 	* configure.ac: Remove --disable-gdbcli.
diff --git a/gdb/riscv-tdep.h b/gdb/riscv-tdep.h
index ab5e278..4fc0597 100644
--- a/gdb/riscv-tdep.h
+++ b/gdb/riscv-tdep.h
@@ -39,11 +39,11 @@ enum
   RISCV_LAST_FP_REGNUM = 64,	/* Last Floating Point Register */
 
   RISCV_FIRST_CSR_REGNUM = 65,  /* First CSR */
-#define DECLARE_CSR(name, num) RISCV_ ## num ## _REGNUM = RISCV_LAST_FP_REGNUM + 1 + num,
+#define DECLARE_CSR(name, num) RISCV_ ## num ## _REGNUM = RISCV_FIRST_CSR_REGNUM + num,
 #include "opcode/riscv-opc.h"
 #undef DECLARE_CSR
   RISCV_LAST_CSR_REGNUM = 4160,
-  RISCV_CSR_LEGACY_MISA_REGNUM = 0xf10,
+  RISCV_CSR_LEGACY_MISA_REGNUM = 0xf10 + RISCV_FIRST_CSR_REGNUM,
 
   RISCV_PRIV_REGNUM = 4161,



More information about the Gdb-cvs mailing list