diff options
author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2020-06-22 18:21:38 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-22 13:48:50 -0400 |
commit | dee4223b46b90103b2fd953764e3e430802a9624 (patch) | |
tree | 27bdf7f683a7b246cc113ec502165472cf37c943 | |
parent | cde8415e148df178726a2d6913f4299dcaa65f11 (diff) | |
download | kvm-unit-tests-dee4223b46b90103b2fd953764e3e430802a9624.tar.gz |
lib: Fix a typo and add documentation comments
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@linux.ibm.com>
Message-Id: <20200622162141.279716-6-imbrenda@linux.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | lib/alloc_phys.h | 2 | ||||
-rw-r--r-- | lib/vmalloc.h | 8 |
2 files changed, 9 insertions, 1 deletions
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 |