| #ifndef __DXS_MEMPOOL_H__ |
| #define __DXS_MEMPOOL_H__ |
| /****************************************************************************** |
| |
| Copyright (c) 2006-2015 Lantiq Deutschland GmbH |
| Copyright (c) 2015 Lantiq Beteiligungs-GmbH & Co.KG |
| Copyright 2018, Intel Corporation. |
| |
| For licensing information, see the file 'LICENSE' in the root folder of |
| this software module. |
| |
| ******************************************************************************/ |
| |
| /** |
| \file dxs_mempool.h |
| XXXXXX |
| |
| \remarks |
| XXXXXX |
| */ |
| |
| /* ========================================================================== */ |
| /* Includes */ |
| /* ========================================================================== */ |
| #include <stdint.h> |
| |
| /* ========================================================================== */ |
| /* Macro definitions */ |
| /* ========================================================================== */ |
| |
| /* return codes */ |
| #define DXS_MPOOL_OK 0 |
| #define DXS_MPOOL_PARAMS (-1) |
| #define DXS_MPOOL_NOT_ENOUGH (-2) |
| #define DXS_MPOOL_NO_FREE_POOLS (-3) |
| #define DXS_MPOOL_BUF_NOT_FOUND (-4) |
| |
| /* ========================================================================== */ |
| /* Function prototypes */ |
| /* ========================================================================== */ |
| |
| extern int32_t mempool_init(void *mem, uint32_t size, uint16_t elem_num, |
| uint16_t elem_size, void **pool_id); |
| extern void *mempool_get(void *pool_id); |
| extern int32_t mempool_put(void *pool_id, void *p); |
| extern void mempool_status(void *pool_id, uint16_t *busy, uint16_t *free); |
| extern void mempool_destroy(void *pool_id); |
| |
| #endif /* __DXS_MEMPOOL_H__ */ |