diff options
Diffstat (limited to 'src/kernel/mem.h')
-rw-r--r-- | src/kernel/mem.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kernel/mem.h b/src/kernel/mem.h new file mode 100644 index 0000000..e8e6a4f --- /dev/null +++ b/src/kernel/mem.h @@ -0,0 +1,12 @@ +#pragma once +#include <stddef.h> + +#define PAGE_SIZE 4096 + +void mem_init(); + +// allocates `pages` consecutive pages +void *page_alloc(size_t pages); + +// frees `pages` consecutive pages starting from *first +void page_free(void *first, size_t pages); |