arch: arc: enable MPU_REQUIRES_NON_OVERLAPPING_REGIONS for arc mpu ver 3

arc mpu ver3 does not allow mpu region overlap, so need to enable
MPU_REQUIRES_NON_OVERLAPPING_REGIONS.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
This commit is contained in:
Wayne Ren 2019-11-28 16:27:59 +08:00 committed by Johan Hedberg
commit 85f591e866
2 changed files with 2 additions and 2 deletions

View file

@ -29,5 +29,6 @@ config ARC_MPU
select THREAD_STACK_INFO
select MEMORY_PROTECTION
select MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT if ARC_MPU_VER = 2
select MPU_REQUIRES_NON_OVERLAPPING_REGIONS if ARC_MPU_VER = 3
help
Target has ARC MPU (currently only works for EMSK 2.2/2.3 ARCEM7D)

View file

@ -188,8 +188,7 @@ extern "C" {
#define K_MEM_PARTITION_IS_WRITABLE(attr) \
({ \
int __is_writable__; \
attr &= (AUX_MPU_ATTR_UW | AUX_MPU_ATTR_KW); \
switch (attr) { \
switch (attr & (AUX_MPU_ATTR_UW | AUX_MPU_ATTR_KW)) { \
case (AUX_MPU_ATTR_UW | AUX_MPU_ATTR_KW): \
case AUX_MPU_ATTR_UW: \
case AUX_MPU_ATTR_KW: \