Merge branch 'riscv64-pmp' into 'master'

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

See merge request projectn/nexus-am!33
This commit is contained in:
Zihao Yu 2020-03-10 17:11:41 +08:00
commit ee66350b06
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