X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/baca54322c66983205edecd2ebb00d997878be50..270869139db617e29a35bb9ded41087bb702f9ac:/lunaix-os/includes/lunaix/mm/page.h diff --git a/lunaix-os/includes/lunaix/mm/page.h b/lunaix-os/includes/lunaix/mm/page.h index 0f9fb0c..da7cab4 100644 --- a/lunaix-os/includes/lunaix/mm/page.h +++ b/lunaix-os/includes/lunaix/mm/page.h @@ -303,4 +303,22 @@ vunmap_range(pfn_t start, size_t npages) pte_t alloc_kpage_at(pte_t* ptep, pte_t pte, int order); +static inline void* +vmalloc_page(int order) +{ + struct leaflet* leaf = alloc_leaflet(0); + if (!leaf) { + return NULL; + } + + return (void*)vmap(leaf, KERNEL_DATA); +} + +static inline void +vmfree(void* ptr) +{ + struct leaflet* leaf = ppfn_leaflet(pfn((ptr_t)ptr)); + leaflet_return(leaf); +} + #endif /* __LUNAIX_PAGE_H */