Skip to content

Commit

Permalink
Setup PMP config
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Sep 18, 2021
1 parent 5fbf997 commit 039d627
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions kernel/kern/init.S
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,21 @@ mtvec_done:
sfence.vma
#endif

// 设置 PMP Config
#ifdef RV32
// 0x00000000-0xffffffff RWX
li t0, 0b00001111
csrw pmpcfg0, t0
li t0, 0xffffffff
csrw pmpaddr0, t0
#else
// 0x0000000000000000-0xffffffffffffffff RWX
li t0, 0b00001111
csrw pmpcfg0, t0
li t0, 0xffffffffffffffff
csrw pmpaddr0, t0
#endif

j WELCOME // 进入主线程

WELCOME:
Expand Down

0 comments on commit 039d627

Please sign in to comment.