diff options
author | dzwdz | 2021-09-05 18:32:08 +0200 |
---|---|---|
committer | dzwdz | 2021-09-05 18:32:08 +0200 |
commit | 838b142b7374150df63ec02b02377c114a14b314 (patch) | |
tree | b5b22e5517da7a4ac96a47f0cfe6a4755d00da44 /src/kernel/mem/alloc.h | |
parent | d6c1dceba2511fa2edf839942b237d3a27bb9535 (diff) |
move most of the memory stuff to kernel/mem/
Diffstat (limited to 'src/kernel/mem/alloc.h')
-rw-r--r-- | src/kernel/mem/alloc.h | 15 |
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); |