aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/libk/kmalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/libk/kmalloc.h')
-rw-r--r--kernel/include/libk/kmalloc.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/kernel/include/libk/kmalloc.h b/kernel/include/libk/kmalloc.h
index f760ee1..85e247a 100644
--- a/kernel/include/libk/kmalloc.h
+++ b/kernel/include/libk/kmalloc.h
@@ -19,29 +19,17 @@
#ifndef __libk_kmalloc_h
#define __libk_kmalloc_h
-#include <stddef.h>
+#include <stdint.h>
-void *kmalloc(size_t);
-void *krealloc(void *, size_t);
-void *kcalloc(size_t, size_t);
-void kfree(void *);
+#define MIN_PAGES 4
-/** This is a boundary tag which is prepended to the
- * page or section of a page which we have allocated. It is
- * used to identify valid memory blocks that the
- * application is trying to free.
- */
-struct boundary_tag {
- unsigned int magic; //< It's a kind of ...
- unsigned int size; //< Requested size.
- unsigned int real_size; //< Actual size.
- int index; //< Location in the page table.
+typedef struct memory_chunk_t {
+ struct memory_chunk_t *next;
+ struct memory_chunk_t *prev;
- struct boundary_tag *split_left; //< Linked-list info for broken pages.
- struct boundary_tag *split_right; //< The same.
+ uint32_t size;
+} memory_chunk_t;
- struct boundary_tag *next; //< Linked list info.
- struct boundary_tag *prev; //< Linked list info.
-};
+void *kmalloc(uint32_t size);
#endif