diff options
-rw-r--r-- | encoding.h | 11 | ||||
-rw-r--r-- | p/riscv_test.h | 2 | ||||
-rw-r--r-- | v/vm.c | 2 |
3 files changed, 8 insertions, 7 deletions
@@ -127,13 +127,14 @@ #define PMP_R 0x01 #define PMP_W 0x02 #define PMP_X 0x04 -#define PMP_M 0x08 -#define PMP_NAPOT 0x10 -#define PMP_TOR 0x20 -#define PMP_EN 0x40 -#define PMP_LOCK 0x80 +#define PMP_A 0x18 +#define PMP_L 0x80 #define PMP_SHIFT 2 +#define PMP_TOR 0x08 +#define PMP_NA4 0x10 +#define PMP_NAPOT 0x18 + #define IRQ_S_SOFT 1 #define IRQ_H_SOFT 2 #define IRQ_M_SOFT 3 diff --git a/p/riscv_test.h b/p/riscv_test.h index 708bc4d..baad787 100644 --- a/p/riscv_test.h +++ b/p/riscv_test.h @@ -58,7 +58,7 @@ csrw mtvec, t0; \ li t0, -1; /* Set up a PMP to permit all accesses */ \ csrw pmpaddr0, t0; \ - li t0, PMP_EN | PMP_NAPOT | PMP_M | PMP_R | PMP_W | PMP_X; \ + li t0, PMP_NAPOT | PMP_R | PMP_W | PMP_X; \ csrw pmpcfg0, t0; \ .align 2; \ 1: @@ -234,7 +234,7 @@ void vm_boot(uintptr_t test_addr) (vm_choice * (SPTBR_MODE & ~(SPTBR_MODE<<1)))); // Set up PMPs if present, ignoring illegal instruction trap if not. - uintptr_t pmpc = PMP_EN | PMP_NAPOT | PMP_M | PMP_R | PMP_W | PMP_X; + uintptr_t pmpc = PMP_NAPOT | PMP_R | PMP_W | PMP_X; asm volatile ("la t0, 1f\n\t" "csrrw t0, mtvec, t0\n\t" "csrw pmpaddr0, %1\n\t" |