Everything

rel_mpf

Outline
Release fixed-sized memory block.
C format
 ER      rel_mpf ( ID mpfid, VP blk );

Assembly format
 MOVW    BC, #LOWW(_blk)
 MOV     A, #mpfid
 CALL    !!_rel_mpf

Parameter(s)
I/O
Parameter
Description
I
 ID      mpfid;
ID number of the fixed-sized memory pool to which the memory block is released.
I
 VP      blk;
Start address of the memory block to be released.

Explanation
This service call returns the memory block specified by parameter blk to the fixed-sized memory pool specified by parameter mpfid.
If a task is queued to the target fixed-sized memory pool wait queue when this service call is issued, memory block return processing is not performed but memory blocks are returned to the relevant task (first task of wait queue).
As a result, the relevant task is unlinked from the wait queue and is moved from the WAITING state (waiting state for a fixed-sized memory block) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.
Note 1 If the first task of the wait queue is moved to the READY state after this service call is issued, this service call also re-queues the task at the end of the ready queue corresponding to the priority of the task.
Note 2 The RI78V4 does not clear the memory blocks before returning them. The contents of the returned memory blocks are therefore undefined.
Return value
Macro
Value
Description
E_OK
0
Normal completion.