Everything

ref_mbx

iref_mbx

Outline
Reference mailbox state.
C format
 ER      ref_mbx (ID mbxid, T_RMBX *pk_rmbx);
 ER      iref_mbx (ID mbxid, T_RMBX *pk_rmbx);
Parameter(s)
I/O
Parameter
Description
I
 ID      mbxid;
ID number of the mailbox to be referenced.
O
 T_RMBX  *pk_rmbx;
Pointer to the packet returning the mailbox state.

[Mailbox state packet: T_RMBX]
 typedef struct  t_rmbx {
     ID      wtskid;         /*Existence of waiting task*/
     T_MSG   *pk_msg;        /*Existence of waiting message*/
     ATR     mbxatr;         /*Attribute*/
 } T_RMBX;

Explanation
Stores mailbox state packet (ID number of the task at the head of the wait queue, start address of the message packet at the head of the wait queue) of the mailbox specified by parameter mbxid in the area specified by parameter pk_rmbx.
Note For details about the mailbox state packet, refer to "15.2.7 Mailbox state packet".
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- mbxid < 0x0
- mbxid > Maximum ID number
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
E_NOEXS
-42
Non-existent object.
- Specified mailbox is not registered.