mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-23 14:14:36 +08:00
bsps/arm: Fix for top of the address space
This commit is contained in:
committed by
Sebastian Huber
parent
691e0eff5d
commit
3923472555
@@ -24,6 +24,7 @@ static uint32_t set_translation_table_entries(
|
||||
uint32_t *ttb = arm_cp15_get_translation_table_base();
|
||||
uint32_t i = ARM_MMU_SECT_GET_INDEX(begin);
|
||||
uint32_t iend = ARM_MMU_SECT_GET_INDEX(ARM_MMU_SECT_MVA_ALIGN_UP(end));
|
||||
uint32_t index_mask = (1U << (32 - ARM_MMU_SECT_BASE_SHIFT)) - 1U;
|
||||
uint32_t ctrl;
|
||||
uint32_t section_flags_of_first_entry;
|
||||
|
||||
@@ -31,12 +32,12 @@ static uint32_t set_translation_table_entries(
|
||||
arm_cp15_tlb_invalidate();
|
||||
section_flags_of_first_entry = ttb [i];
|
||||
|
||||
while (i < iend) {
|
||||
while (i != iend) {
|
||||
uint32_t addr = i << ARM_MMU_SECT_BASE_SHIFT;
|
||||
|
||||
ttb [i] = addr | section_flags;
|
||||
|
||||
++i;
|
||||
i = (i + 1U) & index_mask;
|
||||
}
|
||||
|
||||
arm_cp15_set_control(ctrl);
|
||||
|
||||
@@ -62,11 +62,12 @@ arm_cp15_start_set_translation_table_entries(
|
||||
uint32_t i = ARM_MMU_SECT_GET_INDEX(config->begin);
|
||||
uint32_t iend =
|
||||
ARM_MMU_SECT_GET_INDEX(ARM_MMU_SECT_MVA_ALIGN_UP(config->end));
|
||||
uint32_t index_mask = (1U << (32 - ARM_MMU_SECT_BASE_SHIFT)) - 1U;
|
||||
|
||||
if (config->begin != config->end) {
|
||||
while (i < iend) {
|
||||
while (i != iend) {
|
||||
ttb [i] = (i << ARM_MMU_SECT_BASE_SHIFT) | config->flags;
|
||||
++i;
|
||||
i = (i + 1U) & index_mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user