Developer World
Spresense SDK Library v2.3.0-e949ae4
Manager Class Reference

Memory Management Class for "Memory Manager Lite". User can create only one instance. More...

#include <Manager.h>

Inheritance diagram for Manager:
Collaboration diagram for Manager:

Static Public Member Functions

static err_t initFirst (void *manager_area, uint32_t area_size)
 
static err_t initPerCpu (void *manager_area, uint32_t pool_num)
 
static err_t initPerCpu (void *manager_area, MemPool **static_pools[], uint8_t *pool_num, uint8_t *layout_no)
 
static err_t finalize ()
 
static err_t createStaticPools (uint8_t sec_no, NumLayout layout_no, void *work_area, uint32_t area_size, const PoolSectionAttr *pool_attr)
 
static err_t createStaticPools (NumLayout layout_no, void *work_area, uint32_t area_size, const PoolAttr *pool_attr)
 
static void destroyStaticPools (uint8_t sec_no)
 
static void destroyStaticPools ()
 
static NumLayout getCurrentLayoutNo (uint8_t sec_no)
 
static bool isStaticPoolAvailable (uint8_t sec_no)
 
static uint32_t getStaticPoolsUsedSegs (uint8_t sec, MemHandleBase *mhs, uint32_t num_mhs)
 
static uint32_t getUsedSegs (uint8_t sec, PoolId id, MemHandleBase *mhs, uint32_t num_mhs)
 
static bool isPoolAvailable (PoolId id)
 
static PoolType getPoolType (PoolId id)
 
static PoolAddr getPoolAddr (PoolId id)
 
static PoolSize getPoolSize (PoolId id)
 
static NumSeg getPoolNumSegs (PoolId id)
 
static NumSeg getPoolNumAvailSegs (PoolId id)
 

Friends

class MemHandleBase
 

Detailed Description

Memory Management Class for "Memory Manager Lite". User can create only one instance.

Member Function Documentation

◆ initFirst()

static err_t initFirst ( void *  manager_area,
uint32_t  area_size 
)
static

The 1st initialize method on boot. This method only called once on the system.(from system processor)

Parameters
[in]manager_areathe area pointer of the data structure for management "memory manager".
[in]area_sizethe size of the data structure for management "memory manager".
Returns
ERR_OK : success
ERR_STS : error, initFirst() is already executing
ERR_DATA_SIZE : error, area_size less than sizeof(MemMgrLite::Manager)
ERR_ADR_ALIGN : error, address is not 4bytes alignment

◆ initPerCpu()

static err_t initPerCpu ( void *  manager_area,
uint32_t  pool_num 
)
static

The 2nd initialize method on boot. This method only called once on each processor.

Parameters
[in]manager_areaThe area pointer of the data structure for management "memory manager".
Returns
ERR_OK : success
ERR_STS : error, initPerCpu() is already executing

◆ finalize()

static err_t finalize ( )
static

The finalize method on power-off. This method only called once on the system.(from system processor)

Returns
void

◆ createStaticPools()

static err_t createStaticPools ( uint8_t  sec_no,
NumLayout  layout_no,
void *  work_area,
uint32_t  area_size,
const PoolSectionAttr pool_attr 
)
static

The static memory layout creation method. This mathod provide changing memory layouts.

Parameters
[in]layout_noA layout number.
[in]work_areaThe area pointer of memory pools used by "memory manager" with layout number.
[in]area_sizeThe size of memory pools used by "memory manager" with layout number.
Returns
ERR_OK : success
ERR_STS : error, initPerCpu() is already executing
ERR_ARG : error, layout_no is over max(NUM_MEM_LAYOUTS-1)
ERR_DATA_SIZE : error, area_size less than MEMMGR_MAX_WORK_SIZE
ERR_ADR_ALIGN : error, work area is not 4bytes alignment

◆ destroyStaticPools()

static void destroyStaticPools ( uint8_t  sec_no)
static

The static memory layout destroy method. This mathod provide clear the memory layout.

Returns
void

◆ getCurrentLayoutNo()

static NumLayout getCurrentLayoutNo ( uint8_t  sec_no)
inlinestatic

The getter method for layout number.

Returns
NumLayout The current layout number.

The documentation for this class was generated from the following file: