diff options
| author | Miguel <m.i@gmx.at> | 2018-09-15 17:53:27 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-15 17:53:27 +0200 |
| commit | cd50c8d1047832bbb0798b368fde0428ef749422 (patch) | |
| tree | fcacf85f58fefeffa482630f31ef208a8bc9d03a /kernel/kmalloc.h | |
| parent | 0b010d22dbf845ad030e2e7320f9c5935b2604a4 (diff) | |
improved in-kernel alloc/dealloc. addded colorless logging and struggling with mouse and kb
Diffstat (limited to 'kernel/kmalloc.h')
| -rw-r--r-- | kernel/kmalloc.h | 25 |
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); |
