mirror of
https://github.com/apache/nuttx.git
synced 2026-09-03 07:33:00 +00:00
arch/arm/armv7-a: Fix L1 page table entry double-offset in addrenv create region
In arm_addrenv_create_region(), the inner loop already advances vaddr by MM_PGSIZE for each mapped page, so after filling one L2 page table (i.e., ENTRIES_PER_L2TABLE pages), vaddr has naturally advanced to the start of the next 1MB section. The old code additionally added i * SECTION_SIZE, causing the L1 entry for the second and subsequent sections to skip one section each iteration—leaving virtual address holes in the mapping. Remove the redundant i * SECTION_SIZE offset so that the L1 entry tracks the vaddr already maintained by the inner loop, producing contiguous section mappings. Signed-off-by: leisiji <2265215145@qq.com>
This commit is contained in:
parent
ef4c8bc4b4
commit
c28bdaa3c9
1 changed files with 1 additions and 2 deletions
|
|
@ -107,8 +107,7 @@ int arm_addrenv_create_region(uintptr_t *l1table, unsigned int listlen,
|
|||
|
||||
DEBUGASSERT(MM_ISALIGNED(paddr));
|
||||
|
||||
mmu_l1table_setentry(l1table, paddr, vaddr + i * SECTION_SIZE,
|
||||
MMU_L1_PGTABFLAGS);
|
||||
mmu_l1table_setentry(l1table, paddr, vaddr, MMU_L1_PGTABFLAGS);
|
||||
|
||||
/* Get the virtual address corresponding to the physical page address */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue