Skip to content

Commit dc63490

Browse files
authored
lib builder patch mmu_map.diff
1 parent 0ba0a20 commit dc63490

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/esp_mm/esp_mmu_map.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,19 @@ esp_err_t esp_mmu_map_reserve_block_with_caps(size_t size, mmu_mem_caps_t caps,
315315
s_mmu_ctx.mem_regions[found_region_id].max_slot_size -= aligned_size;
316316
ESP_EARLY_LOGV(TAG, "found laddr is 0x%x", laddr);
317317

318+
mem_block_t *mem_block = NULL;
319+
mem_region_t *region = &s_mmu_ctx.mem_regions[found_region_id];
320+
TAILQ_FOREACH(mem_block, &region->mem_block_head, entries) {
321+
if (mem_block == TAILQ_FIRST(&region->mem_block_head) || mem_block == TAILQ_LAST(&region->mem_block_head, mem_block_head_)) {
322+
TAILQ_REMOVE(&region->mem_block_head, mem_block, entries);
323+
} else {
324+
// probably the reservation of MMU region should be disallowed for this case - already some MMU mappings exist?
325+
// assert/abort
326+
ESP_EARLY_LOGE(TAG, "already some MMU mappings exist?");
327+
abort();
328+
}
329+
}
330+
318331
uint32_t vaddr = 0;
319332
if (caps & MMU_MEM_CAP_EXEC) {
320333
vaddr = mmu_ll_laddr_to_vaddr(laddr, MMU_VADDR_INSTRUCTION);

0 commit comments

Comments
 (0)