diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-25 12:23:11 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-25 12:25:05 -0700 |
commit | f06d29ca9da724866ae99ee2225d53f382d32bcd (patch) | |
tree | fbec7a13e7e05654898116037d7506637aa0ebff /include/kern/mpu/mpu_manager.h | |
parent | d7d50cc81f72d1275140d7a15c52b6f9e272896f (diff) | |
download | stm32l4-f06d29ca9da724866ae99ee2225d53f382d32bcd.tar.gz stm32l4-f06d29ca9da724866ae99ee2225d53f382d32bcd.tar.bz2 stm32l4-f06d29ca9da724866ae99ee2225d53f382d32bcd.zip |
Add priv.h/c to allow switching to user mode. Change some things with the MPU in main() to actually work.
Diffstat (limited to 'include/kern/mpu/mpu_manager.h')
-rw-r--r-- | include/kern/mpu/mpu_manager.h | 4 |
1 files changed, 2 insertions, 2 deletions
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.*/ |