Physical memory manager
include/mem/pmm.h View source View on GitHubFunctions
Section titled “Functions”pmm_alloc_page_full
Section titled “pmm_alloc_page_full”paddr_t pmm_alloc_page_full(enum alloc_flags flags) source pmm_alloc_pages_full
Section titled “pmm_alloc_pages_full”paddr_t pmm_alloc_pages_full(size_t count, enum alloc_flags flags) source pmm_free_pages
Section titled “pmm_free_pages”pmm_free_page
Section titled “pmm_free_page”pmm_early_init
Section titled “pmm_early_init”void pmm_early_init(struct limine_memmap_request m) source pmm_mid_init
Section titled “pmm_mid_init”void pmm_mid_init(void) source pmm_late_init
Section titled “pmm_late_init”void pmm_late_init(void) source pmm_get_usable_ram
Section titled “pmm_get_usable_ram”uint64_t pmm_get_usable_ram(void) source Variables
Section titled “Variables”memmap
Section titled “memmap”extern struct limine_memmap_response *memmap source Macros
Section titled “Macros”pmm_alloc_pages_1
Section titled “pmm_alloc_pages_1”#define pmm_alloc_pages_1(count) source The reason we use an inline function here is to allow a check of
count to make sure it somehow has not ended up equaling
ALLOC_PARAMS_DEFAULT and warning once if this has ended up being the case
Expansion
#define pmm_alloc_pages_1(count) \
({ \
if ((enum alloc_flags) count == ALLOC_FLAGS_DEFAULT) \
log_msg_once(LOG_WARN, \
"Input to alloc_pages matches ALLOC_FLAGS_DEFAULT, " \
"possible mistake"); \
\
pmm_alloc_pages_2(count, ALLOC_FLAGS_DEFAULT); \
}) pmm_alloc_pages_2
Section titled “pmm_alloc_pages_2”#define pmm_alloc_pages_2(count, f) source Expansion
#define pmm_alloc_pages_2(count, f) pmm_alloc_pages_full((count), (f)) pmm_alloc_pages
Section titled “pmm_alloc_pages”#define pmm_alloc_pages(...) source Expansion
#define pmm_alloc_pages(...) PP_CALL(pmm_alloc_pages, __VA_ARGS__) pmm_alloc_page_0
Section titled “pmm_alloc_page_0”#define pmm_alloc_page_0() source Expansion
#define pmm_alloc_page_0() pmm_alloc_page_1(ALLOC_FLAGS_DEFAULT) pmm_alloc_page_1
Section titled “pmm_alloc_page_1”#define pmm_alloc_page_1(f) source Expansion
#define pmm_alloc_page_1(f) pmm_alloc_page_full((f)) pmm_alloc_page
Section titled “pmm_alloc_page”#define pmm_alloc_page(...) source Expansion
#define pmm_alloc_page(...) PP_CALL(pmm_alloc_page, __VA_ARGS__)