Everything

ref_mpf

iref_mpf

Outline
Reference fixed-sized memory pool state.
C format
 ER      ref_mpf (ID mpfid, T_RMPF *pk_rmpf);
 ER      iref_mpf (ID mpfid, T_RMPF *pk_rmpf);
Parameter(s)
I/O
Parameter
Description
I
 ID      mpfid;
ID number of the fixed-sized memory pool.
O
 T_RMPF  *pk_rmpf;
Pointer to the packet returning the fixed-sized memory pool state.

[Fixed-sized memory pool state packet: T_RMPF]
 typedef struct  t_rmpf {
     ID      wtskid;         /*Existence of waiting task*/
     UINT    fblkcnt;        /*Number of free memory blocks*/
 } T_RMPF;

Explanation
Stores fixed-sized memory pool state packet (ID number of the task at the head of the wait queue, number of free memory blocks, etc.) of the fixed-sized memory pool specified by parameter mpfid in the area specified by parameter pk_rmpf.
- wtskid
Stores whether a task is queued to the fixed-size memory pool.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the wait queue
- fblkcnt
Stores the number of free memory blocks.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
Parameter error.
- pk_rmpf == NULL
E_ID
-18
Invalid ID number.
- mpfid < 0
- mpfid > VTMAX_MPF
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
Note When the iref_mpf is issued from task or the ref_mpf is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.
E_MACV
-26
Memory access violation. (only for ref_mpf)
- The operand-write access to the area indicated by pk_rmpf has not been permitted to the invoking task.
E_NOEXS
-42
Non-existent object.
- The fixed-sized memory pool specified by mpfid does not exist.