diff options
Diffstat (limited to 'include/kernel')
-rw-r--r-- | include/kernel/data/ringbuf.h | 2 | ||||
-rw-r--r-- | include/kernel/kmalloc.h | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/kernel/data/ringbuf.h b/include/kernel/data/ringbuf.h index 4f30874..25a7125 100644 --- a/include/kernel/data/ringbuf.h +++ b/include/kernel/data/ringbuf.h @@ -1,7 +1,7 @@ #ifndef KERNEL_RINGBUF_H #define KERNEL_RINGBUF_H -#include <kernel/mem.h> +#include <kernel/kmalloc.h> #include <kernel/string.h> #include <stdint.h> diff --git a/include/kernel/kmalloc.h b/include/kernel/kmalloc.h new file mode 100644 index 0000000..d8debd1 --- /dev/null +++ b/include/kernel/kmalloc.h @@ -0,0 +1,18 @@ +#ifndef KERNEL_KMALLOC_H +#define KERNEL_KMALLOC_H + +#include <stdint.h> +#include <stddef.h> + +struct mem_block { + uintptr_t start; + size_t size; + int alloc; + struct mem_block *next; +}; + +void kmalloc_init(void); +void* kmalloc(size_t sz); +void kfree(void *ptr); + +#endif |