Skip to content

Commit

Permalink
riscv/nuttsbi: add MTVAL argument
Browse files Browse the repository at this point in the history
The MTVAL and the other two provides a complete exception story.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 committed Jun 23, 2024
1 parent ed78646 commit bc8a4e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/risc-v/src/nuttsbi/sbi_mexception.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
* Public Functions
****************************************************************************/

void sbi_mexception(uintptr_t mcause, uintptr_t *mepc)
void sbi_mexception(uintreg_t mcause, uintreg_t *mepc, uintreg_t tval)
{
(void) mcause;
(void) mepc;
UNUSED(mcause);
UNUSED(mepc);
UNUSED(tval);
}
1 change: 1 addition & 0 deletions arch/risc-v/src/nuttsbi/sbi_mtrap.S
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ machine_trap:

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

Expand Down

0 comments on commit bc8a4e4

Please sign in to comment.