1 #ifndef VMALLOC_H 2 #define VMALLOC_H 1 3 4 #include <asm/page.h> 5 6 /* Allocate consecutive virtual pages (without backing) */ 7 extern void *alloc_vpages(ulong nr); 8 /* Allocate consecutive and aligned virtual pages (without backing) */ 9 extern void *alloc_vpages_aligned(ulong nr, unsigned int alignment_order); 10 11 /* Allocate one virtual page (without backing) */ 12 extern void *alloc_vpage(void); 13 /* Set the top of the virtual address space */ 14 extern void init_alloc_vpage(void *top); 15 /* Set up the virtual allocator; also sets up the page allocator if needed */ 16 extern void setup_vm(void); 17 18 /* Set up paging */ 19 extern void *setup_mmu(phys_addr_t top); 20 /* Walk the page table and resolve the virtual address to a physical address */ 21 extern phys_addr_t virt_to_pte_phys(pgd_t *pgtable, void *virt); 22 /* Map the virtual address to the physical address for the given page tables */ 23 extern pteval_t *install_page(pgd_t *pgtable, phys_addr_t phys, void *virt); 24 25 /* Map consecutive physical pages */ 26 void *vmap(phys_addr_t phys, size_t size); 27 28 #endif 29