L4Re - L4 Runtime Environment
|
Input/Output stream for IPC [un]marshalling. More...
Public Member Functions | |
Iostream (l4_utcb_t *utcb) | |
Create an IPC IO stream with a single message buffer. More... | |
void | reset () |
Reset the stream to its initial state. More... | |
IPC operations. | |
l4_msgtag_t | call (l4_cap_idx_t dst, l4_timeout_t timeout, long proto=0) |
Do an IPC call using the message in the output stream and receiving to the input stream. More... | |
l4_msgtag_t | call (l4_cap_idx_t dst, long proto=0) |
l4_msgtag_t | reply_and_wait (l4_umword_t *src_dst, long proto=0) |
Do an IPC reply and wait. More... | |
l4_msgtag_t | send_and_wait (l4_cap_idx_t dest, l4_umword_t *src, long proto=0) |
l4_msgtag_t | reply_and_wait (l4_umword_t *src_dst, l4_timeout_t timeout, long proto=0) |
Do an IPC reply and wait. More... | |
l4_msgtag_t | send_and_wait (l4_cap_idx_t dest, l4_umword_t *src, l4_timeout_t timeout, long proto=0) |
l4_msgtag_t | reply (l4_timeout_t timeout, long proto=0) |
l4_msgtag_t | reply (long proto=0) |
![]() | |
Istream (l4_utcb_t *utcb) | |
Create an input stream for the given message buffer. More... | |
void | reset () |
Reset the stream to empty, and ready for receive()/wait(). More... | |
template<typename T > | |
bool | has_more (unsigned long count=1) |
Check whether a value of type T can be obtained from the stream. | |
l4_utcb_t * | utcb () const |
Return utcb pointer. | |
template<typename T > | |
unsigned long | get (T *buf, unsigned long elems) |
Copy out an array of type T with size elements. More... | |
template<typename T > | |
void | skip (unsigned long elems) |
Skip size elements of type T in the stream. More... | |
template<typename T > | |
unsigned long | get (Msg_ptr< T > const &buf, unsigned long elems=1) |
Read one size elements of type T from the stream and return a pointer. More... | |
template<typename T > | |
bool | get (T &v) |
Extract a single element of type T from the stream. More... | |
bool | get (Ipc::Varg *va) |
l4_msgtag_t | tag () const |
Get the message tag of a received IPC. More... | |
l4_msgtag_t & | tag () |
Get the message tag of a received IPC. More... | |
l4_msgtag_t | wait (l4_umword_t *src) |
Wait for an incoming message from any sender. More... | |
l4_msgtag_t | wait (l4_umword_t *src, l4_timeout_t timeout) |
Wait for an incoming message from any sender. More... | |
l4_msgtag_t | receive (l4_cap_idx_t src) |
Wait for a message from the specified sender. More... | |
l4_msgtag_t | receive (l4_cap_idx_t src, l4_timeout_t timeout) |
![]() | |
Ostream (l4_utcb_t *utcb) | |
Create an IPC output stream using the given message buffer utcb . | |
void | reset () |
Reset the stream to empty, same state as a newly created stream. | |
l4_utcb_t * | utcb () const |
Return utcb pointer. | |
template<typename T > | |
bool | put (T *buf, unsigned long size) |
Put an array with size elements of type T into the stream. More... | |
template<typename T > | |
bool | put (T const &v) |
Insert an element of type T into the stream. More... | |
int | put (Varg const &va) |
template<typename T > | |
int | put (Varg_t< T > const &va) |
l4_msgtag_t | tag () const |
Extract the L4 message tag from the stream. More... | |
l4_msgtag_t & | tag () |
Extract a reference to the L4 message tag from the stream. More... | |
l4_msgtag_t | send (l4_cap_idx_t dst, long proto=0, unsigned flags=0) |
Send the message via IPC to the given receiver. More... | |
Input/Output stream for IPC [un]marshalling.
The Ipc::Iostream is part of the AW Env IPC framework as well as Ipc::Istream and Ipc::Ostream. In particular an Ipc::Iostream is a combination of an Ipc::Istream and an Ipc::Ostream. It can use either a single message buffer for receiving and sending messages or a pair of a receive and a send buffer. The stream also supports combined IPC operations such as call() and reply_and_wait(), which can be used to implement RPC functionality.
Definition at line 793 of file ipc_stream.
|
inlineexplicit |
Create an IPC IO stream with a single message buffer.
utcb | The message buffer used as backing store. |
The created IO stream uses the same message buffer for sending and receiving IPC messages.
Definition at line 805 of file ipc_stream.
References L4::Ipc::Istream::tag(), and L4::Ipc::Istream::utcb().
|
inline |
Do an IPC call using the message in the output stream and receiving to the input stream.
dst | The destination L4 UID (thread) to call. |
timeout | The IPC timeout for the call. |
proto | The protocol value to use in the message tag. |
This is a combined IPC operation consisting of a send and a receive to/from the given destination dst
.
A call is usually used by clients for RPCs to a server.
Definition at line 964 of file ipc_stream.
References l4_ipc_call(), L4_IPC_NEVER, and L4::Ipc::Istream::tag().
|
inline |
Do an IPC reply and wait.
[in,out] | src_dst | Input: the destination for the send operation. Output: the source of the received message. |
proto | Protocol to use. |
This is a combined IPC operation consisting of a send operation and an open wait for any message.
A reply and wait is usually used by servers that reply to a client and wait for the next request by any other client.
Definition at line 878 of file ipc_stream.
References L4_IPC_SEND_TIMEOUT_0.
|
inline |
Do an IPC reply and wait.
[in,out] | src_dst | Input: the destination for the send operation. Output: the source of the received message. |
timeout | Timeout used for IPC. | |
proto | Protocol to use. |
This is a combined IPC operation consisting of a send operation and an open wait for any message.
A reply and wait is usually used by servers that reply to a client and wait for the next request by any other client.
Definition at line 979 of file ipc_stream.
References L4_INVALID_CAP, l4_ipc_reply_and_wait(), l4_ipc_send(), l4_ipc_send_and_wait(), L4_SYSF_REPLY, and L4::Ipc::Istream::tag().
|
inline |
Reset the stream to its initial state.
Input as well as the output stream are reset.
Definition at line 819 of file ipc_stream.
References L4::Ipc::Istream::get(), L4::Ipc::Ostream::put(), L4::Ipc::Istream::reset(), and L4::Ipc::Ostream::reset().