aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/common/ARMCMx/mpu_v7m.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-04-23 06:53:43 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-04-23 06:53:43 +0000
commitceba105275ca7d43a7c425f25787423ea3c90c4c (patch)
tree531590c85a49aa542d7cc7c4ba7fd3251c8b6c0d /os/hal/ports/common/ARMCMx/mpu_v7m.h
parenta7ce9444af2bcd30e0255c712fbab3dba1a82305 (diff)
downloadChibiOS-ceba105275ca7d43a7c425f25787423ea3c90c4c.tar.gz
ChibiOS-ceba105275ca7d43a7c425f25787423ea3c90c4c.tar.bz2
ChibiOS-ceba105275ca7d43a7c425f25787423ea3c90c4c.zip
Fixed bug #1027.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_19.1.x@12753 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
Diffstat (limited to 'os/hal/ports/common/ARMCMx/mpu_v7m.h')
-rw-r--r--os/hal/ports/common/ARMCMx/mpu_v7m.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/os/hal/ports/common/ARMCMx/mpu_v7m.h b/os/hal/ports/common/ARMCMx/mpu_v7m.h
index 48954c95c..11e691aab 100644
--- a/os/hal/ports/common/ARMCMx/mpu_v7m.h
+++ b/os/hal/ports/common/ARMCMx/mpu_v7m.h
@@ -196,6 +196,20 @@
MPU->RASR = ((uint32_t)attribs); \
}
+/**
+ * @brief Changes an MPU region base address.
+ *
+ * @param[in] region the region number
+ * @param[in] address start address of the region, note, there are alignment
+ * constraints
+ *
+ * @api
+ */
+#define mpuSetRegionAddress(region, addr) { \
+ MPU->RNR = ((uint32_t)region); \
+ MPU->RBAR = ((uint32_t)addr); \
+}
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/