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 {
419
419
420
420
#endif /* _ASMLANGUAGE */
421
421
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
422
432
#define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
423
433
BUILD_ASSERT((size > 0) && \
424
434
((uint32_t)start % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0U) && \
425
435
((size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0), \
426
436
"The start and size of the partition must align with the minimum MPU " \
427
437
"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;
232
232
233
233
#endif /* _ASMLANGUAGE */
234
234
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
235
245
#define _ARCH_MEM_PARTITION_ALIGN_CHECK (start , size ) \
236
246
BUILD_ASSERT( \
237
247
(size) % CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE == 0 && \
@@ -240,5 +250,6 @@ extern const struct nxp_mpu_config mpu_config;
240
250
"The size of the partition must align with minimum MPU region size" \
241
251
" and greater than or equal to minimum MPU region size.\n" \
242
252
"The start address of the partition must align with minimum MPU region size.")
253
+ #endif
243
254
244
255
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_MPU_NXP_MPU_H_ */
You can’t perform that action at this time.
0 commit comments