/** * @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 #include "ringbuffer.h" /** 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 returned by kballoc */ void kbfree (uint32_t addr); /** Get current status for sysfs */ void kmalloc_sysfs(ringbuffer *r, void (*f)(ringbuffer *r, char *fmt, ...));