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.
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*/
 } 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.
- wtskid
Stores whether a task is queued to the mailbox wait queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the wait queue
- pk_msg
Stores whether a message is queued to the mailbox wait queue.
NULL: No applicable message
Value: Start address of the message packet at the head of the wait queue
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
parameter error.
- pk_rmbx == NULL
E_ID
-18
Invalid ID number.
- mbxid < 0
- mbxid > VTMAX_MBX
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_mbx is issued from task or the ref_mbx 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_mbx)
- The operand-write access to the area indicated by pk_rmbx has not been permitted to the invoking task.
E_NOEXS
-42
Non-existent object.
- The mailbox specified by mbxid does not exist.