PMSIS API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CL_L2 Memory allocation

Memory allocation in L2 from cluster cores. More...

Typedefs

typedef struct pi_cl_alloc_req_s pi_cl_alloc_req_t
 Cluster memory allocation request structure. More...
 
typedef struct pi_cl_free_req_s pi_cl_free_req_t
 Cluster memory free request structure. More...
 

Functions

void pi_cl_l2_malloc (int size, pi_cl_alloc_req_t *req)
 Allocate L2 memory from cluster side. More...
 
void pi_cl_l2_free (void *chunk, int size, pi_cl_free_req_t *req)
 Free L2 memory from cluster side. More...
 
static void * pi_cl_l2_malloc_wait (pi_cl_alloc_req_t *req)
 Wait until the specified allocation request has finished. More...
 
static void pi_cl_l2_free_wait (pi_cl_free_req_t *req)
 Wait until the specified free request has finished. More...
 

Description

This API uses cluster delegation to FC to allocate memory in L2.

Typedef Documentation

typedef struct pi_cl_alloc_req_s pi_cl_alloc_req_t

This structure is used by the runtime to manage a cluster remote allocation. It must be instantiated once for each allocation and must be kept alive until the allocation is finished. It can be instantiated as a normal variable, for example as a global variable, a local one on the stack, or through a memory allocator.

typedef struct pi_cl_free_req_s pi_cl_free_req_t

This structure is used by the runtime to manage a cluster remote free. It must be instantiated once for each free and must be kept alive until the free is finished. It can be instantiated as a normal variable, for example as a global variable, a local one on the stack, or through a memory allocator.

Function Documentation

void pi_cl_l2_free ( void *  chunk,
int  size,
pi_cl_free_req_t req 
)
Parameters
chunkChunk to be freed.
sizeSize in bytes of the memory to be freed.
reqRequest structure used for termination.
static void pi_cl_l2_free_wait ( pi_cl_free_req_t req)
inlinestatic

This blocks the calling core until the specified cluster remote free is finished.

Parameters
reqRequest structure used for termination.
void pi_cl_l2_malloc ( int  size,
pi_cl_alloc_req_t req 
)
Parameters
sizeSize in bytes of the memory to be allocated.
reqRequest structure used for termination.
static void* pi_cl_l2_malloc_wait ( pi_cl_alloc_req_t req)
inlinestatic

This blocks the calling core until the specified cluster remote allocation is finished.

Parameters
reqRequest structure used for termination.
Returns
Allocated chunk or NULL if there was not enough memory available.