summaryrefslogtreecommitdiff
path: root/src/kernel/mem/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem/alloc.h')
-rw-r--r--src/kernel/mem/alloc.h15
1 files changed, 15 insertions, 0 deletions
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 <kernel/arch/generic.h>
+#include <kernel/main.h>
+#include <stddef.h>
+
+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);