Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kmm map #338

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/arm64/src/common/arm64_addrenv_pgmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ int up_addrenv_kmap_pages(void **pages, unsigned int npages, uintptr_t vaddr,

mask |= PTE_BLOCK_DESC_UXN;

/* Flags for normal memory region */

mask |= MMU_MT_NORMAL_FLAGS;

/* Let arm64_map_pages do the work */

return arm64_map_pages(addrenv, (uintptr_t *)pages, npages, vaddr, mask);
Expand Down
4 changes: 2 additions & 2 deletions mm/kmap/kmm_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static FAR void *map_pages(FAR void **pages, size_t npages, int prot)
errout_with_pgmap:
up_addrenv_kunmap_pages((uintptr_t)vaddr, npages);
errout_with_vaddr:
gran_free(&g_kmm_map_vpages, vaddr, size);
gran_free(g_kmm_map_vpages, vaddr, size);
return NULL;
}

Expand Down Expand Up @@ -385,7 +385,7 @@ void kmm_unmap(FAR void *kaddr)

/* Release the virtual memory area for use */

gran_free(&g_kmm_map_vpages, entry->vaddr, entry->length);
gran_free(g_kmm_map_vpages, entry->vaddr, entry->length);

/* Remove the mapping from the kernel mapping list */

Expand Down
Loading