diff options
-rw-r--r-- | machine/encoding.h | 11 | ||||
-rw-r--r-- | machine/minit.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/machine/encoding.h b/machine/encoding.h index b07d976..55f8461 100644 --- a/machine/encoding.h +++ b/machine/encoding.h @@ -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/machine/minit.c b/machine/minit.c index c584e9d..68c29ad 100644 --- a/machine/minit.c +++ b/machine/minit.c @@ -153,7 +153,7 @@ void enter_supervisor_mode(void (*fn)(uintptr_t), uintptr_t arg0, uintptr_t arg1 { // Set up a PMP to permit access to all of memory. // Ignore the illegal-instruction trap if PMPs aren't supported. - 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" |