summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h')
-rw-r--r--cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h b/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h
index 47b034813c..36541a97aa 100644
--- a/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h
+++ b/cpukit/score/cpu/arm/include/rtems/score/aarch32-pmsa.h
@@ -10,7 +10,7 @@
*/
/*
- * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2020 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -278,6 +278,33 @@ typedef struct {
} AArch32_PMSA_Section;
/**
+ * @brief The region definition is used to configure the Memory Protection
+ * Unit (MPU).
+ *
+ * A region cannot be empty.
+ */
+typedef struct {
+ /**
+ * @brief This member defines the base address of the region.
+ *
+ * The limit address is this the address of the first byte of the region.
+ */
+ uint32_t base;
+
+ /**
+ * @brief This member defines the limit address of the region.
+ *
+ * The limit address is this the address of the last byte of the region.
+ */
+ uint32_t limit;
+
+ /**
+ * @brief This member defines the attributes of the region.
+ */
+ uint32_t attributes;
+} AArch32_PMSA_Region;
+
+/**
* @brief Initializes the Memory Protection Unit (MPU).
*
* The section definitions are used to define the regions of the MPU. Sections
@@ -285,6 +312,8 @@ typedef struct {
* regions are used, then the MPU is not enabled. Overlapping section
* definitions result in undefined system behaviour.
*
+ * The function shall be called while the MPU is disabled.
+ *
* @param memory_attributes_0 are the memory attributes for MAIR0.
*
* @param memory_attributes_1 are the memory attributes for MAIR1.
@@ -301,6 +330,31 @@ void _AArch32_PMSA_Initialize(
);
/**
+ * @brief Maps the section definitions to region definitions.
+ *
+ * The section definitions are used to define the regions of the MPU. Sections
+ * are merged if possible to reduce the count of used regions. If too many
+ * regions are used, then zero is returned. Overlapping section definitions
+ * result in undefined system behaviour.
+ *
+ * @param sections is the array with section definitions to map to regions.
+ *
+ * @param section_count is the count of section definitions.
+ *
+ * @param regions is the array with usable region definitions.
+ *
+ * @param region_max is the count of usable region definitions.
+ *
+ * @return Returns the count of actually used regions.
+ */
+size_t _AArch32_PMSA_Map_sections_to_regions(
+ const AArch32_PMSA_Section *sections,
+ size_t section_count,
+ AArch32_PMSA_Region *regions,
+ size_t region_max
+);
+
+/**
* @brief This array provides section definitions to initialize the memory
* protection unit (MPU).
*