summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/armv7-m
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-11 17:51:42 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-11 17:51:42 +0000
commit3578c60ae17a31fef6486ba5c3a2f97b899fb243 (patch)
tree69156c78a6928e337491e60e93b707b1bf362c97 /nuttx/arch/arm/src/armv7-m
parent065661cbab0d8ca6f3739c02d0536de3de362402 (diff)
downloadpx4-nuttx-3578c60ae17a31fef6486ba5c3a2f97b899fb243.tar.gz
px4-nuttx-3578c60ae17a31fef6486ba5c3a2f97b899fb243.tar.bz2
px4-nuttx-3578c60ae17a31fef6486ba5c3a2f97b899fb243.zip
Add MPU support for the LPC17xx family
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5731 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/armv7-m')
-rw-r--r--nuttx/arch/arm/src/armv7-m/up_mpu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/armv7-m/up_mpu.c b/nuttx/arch/arm/src/armv7-m/up_mpu.c
index d4b04a444..2b8a8f994 100644
--- a/nuttx/arch/arm/src/armv7-m/up_mpu.c
+++ b/nuttx/arch/arm/src/armv7-m/up_mpu.c
@@ -48,6 +48,11 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* Configuration ************************************************************/
+
+#ifndef CONFIG_ARMV7M_MPU_NREGIONS
+# define CONFIG_ARMV7M_MPU_NREGIONS 8
+#endif
/****************************************************************************
* Private Data
@@ -84,13 +89,14 @@ static uint8_t g_region;
*
* Assumptions:
* - Regions are never deallocated
- * - Regions are only allocated early in initialization, so nothing
- * special is require;
+ * - Regions are only allocated early in initialization, so no special
+ * protection against re-entrancy is required;
*
****************************************************************************/
unsigned int mpu_allocregion(void)
{
+ DEBUGASSERT(g_region < CONFIG_ARMV7M_MPU_NREGIONS);
return (unsigned int)g_region++;
}