l4_ipc_receive -- wait for a message from a specified thread
1 Synopsis
#include <l4/sys/ipc.h>
static inline int
l4_ipc_receive(l4_threadid_t src , void
*rcv_msg , l4_umword_t *rcv_dword0 , l4_umword_t
*rcv_dword1 l4_timeout_t timeout ,
l4_msgdope_t *result
);
2 Description
This operation includes no send phase. The invoker waits for a message
from src. Messages from other sources are not accepted. Note
that also a hardware interrupt might be specified as source.
3 Arguments
- src
- Thread id of the source.
- *rcv_msg
- Pointer to Receive Descriptor. It can contain the
following values:
- 0
- Only messages up to two 32-bit words and are
accepted. The received message is returned in rcv_dword0 and
rcv_dword1.
- <mem>
- If Bit 1 of *rcv_msg is 0 ipc includes receiving a
message respectively waiting to receive a message. *rcv_msg must
point to a valid message. Note that the first two 32-bit words of the
received message are returned in rcv_dword0 and rcv_dword1.
- <rmap>
- If Bit 1 of *rcv_msg is 1 only send-fpage
messages or up to two 32-bit words (in rcv_dword0 and
rcv_dword1) are accepted. If a map message is received, the 30
most significant bits describe the receive fpage (instead of
rcvfpage option in a memory message buffer). Thus fpages can
also be received without a message buffer in memory.
- *rcv_dword0
- First of two 32-bit words of received message,
undefined if no message was received.
- *rcv_dword1
- Second of two 32-bit words of received message,
undefined if no message was received.
- timeout
- This 32-bit word specifies all 4 timouts, the
quadruple (snd, rcv, snd pf, rcv pf). For a detailed description see
the L4 Reference Manual.
- result
- The message dope describing the result of the Ipc.
4 Return Values
The following return values are possible:
- 0
- No error occured. The optional send operation was
successful, and if a receive operation was also specified, a message
was also received correctly.
- L4_IPC_ENOT_EXISTENT
- Non-existing destination or source.
- L4_IPC_RETIMEOUT
- Timeout during receive operation.
- L4_IPC_SETIMEOUT
- Timeout during send operation.
- L4_IPC_RECANCELED
- Receive operation cancelled by another thread.
- L4_IPC_SECANCELED
- Send operation cancelled by another thread.
- L4_IPC_REMAPFAILED
- Map failed due to a shortage of page
tables during receive operation.
- L4_IPC_SEMAPFAILED
- Map failed due to a shortage of page
tables during send operation.
- L4_IPC_RESNDPFTO
- Send pagefault timeout.
- L4_IPC_SERCVPFTO
- Receive pagefault timeout.
- L4_IPC_REABORTED
- Receive operation aborted by another
thread.
- L4_IPC_SEABORTED
- Send operation aborted by another thread.
- L4_IPC_REMSGCUT
- Received message cut. Potential reasons
are:
- (a)
- The recipient's mword buffer is too small.
- (b)
- The recipient does not accept enough strings.
- (c)
- At least one of the recipient's string buffers is too small.
5 See Also
l4_ipc ,
l4_ipc_call ,
l4_ipc_reply_and_wait ,
l4_ipc_reply_deceiting_and_wait ,
l4_ipc_send ,
l4_ipc_send_deceiting ,
l4_ipc_wait
Ich