-
trcv_mbx
-
Receive from mailbox (with timeout).
ER trcv_mbx ( ID mbxid, T_MSG **ppk_msg, TMO tmout );
|
MOVW AX, #tmout_hi
PUSH AX
MOVW AX, #tmout_lo
PUSH AX
MOVW BC, #LOWW(_ppk_msg)
MOV A, #mbxid
CALL !!_trcv_mbx
ADDW SP, #0x0004
|
|
|
|
|
ID mbxid;
|
ID number of the mailbox from which a message is received.
|
|
T_MSG **ppk_msg;
|
Start address of the message packet received from the mailbox.
|
|
TMO tmout;
|
Specified timeout (unit: ticks).
TMO_FEVR: Waiting forever.
Value: Specified timeout.
|
This service call receives a message from the mailbox specified by parameter
mbxid, and stores its start address in the area specified by parameter
ppk_msg.
If the message could not be received from the target mailbox (no messages were queued in the wait queue) when this service call is issued, message reception processing is not executed but the invoking task is queued to the target mailbox wait queue in the order of message reception request (FIFO order).
As a result, the invoking task is unlinked from the ready queue and is moved from the RUNNING state to the WAITING state (receiving waiting state for a mailbox).
The receiving waiting state for a mailbox is cancelled in the following cases, and then moved to the READY state.
Receiving Waiting State for a mailbox Cancel Operation
|
|
A message was transmitted to the target mailbox as a result of issuing snd_mbx.
|
|
Forced release from waiting (accept rel_wai while waiting).
|
|
Forced release from waiting (accept irel_wai while waiting).
|
|
Polling failure or timeout.
|
|
Note 1 When TMO_FEVR is specified for wait time
tmout, processing equivalent to
rcv_mbx will be executed. When TMO_POL is specified, processing equivalent to
prcv_mbx will be executed.
|
|
|
|
|
|
|
|
|
|
|
Polling failure or timeout.
|