Buddy allocator
include/mem/buddy.h View source View on GitHubStructs
Section titled “Structs”buddy_free_area
Section titled “buddy_free_area”struct buddy_free_area {
struct buddy_page *head;
struct buddy_page *tail;
uint64_t nr_free;
}; Functions
Section titled “Functions”buddy_add_to_free_area
Section titled “buddy_add_to_free_area”void buddy_add_to_free_area(struct buddy_page *page, struct buddy_free_area *area); buddy_remove_from_free_area
Section titled “buddy_remove_from_free_area”struct buddy_page * buddy_remove_from_free_area(struct buddy_free_area *area); buddy_alloc_pages_global
Section titled “buddy_alloc_pages_global”paddr_t buddy_alloc_pages_global(size_t count, enum alloc_flags flags); buddy_free_pages_global
Section titled “buddy_free_pages_global”void buddy_free_pages_global(paddr_t addr, uint64_t count); buddy_add_entry
Section titled “buddy_add_entry”void buddy_add_entry(struct page *page_array, struct limine_memmap_entry *entry, struct buddy_free_area *farea); buddy_reserve_range
Section titled “buddy_reserve_range”void buddy_reserve_range(uint64_t pfn, uint64_t pages); buddy_alloc_pages
Section titled “buddy_alloc_pages”paddr_t buddy_alloc_pages(struct buddy_free_area *free_area, size_t count); buddy_free_pages
Section titled “buddy_free_pages”void buddy_free_pages(paddr_t addr, size_t count, struct buddy_free_area *free_area, size_t total_pages); buddy_init
Section titled “buddy_init”void buddy_init(void); Macros
Section titled “Macros”BUDDY_MAX_ORDER
Section titled “BUDDY_MAX_ORDER”#define BUDDY_MAX_ORDER 18