From 838b142b7374150df63ec02b02377c114a14b314 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 5 Sep 2021 18:32:08 +0200 Subject: move most of the memory stuff to kernel/mem/ --- src/kernel/mem/alloc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/kernel/mem/alloc.h (limited to 'src/kernel/mem/alloc.h') diff --git a/src/kernel/mem/alloc.h b/src/kernel/mem/alloc.h new file mode 100644 index 0000000..571b289 --- /dev/null +++ b/src/kernel/mem/alloc.h @@ -0,0 +1,15 @@ +#pragma once +#include +#include +#include + +void mem_init(struct kmain_info *); + +// 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); + +void *kmalloc(size_t len); +void kfree(void *ptr); -- cgit v1.2.3