Make JALR test sensible in RISC-V, rather than SMIPS
[riscv-tests.git] / isa / rv64si / wfi.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # wfi.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test wait-for-interrupt instruction.
8 #
9
10 #include "riscv_test.h"
11 #include "test_macros.h"
12
13 RVTEST_RV64S
14 RVTEST_CODE_BEGIN
15
16 #ifdef __MACHINE_MODE
17 #define sstatus mstatus
18 #define sie mie
19 #define sip mip
20 #undef MIP_SSIP
21 #define MIP_SSIP MIP_MSIP
22 #undef SSTATUS_SIE
23 #define SSTATUS_SIE MSTATUS_MIE
24 #endif
25
26 # Make sure wfi doesn't stall if an interrupt is pending
27 csrc sstatus, SSTATUS_SIE
28 csrs sie, MIP_SSIP
29 csrs sip, MIP_SSIP
30 wfi
31
32 RVTEST_PASS
33
34 TEST_PASSFAIL
35
36 RVTEST_CODE_END
37
38 .data
39 RVTEST_DATA_BEGIN
40
41 TEST_DATA
42
43 RVTEST_DATA_END