Semester : SEMESTER 6
Subject : Embedded System
Year : 2018
Term : MARCH
Scheme : 2015 Full Time
Course Code : EC 308
Page:67
9.2.4 Memory Allocation-Related Functions نك
Memory functions are required to allocate fixed-size memory blocks from a memory partition (
number of blocks. The allocation takes place without fragmentation. The allocation and de-alloca
in fixed and deterministic time (Example 8.6). MUCOS memory functions for the tasks are as
aving integer
tion lake Place
Per Table 9.4
Table 9.4 Real-Time Operating System (RTOS) Memory Functions for Querying
Creating, Getting and Putting
Prototype Functions
OSMem *OSMemCreate (void *memAddr,
നന്തി MEMTYPE blockSize.
unsigned byte *memErr)
void *OSMemGet (OS_MEM *memCBPointer,
unsi gned byte भा चलापि)
unsigned byte QSMemQuery (OS_MEM
*memCBPointer, OS_MEM_DATA *memData)
unsigned byte OSMemPut (OS_MEM
*memCBPointée void *memBlock)
' MEMTYPE is unsigned int of 16 or 32 bits.
What are the Para-
meters Returning
and Passed?
R/ and 01
RJ and PJ
RK and PK
RL and PL
When is this OS Call?
To create and initialize a memory
partition. The memory blocks are then
allotted from the partition
To find pointer of the memory control
block allocated to the memory blocks,
NULL if no blocks, OSMemGet is used
when an interrupt service routine (ISR) of
task needs to get the memory blockis)
To find pointers of the memory control
block and OS_MemData data structure
To retum a pointer of memory block in
the memory partitions from the memory
control block pointer. OSMemPut is used
when the application no longer needs the
memory block