xref: /kvm-unit-tests/lib/alloc_page.h (revision 73f4b202beb399976fcd184bac1a6b7a88373581)
1 /*
2  * This work is licensed under the terms of the GNU LGPL, version 2.
3  *
4  * This is a simple allocator that provides contiguous physical addresses
5  * with byte granularity.
6  */
7 
8 #ifndef ALLOC_PAGE_H
9 #define ALLOC_PAGE_H 1
10 
11 bool page_alloc_initialized(void);
12 void page_alloc_ops_enable(void);
13 void *alloc_page(void);
14 void *alloc_pages(unsigned int order);
15 void free_page(void *page);
16 void free_pages(void *mem, size_t size);
17 void free_pages_by_order(void *mem, unsigned int order);
18 unsigned int get_order(size_t size);
19 
20 #endif
21