Skip to content

Commit

Permalink
arch: arc: small optimization in mpu driver
Browse files Browse the repository at this point in the history
to avoid _get_num_regions to access the aux
reg each time in the for loop

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information
Wayne Ren authored and nashif committed Aug 22, 2018
1 parent eab5ff7 commit 506f21b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/arc/core/mpu/arc_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ void arc_core_mpu_enable(void)
* simulate MPU enable
*/
#elif CONFIG_ARC_MPU_VER == 3
arc_core_mpu_default(0);
#define MPU_ENABLE_ATTR 0
arc_core_mpu_default(MPU_ENABLE_ATTR);
#endif
}

Expand Down Expand Up @@ -506,7 +507,8 @@ void arc_core_mpu_configure_mem_domain(struct k_mem_domain *mem_domain)
* it doesn't work for memory domain, because the dynamic region numbers.
* So be careful to avoid the overlap situation.
*/
for (; region_index < _get_num_regions() - 1; region_index++) {
u32_t num_regions = _get_num_regions() - 1;
for (; region_index < num_regions; region_index++) {
#endif
if (num_partitions && pparts->size) {
SYS_LOG_DBG("set region 0x%x 0x%x 0x%x",
Expand Down

0 comments on commit 506f21b

Please sign in to comment.