#include <stdbool.h>
Go to the source code of this file.
#define POOL_BUFFER_SIZE |
( |
|
name | ) |
sizeof(name##_pool_buf) |
#define TFM_POOL_DECLARE |
( |
|
name, |
|
|
|
chunksz, |
|
|
|
num |
|
) |
| |
Value:static uint8_t name##_pool_buf[((
chunksz) + \
__attribute__((aligned(4))); \
Definition at line 54 of file tfm_pools.h.
Checks whether a pointer points to a chunk data in the pool.
- Parameters
-
[in] | pool | Pointer to memory pool declared by TFM_POOL_DECLARE. |
[in] | data | The pointer to check. |
- Return values
-
true | Data is a chunk data in the pool. |
false | Data is not a chunk data in the pool. |
Definition at line 90 of file tfm_pools.c.
Allocate a memory from pool.
- Parameters
-
- Return values
-
buffer | pointer Success. |
NULL | Failed. |
Definition at line 58 of file tfm_pools.c.
void tfm_pool_free |
( |
void * |
ptr | ) |
|
Free the allocated memory.
- Parameters
-
[in] | ptr | Buffer pointer want to free. |
Definition at line 80 of file tfm_pools.c.
int32_t tfm_pool_init |
( |
struct tfm_pool_instance_t * |
pool, |
|
|
size_t |
poolsz, |
|
|
size_t |
chunksz, |
|
|
size_t |
num |
|
) |
| |
Register a memory pool.
- Parameters
-
[in] | pool | Pointer to memory pool declared by TFM_POOL_DECLARE |
[in] | poolsz | Size of the pool buffer. |
[in] | chunksz | Size of chunks. |
[in] | num | Number of chunks. |
- Return values
-
IPC_SUCCESS | Success. |
IPC_ERROR_BAD_PARAMETERS | Parameters error. |
Definition at line 22 of file tfm_pools.c.