diff options
| author | Aleksa Vučković <aleksav013@gmail.com> | 2021-10-25 00:36:33 +0200 |
|---|---|---|
| committer | Aleksa Vučković <aleksav013@gmail.com> | 2021-10-25 00:36:33 +0200 |
| commit | 20dd72e40dc2728d3c5335d860e4b8ab8da14fcc (patch) | |
| tree | dabdfdf736c45f9632fa1388d2144b1de7a438b0 /src/include/heap.h | |
| parent | 0bca634f7e70b05239f46f3bd40bb37468d67957 (diff) | |
Changing build system to recursive make
Diffstat (limited to 'src/include/heap.h')
| -rw-r--r-- | src/include/heap.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/heap.h b/src/include/heap.h new file mode 100644 index 0000000..2f66501 --- /dev/null +++ b/src/include/heap.h @@ -0,0 +1,23 @@ +#include"types.h" + +typedef struct _KHEAPBLOCKBM { + struct _KHEAPBLOCKBM *next; + uint32_t size; + uint32_t used; + uint32_t bsize; + uint32_t lfb; +} KHEAPBLOCKBM; + +typedef struct _KHEAPBM { + KHEAPBLOCKBM *fblock; +} KHEAPBM; + +void k_heapBMInit(KHEAPBM *heap); +int k_heapBMAddBlock(KHEAPBM *heap, uintptr_t addr, uint32_t size, uint32_t bsize); +void *k_heapBMAlloc(KHEAPBM *heap, uint32_t size); +void k_heapBMFree(KHEAPBM *heap, void *ptr); + +extern KHEAPBM kheap; + +#define kmalloc k_heapBMAlloc +#define kfree k_heapBMFree |
