Configure PMP at boot
This commit is contained in:
parent
6de0381d61
commit
9655f71758
2 changed files with 17 additions and 0 deletions
|
|
@ -181,6 +181,18 @@ w_mtvec(uint64 x)
|
|||
asm volatile("csrw mtvec, %0" : : "r" (x));
|
||||
}
|
||||
|
||||
static inline void
|
||||
w_pmpcfg0(uint64 x)
|
||||
{
|
||||
asm volatile("csrw pmpcfg0, %0" : : "r" (x));
|
||||
}
|
||||
|
||||
static inline void
|
||||
w_pmpaddr0(uint64 x)
|
||||
{
|
||||
asm volatile("csrw pmpaddr0, %0" : : "r" (x));
|
||||
}
|
||||
|
||||
// use riscv's sv39 page table scheme.
|
||||
#define SATP_SV39 (8L << 60)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue