mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
armv8-m: Fix MPU Region Limit Address config
On armv8-m the MPU region limits are inclusive. Thus, we must substract one byte of size from (base + limit). Signed-off-by: Michael Jung <michael.jung@secore.ly>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
d4cbb4f5b8
commit
ec3805721c
@@ -163,7 +163,7 @@ void mpu_configure_region(uintptr_t base, size_t size,
|
|||||||
* aligns with the size of the selected region."
|
* aligns with the size of the selected region."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
limit = (base + size) & MPU_RLAR_LIMIT_MASK;
|
limit = (base + size - 1) & MPU_RLAR_LIMIT_MASK;
|
||||||
base &= MPU_RBAR_BASE_MASK;
|
base &= MPU_RBAR_BASE_MASK;
|
||||||
|
|
||||||
/* Select the region */
|
/* Select the region */
|
||||||
|
|||||||
Reference in New Issue
Block a user