From f06d29ca9da724866ae99ee2225d53f382d32bcd Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 25 Nov 2020 12:23:11 -0700 Subject: Add priv.h/c to allow switching to user mode. Change some things with the MPU in main() to actually work. --- include/kern/mpu/mpu_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/kern/mpu/mpu_manager.h') diff --git a/include/kern/mpu/mpu_manager.h b/include/kern/mpu/mpu_manager.h index 5e0bc7b..7c47722 100644 --- a/include/kern/mpu/mpu_manager.h +++ b/include/kern/mpu/mpu_manager.h @@ -34,14 +34,14 @@ typedef enum { REGION_SIZE_4Gb = 31, } region_size_t; -#define region_size_mask(region_size) ((1 << (region_size)) - 1) +#define region_size_mask(region_size) ((1 << (region_size + 1)) - 1) typedef enum { /* Neither Privileged nor non-Privileged code cannnot access this region */ ACCESS_PERMS_NO_ACCESS = 0, /* Only privileged users can access this memory. */ - ACCESS_PERMS_ONLY_PERMS = 1, + ACCESS_PERMS_ONLY_PRIV = 1, /* Privileged code can access fully, but non-privilege only has Read-only access.*/ -- cgit