rcv_mbx

Outline

Receive from mailbox (waiting forever).

C format

 ER      rcv_mbx ( ID mbxid, T_MSG **ppk_msg );


Assembly format

 MOVW    BC, #LOWW(_ppk_msg)
 MOV     A, #mbxid
 CALL    !!_rcv_mbx


Parameter(s)

I/O

Parameter

Description

I

 ID      mbxid;
ID number of the mailbox from which a message is received.

O

 T_MSG   **ppk_msg;
Start address of the message packet received from the mailbox.



Explanation

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).

Receiving Waiting State for a mailbox Cancel Operation

Return Value

A message was transmitted to the target mailbox as a result of issuing snd_mbx.

E_OK

Forced release from waiting (accept rel_wai while waiting).

E_RLWAI

Forced release from waiting (accept irel_wai while waiting).

E_RLWAI



Note For details about the message packet, refer to "12.5.5 Message packet".

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_RLWAI

-49

Forced release from waiting (accept rel_wai/irel_wai while waiting).