mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
riscv/nuttsbi: add MTVAL argument
The MTVAL and the other two provides a complete exception story. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
@@ -30,8 +30,9 @@
|
|||||||
* Public Functions
|
* 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;
|
UNUSED(mcause);
|
||||||
(void) mepc;
|
UNUSED(mepc);
|
||||||
|
UNUSED(tval);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ machine_trap:
|
|||||||
|
|
||||||
csrr a0, CSR_MCAUSE /* Interrupt cause [arg0] */
|
csrr a0, CSR_MCAUSE /* Interrupt cause [arg0] */
|
||||||
csrr a1, CSR_MEPC /* Interrupt PC (instruction) [arg1] */
|
csrr a1, CSR_MEPC /* Interrupt PC (instruction) [arg1] */
|
||||||
|
csrr a2, CSR_MTVAL /* The MTVAL value [arg2] */
|
||||||
jal x1, sbi_mexception
|
jal x1, sbi_mexception
|
||||||
j __start
|
j __start
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user