summaryrefslogtreecommitdiff
path: root/src/kernel/mem.h
diff options
context:
space:
mode:
authordzwdz2021-07-10 16:37:45 +0200
committerdzwdz2021-07-10 16:37:45 +0200
commitd093a8eea6bfb0ff7e621e9ba3307dae698322aa (patch)
tree08a5272e2813cf8db8feda4ff91d919cb9ad7330 /src/kernel/mem.h
parent1faac72e2514c335e2d5721dce8c9fd1da722062 (diff)
separate the source code from object files; more modular Makefile
Diffstat (limited to 'src/kernel/mem.h')
-rw-r--r--src/kernel/mem.h12
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);