mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-23 21:38:55 -04:00
Fixed bug and tried to reset menvcfg to improve testing of csri in priv.
This commit is contained in:
parent
413a104b6c
commit
b4cfdf3393
1 changed files with 26 additions and 4 deletions
|
@ -56,16 +56,38 @@ sretdone:
|
|||
csrw satp, zero
|
||||
|
||||
# STIMECMP from S mode
|
||||
li t0, 1
|
||||
# 1st is when MENVCFG_STCE is cleared
|
||||
li a0, 3
|
||||
ecall # starts in M-mode
|
||||
csrw menvcfg, x0
|
||||
li a0, 1
|
||||
ecall # enter S-mode
|
||||
csrw stimecmp, zero
|
||||
li t0, 3
|
||||
li a0, 3
|
||||
ecall # return to M-mode
|
||||
csrsi mcounteren, 2 # mcounteren_tm = 1
|
||||
li t0, 1
|
||||
li a0, 1
|
||||
ecall # supervisor mode again
|
||||
csrw stimecmp, zero
|
||||
li t0, 3
|
||||
li a0, 3
|
||||
ecall # machine mode again
|
||||
|
||||
# STIMECMP from S mode
|
||||
# 2nd is when MENVCFG_STCE is set
|
||||
csrci mcounteren, 2 # mcounteren_tm = 0
|
||||
li t0, 1
|
||||
slli t0, t0, 63
|
||||
csrw menvcfg, t0
|
||||
li a0, 1
|
||||
ecall # enter S-mode
|
||||
csrw stimecmp, zero
|
||||
li a0, 3
|
||||
ecall # return to M-mode
|
||||
csrsi mcounteren, 2 # mcounteren_tm = 1
|
||||
li a0, 1
|
||||
ecall # supervisor mode again
|
||||
csrw stimecmp, zero
|
||||
li a0, 3
|
||||
ecall # machine mode again
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue