aboutsummaryrefslogtreecommitdiff
path: root/include/kern/mpu/mpu_manager.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-25 15:47:02 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-25 15:47:02 -0700
commit6d22b0dfc7761a605758552d5824f8039ac5a00f (patch)
treede0cd4848c02b787d45b41afaca244606eceab5d /include/kern/mpu/mpu_manager.h
parentb07c6f6a9d926d4eac726b94963e479839382675 (diff)
downloadstm32l4-6d22b0dfc7761a605758552d5824f8039ac5a00f.tar.gz
stm32l4-6d22b0dfc7761a605758552d5824f8039ac5a00f.tar.bz2
stm32l4-6d22b0dfc7761a605758552d5824f8039ac5a00f.zip
Primitive ability to call kernel code from userspace.
Diffstat (limited to 'include/kern/mpu/mpu_manager.h')
-rw-r--r--include/kern/mpu/mpu_manager.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/kern/mpu/mpu_manager.h b/include/kern/mpu/mpu_manager.h
index 7c47722..5a0904c 100644
--- a/include/kern/mpu/mpu_manager.h
+++ b/include/kern/mpu/mpu_manager.h
@@ -55,7 +55,7 @@ typedef enum {
/* Both privileged and non-privileged users can access this memory, but only
as Read-only.*/
- ACCESS_PERMS_BOTH_RO = 5,
+ ACCESS_PERMS_BOTH_RO = 6,
} access_perms_t;
typedef struct {
@@ -81,4 +81,28 @@ void mpu_set_enabled(bool enabled);
*/
void mpu_configure_region(int region_number, memory_region_opts_t* opts);
+typedef enum {
+ PRIVILEGED,
+ NOT_PRIVILEGED,
+} privilege_t;
+
+
+/** Configure a peripheral region with default peripheral attributes. */
+void configure_peripheral_region(
+ void* peripheral_base,
+ region_size_t region_size,
+ privilege_t priv);
+
+/** Configure a flash region with default flash attributes. */
+void configure_flash_region(
+ void* flash_base,
+ region_size_t region_size,
+ privilege_t priv);
+
+/** Configure a ram region with default ram attributes. */
+void configure_ram_region(
+ void* ram_base,
+ region_size_t region_size,
+ privilege_t priv);
+
#endif /* KERN_MPU_MPU_MANAGER_H_ */