Skip to content

Commit

Permalink
lib: system: MPU flag check fix for xilinx platform
Browse files Browse the repository at this point in the history
Check if valid MPU flag is set or not. Current condition checks
if flag is 0 or not, which is not intended use of flags

Signed-off-by: Rajiv Mohan <rajiv.mohan@amd.com>
  • Loading branch information
rajimoha authored and arnopo committed Feb 23, 2024
1 parent f21fea6 commit 5bab722
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/system/freertos/xlnx/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void *metal_machine_io_mem_map_versal_net(void *va, metal_phys_addr_t pa,

for (cnt = 0; cnt < MAX_POSSIBLE_MPU_REGS; cnt++) {

if (!mpu_config[cnt].flags & XMPU_VALID_REGION)
if (!(mpu_config[cnt].flags & XMPU_VALID_REGION))
continue;

base_end_addr = mpu_config[cnt].Size + mpu_config[cnt].BaseAddress;
Expand Down
2 changes: 1 addition & 1 deletion lib/system/generic/xlnx/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void *metal_machine_io_mem_map_versal_net(void *va, metal_phys_addr_t pa,

for (cnt = 0; cnt < MAX_POSSIBLE_MPU_REGS; cnt++) {

if (!mpu_config[cnt].flags & XMPU_VALID_REGION)
if (!(mpu_config[cnt].flags & XMPU_VALID_REGION))
continue;

base_end_addr = mpu_config[cnt].Size + mpu_config[cnt].BaseAddress;
Expand Down

0 comments on commit 5bab722

Please sign in to comment.