Create pmm.h

This commit is contained in:
2026-01-28 10:14:01 -08:00
committed by GitHub
parent f572101d6b
commit 64d69d505f

21
kernel/pmm.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef PMM_H
#define PMM_H
#include <stdint.h>
#include <stddef.h>
#include "memmap.h"
#include "paging.h" // For PAGE_SIZE
#define BLOCKS_PER_BYTE 8
void pmm_init(memory_map_entry_t* mmap, uint32_t mmap_size, uintptr_t bitmap_addr);
void pmm_mark_used(uintptr_t addr);
void pmm_mark_free(uintptr_t addr);
void* pmm_alloc_block();
void pmm_free_block(void* addr);
uint32_t pmm_get_used_block_count();
uint32_t pmm_get_free_block_count();
#endif