123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- #ifndef SYS_SLAB_ALLOCATOR_H_INCLUDED
- #define SYS_SLAB_ALLOCATOR_H_INCLUDED
- #include "phy_pd_data.h"
- #ifndef CONFIG_SLAB_FRAME_POOL_SIZE
- #define CONFIG_SLAB_FRAME_POOL_SIZE 4
- #warning "CONFIG_SLAB_FRAME_POOL_SIZE not set in .config, using default"
- #endif
- typedef enum
- {
- SYS_SLAB_FREE_BUFFER,
- SYS_SLAB_BUSY_BUFFER,
- } sys_slab_buffer_type_t;
- void sys_sa_init(void);
- void sys_sa_reset(void);
- void sys_sa_buffer_put(sys_slab_buffer_type_t type, pd_data_ind_t * p_item);
- pd_data_ind_t * sys_sa_buffer_get(sys_slab_buffer_type_t type);
- void sys_sa_buffer_free(uint8_t * p_frame);
- void sys_sa_buffer_release(pd_data_ind_t * p_item);
- bool sys_sa_memory_allocate(void);
- bool sys_sa_is_empty(sys_slab_buffer_type_t type);
- #endif
|