summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/kgdb.h
diff options
context:
space:
mode:
authorVincent Chen <vincent.chen@sifive.com>2020-04-16 10:38:07 +0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-05-18 11:38:11 -0700
commitd96575709cc7056f34fdd5cdc16bcffe5bdb573d (patch)
tree73935f4d016aa0de26ce4276e2715ae84bd5c731 /arch/riscv/include/asm/kgdb.h
parentfe89bd2be8667d4d876329dd534dd59158e33b1f (diff)
riscv: Use the XML target descriptions to report 3 system registers
The $status, $badaddr, and $cause registers belong to the thread context, so KGDB can obtain their contents from pt_regs in each trap. However, the sequential number of these registers in the gdb register list is far from the general-purpose registers. If riscv port uses the existing method to report these three registers, many trivial registers with sequence numbers in the middle of them will also be packaged to the reply packets. To solve this problem, the riscv port wants to introduce the GDB target description mechanism to customize the reported register list. By the list, the KGDB can ignore the intermediate registers and just reports the general-purpose registers and these three system registers. Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/kgdb.h')
-rw-r--r--arch/riscv/include/asm/kgdb.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/riscv/include/asm/kgdb.h b/arch/riscv/include/asm/kgdb.h
index ce5a51bdd6a4..8177a457caff 100644
--- a/arch/riscv/include/asm/kgdb.h
+++ b/arch/riscv/include/asm/kgdb.h
@@ -7,7 +7,7 @@
#define GDB_SIZEOF_REG sizeof(unsigned long)
-#define DBG_MAX_REG_NUM (33)
+#define DBG_MAX_REG_NUM (36)
#define NUMREGBYTES ((DBG_MAX_REG_NUM) * GDB_SIZEOF_REG)
#define CACHE_FLUSH_IS_SAFE 1
#define BUFMAX 2048
@@ -65,6 +65,9 @@ static inline void arch_kgdb_breakpoint(void)
#define DBG_REG_T5 "t5"
#define DBG_REG_T6 "t6"
#define DBG_REG_EPC "pc"
+#define DBG_REG_STATUS "sstatus"
+#define DBG_REG_BADADDR "stval"
+#define DBG_REG_CAUSE "scause"
#define DBG_REG_ZERO_OFF 0
#define DBG_REG_RA_OFF 1
@@ -102,5 +105,8 @@ static inline void arch_kgdb_breakpoint(void)
#define DBG_REG_STATUS_OFF 33
#define DBG_REG_BADADDR_OFF 34
#define DBG_REG_CAUSE_OFF 35
+
+#include <asm/gdb_xml.h>
+
#endif
#endif