80#define OS_MEMPOOL_F_EXT 0x01
105struct os_mempool_ext {
113#define OS_MEMPOOL_INFO_NAME_LEN (32)
150#if MYNEWT_VAL(OS_MEMPOOL_GUARD)
154#define OS_MEMPOOL_BLOCK_SZ(sz) ((sz) + sizeof(os_membuf_t))
156#define OS_MEMPOOL_BLOCK_SZ(sz) (sz)
158#if (OS_ALIGNMENT == 4)
159typedef uint32_t os_membuf_t;
160#elif (OS_ALIGNMENT == 8)
161typedef uint64_t os_membuf_t;
162#elif (OS_ALIGNMENT == 16)
163typedef __uint128_t os_membuf_t;
165#error "Unhandled `OS_ALIGNMENT` for `os_membuf_t`"
167#define OS_MEMPOOL_SIZE(n,blksize) ((((blksize) + ((OS_ALIGNMENT)-1)) / (OS_ALIGNMENT)) * (n))
170#define OS_MEMPOOL_BYTES(n,blksize) \
171 (sizeof (os_membuf_t) * OS_MEMPOOL_SIZE((n), (blksize)))
173#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED
185os_error_t r_os_mempool_init(
struct os_mempool *mp, uint16_t blocks,
186 uint32_t block_size,
void *membuf,
const char *
name);
187#define os_mempool_init r_os_mempool_init
201os_error_t r_os_mempool_ext_init(
struct os_mempool_ext *mpe, uint16_t blocks,
202 uint32_t block_size,
void *membuf,
const char *
name);
203#define os_mempool_ext_init r_os_mempool_ext_init
213os_error_t r_os_mempool_unregister(
struct os_mempool *mp);
214#define os_mempool_unregister r_os_mempool_unregister
224os_error_t r_os_mempool_clear(
struct os_mempool *mp);
225#define os_mempool_clear r_os_mempool_clear
238bool r_os_mempool_is_sane(
const struct os_mempool *mp);
239#define os_mempool_is_sane r_os_mempool_is_sane
251int r_os_memblock_from(
const struct os_mempool *mp,
const void *block_addr);
252#define os_memblock_from r_os_memblock_from
262void *r_os_memblock_get(
struct os_mempool *mp);
263#define os_memblock_get r_os_memblock_get
274os_error_t r_os_memblock_put_from_cb(
struct os_mempool *mp,
void *block_addr);
275#define os_memblock_put_from_cb r_os_memblock_put_from_cb
286os_error_t r_os_memblock_put(
struct os_mempool *mp,
void *block_addr);
287#define os_memblock_put r_os_memblock_put
302 uint32_t block_size,
void *membuf,
const char *
name);
318 uint32_t block_size,
void *membuf,
const char *
name);
void * os_memblock_get(struct os_mempool *mp)
Definition os_mempool.c:341
os_error_t os_mempool_unregister(struct os_mempool *mp)
Definition os_mempool.c:208
os_error_t os_mempool_ext_init(struct os_mempool_ext *mpe, uint16_t blocks, uint32_t block_size, void *membuf, const char *name)
Definition os_mempool.c:190
bool os_mempool_is_sane(const struct os_mempool *mp)
Definition os_mempool.c:297
os_error_t os_mempool_init(struct os_mempool *mp, uint16_t blocks, uint32_t block_size, void *membuf, const char *name)
Definition os_mempool.c:183
struct os_mempool * os_mempool_info_get_next(struct os_mempool *, struct os_mempool_info *)
Definition os_mempool.c:458
os_error_t os_mempool_clear(struct os_mempool *mp)
Definition os_mempool.c:246
os_error_t os_mempool_ext_clear(struct os_mempool_ext *mpe)
Definition os_mempool.c:287
os_error_t os_mempool_put_fn(struct os_mempool_ext *ome, void *data, void *arg)
Definition os_mempool.h:102
os_error_t os_memblock_put_from_cb(struct os_mempool *mp, void *block_addr)
Definition os_mempool.c:380
int os_memblock_from(const struct os_mempool *mp, const void *block_addr)
Definition os_mempool.c:314
os_error_t os_memblock_put(struct os_mempool *mp, void *block_addr)
Definition os_mempool.c:410
Definition os_mempool.h:45
Definition os_mempool.h:119
int omi_min_free
Definition os_mempool.h:127
int omi_num_blocks
Definition os_mempool.h:123
char omi_name[OS_MEMPOOL_INFO_NAME_LEN]
Definition os_mempool.h:129
int omi_num_free
Definition os_mempool.h:125
int omi_block_size
Definition os_mempool.h:121
Definition os_mempool.h:57
uint8_t mp_flags
Definition os_mempool.h:67
uint16_t mp_num_blocks
Definition os_mempool.h:61
uint16_t mp_num_free
Definition os_mempool.h:63
uint32_t mp_block_size
Definition os_mempool.h:59
uint32_t mp_membuf_addr
Definition os_mempool.h:69
const char * name
Definition os_mempool.h:73
uint16_t mp_min_free
Definition os_mempool.h:65