riscv64-nemu,cte: set PMP before entering S-mode

This commit is contained in:
Zihao Yu 2020-03-10 17:10:12 +08:00
parent c4bf428536
commit c297b3bce5
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ void __am_init_cte64() {
asm volatile("csrw mideleg, %0" : : "r"(0xffff));
asm volatile("csrw medeleg, %0" : : "r"(0xffff));
// set PMP to access all memory in S-mode
asm volatile("csrw pmpaddr0, %0" : : "r"(-1));
asm volatile("csrw pmpcfg0, %0" : : "r"(31));
init_timer();
// enter S-mode