e68ef38a011ce7367a3595fbf5fa57f7c4643166
[cortex-from-scratch] / include / lib / pool.h
1 /* Fixed size memory pool allocation  */
2 typedef struct mem_pool mem_pool_t;
3
4 struct mem_pool {
5
6         unsigned short blocks; 
7         unsigned short block_size; 
8         unsigned short free_blocks;
9         unsigned short blocks_init; 
10         uint32_t * SRAM_entry;
11         uint32_t * m_next; 
12
13 };
14
15 extern void kpool_init(mem_pool_t *, size_t size_arg, unsigned int blocks_arg, uint32_t * entry_SRAM); 
16 extern void * kalloc(mem_pool_t * );
17 extern void kfree(mem_pool_t *, void* p);