1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
7 # Test timer interrupts.
10 #include "riscv_test.h"
11 #include "test_macros.h"
17 #define sscratch mscratch
18 #define sstatus mstatus
21 #define stvec_handler mtvec_handler
23 #define SSTATUS_PS MSTATUS_PRV1
25 #define SSTATUS_IE MSTATUS_IE
27 #define SSTATUS_TIE MSTATUS_STIE
30 li s8, 0 # number of taken timer interrupts
31 li s9, 10 # how many interrupts to run for
34 li a0, SSTATUS_IE | SSTATUS_TIE
45 # advance an LFSR 1000 times
58 # make sure the LFSR was computed correctly
78 addi t0, t0, -2*IRQ_TIMER
86 bltu s8, s9, stvec_return
90 csrc sstatus, SSTATUS_IE