Skip to content

Commit bc8a4e4

Browse files
committed
riscv/nuttsbi: add MTVAL argument
The MTVAL and the other two provides a complete exception story. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent ed78646 commit bc8a4e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/risc-v/src/nuttsbi/sbi_mexception.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
* Public Functions
3131
****************************************************************************/
3232

33-
void sbi_mexception(uintptr_t mcause, uintptr_t *mepc)
33+
void sbi_mexception(uintreg_t mcause, uintreg_t *mepc, uintreg_t tval)
3434
{
35-
(void) mcause;
36-
(void) mepc;
35+
UNUSED(mcause);
36+
UNUSED(mepc);
37+
UNUSED(tval);
3738
}

arch/risc-v/src/nuttsbi/sbi_mtrap.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ machine_trap:
127127

128128
csrr a0, CSR_MCAUSE /* Interrupt cause [arg0] */
129129
csrr a1, CSR_MEPC /* Interrupt PC (instruction) [arg1] */
130+
csrr a2, CSR_MTVAL /* The MTVAL value [arg2] */
130131
jal x1, sbi_mexception
131132
j __start
132133

0 commit comments

Comments
 (0)