1 #include <sys-generic/bootmem.h>
2 #include <lunaix/sections.h>
3 #include <lunaix/spike.h>
5 #define BOOTMEM_SIZE (4 * 4096)
7 static reclaimable char bootmem_pool[BOOTMEM_SIZE];
8 static unsigned int pos;
11 bootmem_alloc(unsigned int size)
15 res = __ptr(bootmem_pool) + pos;
17 size = ROUNDUP(size, 4);
20 if (pos >= BOOTMEM_SIZE) {
29 bootmem_free(void* ptr)
31 // not need to support, as they are all one-shot