From c51c1a86518516200b2eb6ab7f5e8186b0aa8b1c Mon Sep 17 00:00:00 2001 From: Armando Date: Mon, 27 Jun 2022 18:50:19 +0800 Subject: [PATCH] mmu: fix wrong mmu entry id issue --- components/hal/mmu_hal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/hal/mmu_hal.c b/components/hal/mmu_hal.c index 5cfc8d79c1..44f095521c 100644 --- a/components/hal/mmu_hal.c +++ b/components/hal/mmu_hal.c @@ -91,12 +91,12 @@ void mmu_hal_map_region(uint32_t mmu_id, mmu_target_t mem_type, uint32_t vaddr, uint32_t mmu_val; //This is the physical address in the format that MMU supported *out_len = mmu_hal_pages_to_bytes(mmu_id, page_num); - entry_id = mmu_ll_get_entry_id(mmu_id, vaddr); mmu_val = mmu_ll_format_paddr(mmu_id, paddr); while (page_num) { + entry_id = mmu_ll_get_entry_id(mmu_id, vaddr); mmu_ll_write_entry(mmu_id, entry_id, mmu_val, mem_type); - entry_id++; + vaddr += page_size_in_bytes; mmu_val++; page_num--; }