MOS Source Code
Loading...
Searching...
No Matches
buddy.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6
7#include <mos/types.h>
8
13void buddy_dump_all();
14
20void buddy_init(size_t max_nframes);
21
28void buddy_reserve_n(pfn_t pfn, size_t nframes);
29
39phyframe_t *buddy_alloc_n_exact(size_t nframes);
40
49void buddy_free_n(pfn_t pfn, size_t nframes);
phyframe_t * buddy_alloc_n_exact(size_t nframes)
Allocate nframes of contiguous physical memory.
Definition buddy_core.c:331
void buddy_dump_all()
Dump the state of the buddy allocator.
Definition buddy_core.c:301
void buddy_free_n(pfn_t pfn, size_t nframes)
Free nframes of contiguous physical memory.
Definition buddy_core.c:370
void buddy_init(size_t max_nframes)
Initialize the buddy allocator with the given maximum number of frames.
Definition buddy_core.c:309
void buddy_reserve_n(pfn_t pfn, size_t nframes)
Reserve several frames at the given physical frame number.
Definition buddy_core.c:323
unsigned long long pfn_t
Definition types.h:41