File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
include/zephyr/arch/arm/mpu Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -419,9 +419,20 @@ typedef struct {
419419
420420#endif /* _ASMLANGUAGE */
421421
422+
423+ /* Some compilers do not handle casts on pointers in constant expressions */
424+ #if defined(__IAR_SYSTEMS_ICC__ )
425+ #define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
426+ BUILD_ASSERT( \
427+ (size > 0) && \
428+ ((size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0), \
429+ "The start and size of the partition must align with the minimum MPU " \
430+ "region size.")
431+ #else
422432#define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
423433 BUILD_ASSERT((size > 0) && \
424434 ((uint32_t)start % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0U) && \
425435 ((size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0), \
426436 "The start and size of the partition must align with the minimum MPU " \
427437 "region size.")
438+ #endif /* defined(__IAR_SYSTEMS_ICC__) */
Original file line number Diff line number Diff line change @@ -232,6 +232,16 @@ extern const struct nxp_mpu_config mpu_config;
232232
233233#endif /* _ASMLANGUAGE */
234234
235+ /* Some compilers do not handle casts on pointers in constant expressions */
236+ #if defined(__IAR_SYSTEMS_ICC__ )
237+ #define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
238+ BUILD_ASSERT( \
239+ (size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0 && \
240+ (size) >= CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE && \
241+ "The size of the partition must align with minimum MPU region size" \
242+ " and greater than or equal to minimum MPU region size.\n" \
243+ "The start address of the partition must align with minimum MPU region size.")
244+ #else
235245#define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
236246 BUILD_ASSERT( \
237247 (size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0 && \
@@ -240,5 +250,6 @@ extern const struct nxp_mpu_config mpu_config;
240250 "The size of the partition must align with minimum MPU region size" \
241251 " and greater than or equal to minimum MPU region size.\n" \
242252 "The start address of the partition must align with minimum MPU region size.")
253+ #endif
243254
244255#endif /* ZEPHYR_INCLUDE_ARCH_ARM_MPU_NXP_MPU_H_ */
You can’t perform that action at this time.
0 commit comments