1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
10 #include "riscv_test.h"
11 #include "test_macros.h"
17 #define sscratch mscratch
18 #define sstatus mstatus
22 #define stvec_handler mtvec_handler
24 #define SSTATUS_SPP MSTATUS_MPP
29 # This is the expected trap code.
30 li t1, CAUSE_USER_ECALL
33 # If running in M mode, use mstatus.MPP to check existence of U mode.
34 # Otherwise, if in S mode, then U mode must exist and we don't need to check.
41 # If U mode doesn't exist, mcause should indicate ECALL from M mode.
42 li t1, CAUSE_MACHINE_ECALL