mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-09 08:37:58 +08:00
cpu/armv7m: Avoid regions with negative size
Don't initialze regions that have a negative size (for example due to a wrong calculation). Update #4450
This commit is contained in:
1 parent
93f9645595
commit
5ad17be930
1 file changed
+1
-1
@@ -656,7 +656,7 @@ static inline void _ARMV7M_MPU_Set_region(
|
||||
RTEMS_OBFUSCATE_VARIABLE(end);
|
||||
size = (uintptr_t) end - (uintptr_t) begin;
|
||||
|
||||
if ( size > 0 ) {
|
||||
if ( (uintptr_t) end > (uintptr_t) begin ) {
|
||||
rbar = (uintptr_t) begin | region | ARMV7M_MPU_RBAR_VALID;
|
||||
rasr |= _ARMV7M_MPU_Get_region_size(size);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user