Set PMP to allow all user/supervisor accesses in WALLY-init-lib

This commit is contained in:
David Harris 2023-03-28 06:46:11 -07:00
parent 2e238c15aa
commit 4594dffc7f
2 changed files with 5 additions and 0 deletions

View File

@ -40,6 +40,10 @@ rvtest_entry_point:
la t0, topoftrapstack
csrw mscratch, t0 # MSCRATCH holds trap stack pointer
csrsi mstatus, 0x8 # Turn on mstatus.MIE global interrupt enable
# set up PMP so user and supervisor mode can access full address space
csrw pmpcfg0, 0xF # configure PMP0 to TOR RWX
li t0, 0xFFFFFFFF
csrw pmpaddr0, t0 # configure PMP0 top of range to 0xFFFFFFFF to allow all 32-bit addresses
j main # Call main function in user test program
done:

View File

@ -33,6 +33,7 @@ main:
ecall
# Test read to stimecmp fails when MCOUNTEREN_TM is not set
addi t0, zero, 0
csrr t0, stimecmp
j done