summaryrefslogtreecommitdiff
path: root/kernel/kmalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kmalloc.h')
-rw-r--r--kernel/kmalloc.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/kernel/kmalloc.h b/kernel/kmalloc.h
index 6e7157a..c7900c5 100644
--- a/kernel/kmalloc.h
+++ b/kernel/kmalloc.h
@@ -1,14 +1,29 @@
-/*
- * Kernel Block Memory Allocation
+/**
+ * @file
+ *
+ * In-Kernel Block Memory Allocation
+ * =================================
*
* The kernel reserves some memory for internal operation, since malloc
* is not available.
+ *
+ * Threads
+ * -------
+ * kballoc() and kbfree() are protected with spinlocks so you can
+ * call them simultanously, even from multiple cpus!
+ *
+ * Todo
+ * ----
+ * zeroalloc, alloc bytes, realloc
+ *
*/
#include <stdint.h>
-// Allocate size*4096 bytes and returns a 32-bit pointer
+/** Allocate size*4096 bytes and returns a 32-bit address
+ * and 0 if fails.
+ * */
uint32_t kballoc (uint32_t size);
-// Free memory allocated before by supplying the address (TODO)
-uint32_t kbfree (uint32_t addr);
+/** Free memory allocated before by supplying the address returned by kballoc */
+void kbfree (uint32_t addr);