Fix a typo in lib/alloc_phys.h and add documentation comments to all functions in lib/vmalloc.h Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> --- lib/alloc_phys.h | 2 +- lib/vmalloc.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/alloc_phys.h b/lib/alloc_phys.h index ea38f91..611aa70 100644 --- a/lib/alloc_phys.h +++ b/lib/alloc_phys.h @@ -39,7 +39,7 @@ extern void phys_alloc_show(void); /* * phys_alloc_get_unused allocates all remaining memory from the region * passed to phys_alloc_init, returning the newly allocated memory's base - * and top addresses. phys_allo_get_unused will still return base and top + * and top addresses. phys_alloc_get_unused will still return base and top * when no free memory is remaining, but base will equal top. */ extern void phys_alloc_get_unused(phys_addr_t *p_base, phys_addr_t *p_top); diff --git a/lib/vmalloc.h b/lib/vmalloc.h index 3658b80..2b563f4 100644 --- a/lib/vmalloc.h +++ b/lib/vmalloc.h @@ -3,15 +3,23 @@ #include <asm/page.h> +/* Allocate consecutive virtual pages (without backing) */ extern void *alloc_vpages(ulong nr); +/* Allocate one virtual page (without backing) */ extern void *alloc_vpage(void); +/* Set the top of the virtual address space */ extern void init_alloc_vpage(void *top); +/* Set up the virtual allocator; also sets up the page allocator if needed */ extern void setup_vm(void); +/* Set up paging */ extern void *setup_mmu(phys_addr_t top); +/* Walk the page table and resolve the virtual address to a physical address */ extern phys_addr_t virt_to_pte_phys(pgd_t *pgtable, void *virt); +/* Map the virtual address to the physical address for the given page tables */ extern pteval_t *install_page(pgd_t *pgtable, phys_addr_t phys, void *virt); +/* Map consecutive physical pages */ void *vmap(phys_addr_t phys, size_t size); #endif -- 2.26.2