l4_ipc_reply_and_wait -- send a reply to a client and wait for next order

1 Synopsis

#include <l4/sys/ipc.h>

static inline int
l4_ipc_reply_and_wait(l4_threadid_t dest , const void *snd_msg , l4_umword_t snd_dword0 , l4_umword_t snd_dword1 , 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

snd_msg is sent to thread with id dest and the invoker waits for a reply from any source. This is the standard server operation: it sends a reply to the actual client and waits for the next order which may come from a different client.

3 Arguments

dest
Thread id of the destination.
*snd_msg
Pointer to a Send Descriptor. It can contain the following values:

L4_IPC_NIL_DESCRIPTOR
Ipc does not include a send operation.
<mem>
Ipc includes sending a message to the destination specified by dest. *snd_msg must point to a valid message. The first two 32-bit words of the message have to be given separately in snd_dword0 and snd_dword1.
0
Ipc includes sending a message to the destination specified by dest. The message consists solely of the two 32-bit words snd_dword0 and snd_dword1.
snd_dword0
The first dword to be transmitted.
snd_dword1
The second dword to be transmitted.
*src
The id of the next client.
*rcv_msg
Pointer to Receive Descriptor. It can contain the following values:

L4_IPC_NIL_DESCRIPTOR
Ipc does not include a receive operation.
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 timeouts, 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_receive , l4_ipc_call , l4_ipc_reply_deceiting_and_wait , l4_ipc_send , l4_ipc_send_deceiting , l4_ipc_wait
Ich