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:
Michael Jung 2022-10-20 12:55:42 +02:00 committed by Alan Carvalho de Assis
parent d4cbb4f5b8
commit ec3805721c
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ void mpu_configure_region(uintptr_t base, size_t size,
* 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;
/* Select the region */