riscv: Add option to print registers on exception
PATCH v2 1/1 riscv: Add option to print registers on exception
When debugging, it can be helpful to see more information about an unhandled exception. This patch adds an option to view the registers at the time of the trap, similar to the linux output on a kernel panic.
---
Changes for v2:
- Renamed "PC" to "EPC"
arch/riscv/Kconfig | 3 +++ arch/riscv/cpu/mtrap.S | 3 ++- arch/riscv/lib/interrupts.c | 50 +++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 12 deletions(-)
arch/riscv/Kconfig +3 -0
@@ -222,6 +222,9 @@ config XIP from a NOR flash memory without copying the code to ram. Say yes here if U-Boot boots from flash directly. +config SHOW_REGS + bool "Show registers on unhandled exception" + config STACK_SIZE_SHIFT int default 14
arch/riscv/cpu/mtrap.S +2 -1
@@ -64,7 +64,8 @@ trap_entry: SREG x31, 31 * REGBYTES(sp) csrr a0, MODE_PREFIX(cause) csrr a1, MODE_PREFIX(epc) - mv a2, sp + csrr a2, MODE_PREFIX(tval) + mv a3, sp jal handle_trap csrw MODE_PREFIX(epc), a0
arch/riscv/lib/interrupts.c +39 -11
84 lines not on this page · raw message
Signature · 1 line
2.24.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 riscv: Add option to print registers on exception
Quoted 9 lines
From: Sean Anderson [mailto:seanga2 at gmail.com]
Sent: Wednesday, December 25, 2019 1:28 PM
To: U-Boot Mailing List
Cc: Rick Jian-Zhi Chen(陳建志)
Subject: [PATCH v2] riscv: Add option to print registers on exceptionWhen debugging, it can be helpful to see more information about an unhandled exception. This patch adds an option to view the registers at the time of the trap, similar to the linux output on a kernel panic.
Signed-off-by Sean Anderson <[email protected]>
Quoted 9 lines
---
Changes for v2:
- Renamed "PC" to "EPC"arch/riscv/Kconfig | 3 +++ arch/riscv/cpu/mtrap.S | 3 ++- arch/riscv/lib/interrupts.c | 50 +++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 12 deletions(-)
PATCH v2 1/1 riscv: Add option to print registers on exception
In reply to Sean AndersonQuoted 6 lines · Sean Anderson
When debugging, it can be helpful to see more information about an unhandled exception. This patch adds an option to view the registers at the time of the trap, similar to the linux output on a kernel panic.
Signed-off-by Sean Anderson <[email protected]>
Quoted 9 lines
---
Changes for v2:
- Renamed "PC" to "EPC"arch/riscv/Kconfig | 3 +++ arch/riscv/cpu/mtrap.S | 3 ++- arch/riscv/lib/interrupts.c | 50 +++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 12 deletions(-)