diff options
| author | Miguel <m.i@gmx.at> | 2018-08-17 21:41:21 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-17 21:41:21 +0200 |
| commit | c15925a24efe14f437d8a2699500241a58fdc8f9 (patch) | |
| tree | c0db3a7d2a4f857324735df35e9cc1f0539c5f24 /kernel/kmalloc.c | |
| parent | 6fd78c2ff950310d8372ec0353553cc4a5a43e72 (diff) | |
cleanup and working on fifo pipes
Diffstat (limited to 'kernel/kmalloc.c')
| -rw-r--r-- | kernel/kmalloc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/kmalloc.c b/kernel/kmalloc.c index e3b0863..6db07a1 100644 --- a/kernel/kmalloc.c +++ b/kernel/kmalloc.c @@ -1,12 +1,10 @@ #define FOOLOS_MODULE_NAME "kmalloc" #include "kmalloc.h" +#include "kernel/config.h" #include "lib/logger/log.h" -// 8MB for in kernel-memory -#define MEM_SIZE 1024*1024*8 - -static uint8_t data[MEM_SIZE]; // bytes +static uint8_t data[KMALLOC_MEM_SIZE]; // bytes static uint32_t next; static uint32_t first; @@ -41,12 +39,12 @@ uint32_t kballoc(uint32_t size) uint32_t old=next; next+=size; - if(next>=first+MEM_SIZE) + if(next>=first+KMALLOC_MEM_SIZE) { - panic(FOOLOS_MODULE_NAME,"kballoc ran out of memory! maybe increase MEM_SIZE in kmalloc.c?"); + panic(FOOLOS_MODULE_NAME,"kballoc ran out of memory! maybe increase KMALLOC_MEM_SIZE in kmalloc.c?"); } - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"(%d) : 0x%08X (~%dKB left)",size,old,(MEM_SIZE-next+first)/1024); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"(%d) : 0x%08X (~%dKB left)",size,old,(KMALLOC_MEM_SIZE-next+first)/1024); return old; } |
