CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

mm.c File Reference

mm.c File Reference

memory management implementation code of CooCox CoOS kernel. More...

Go to the source code of this file.

Functions

OS_MMID CoCreateMemPartition (U8 *memBuf, U32 blockSize, U32 blockNum)
 Create a memory partition.
StatusType CoDelMemoryPartition (OS_MMID mmID)
 Delete a memory partition.
U32 CoGetFreeBlockNum (OS_MMID mmID, StatusType *perr)
 Get free block number in a memory partition.
void * CoGetMemoryBuffer (OS_MMID mmID)
 Get a memory buffer from memory partition.
StatusType CoFreeMemoryBuffer (OS_MMID mmID, void *buf)
 Free a memory buffer to memory partition.

Variables

MM MemoryTbl [CFG_MAX_MM] = {{0}}
U32 MemoryIDVessel = 0

Detailed Description

memory management implementation code of CooCox CoOS kernel.

Version:
V1.1.4
Date:
2011.04.20

INTERNAL FILE,DON'T PUBLIC.

© COPYRIGHT 2009 CooCox

Definition in file mm.c.


Function Documentation

OS_MMID CoCreateMemPartition ( U8 *  memBuf,
U32  blockSize,
U32  blockNum 
)

Create a memory partition.

Parameters:
[in]memBufSpecify memory partition head address.
[in]blockSizeSpecify memory block size.
[in]blockNumSpecify memory block number.
[out]None
Return values:
E_CREATE_FAILCreate memory partition fail.
othersCreate memory partition successful.
Description

This function is called to create a memory partition.

Definition at line 40 of file mm.c.

StatusType CoDelMemoryPartition ( OS_MMID  mmID )

Delete a memory partition.

Parameters:
[in]mmIDSpecify memory partition that want to delete.
[out]None
Return values:
E_INVALID_IDThe memory partition id passed was invalid,delete fail.
E_OKDelete successful.
Description

This function is called to Delete a memory partition.

Definition at line 105 of file mm.c.

StatusType CoFreeMemoryBuffer ( OS_MMID  mmID,
void *  buf 
)

Free a memory buffer to memory partition.

Parameters:
[in]mmIDSpecify memory partition.
[in]bufSpecify memory buffer that want to free.
[out]None
Return values:
E_INVALID_IDThe memory partition id passed was invalid.
E_INVALID_PARAMETERThe parameter passed was invalid.
E_OKFree successful.
Description

This function is called to Delete a memory partition.

Definition at line 232 of file mm.c.

U32 CoGetFreeBlockNum ( OS_MMID  mmID,
StatusType *  perr 
)

Get free block number in a memory partition.

Parameters:
[in]mmIDSpecify memory partition.
[out]E_INVALID_IDInvalid ID was passed and get counter failure.
[out]E_OKGet current counter successful.
Return values:
fbNumThe number of free block.
Description

This function is called to get free block number in a memory partition.

Definition at line 145 of file mm.c.

void* CoGetMemoryBuffer ( OS_MMID  mmID )

Get a memory buffer from memory partition.

Parameters:
[in]mmIDSpecify memory partition that want to assign buffer.
[out]None
Return values:
Co_NULLAssign buffer fail.
othersAssign buffer successful,and return the buffer pointer.
Description

This function is called to Delete a memory partition.

Definition at line 189 of file mm.c.


Variable Documentation

U32 MemoryIDVessel = 0

Memory ID container.

Definition at line 24 of file mm.c.

MM MemoryTbl[CFG_MAX_MM] = {{0}}

Table which save memory control block.

Definition at line 23 of file mm.c.