L4Re - L4 Runtime Environment
L4::Ipc Namespace Reference

IPC related functionality. More...

Namespaces

 Msg
 IPC Message related functionality.
 

Data Structures

struct  Array
 Array data type for dynamically sized arrays in RPCs. More...
 
struct  Array_in_buf
 Server-side copy in buffer for Array. More...
 
struct  Array_ref
 Array reference data type for arrays located in the message. More...
 
struct  As_value
 Pass the argument as plain data value. More...
 
class  Buf_item
 RPC warpper for a receive item. More...
 
struct  Call
 RPC attribute for a standard RPC call. More...
 
struct  Call_t
 RPC attribute for an RPC call with required rights. More...
 
struct  Call_zero_send_timeout
 RPC attribute for an RPC call, with zero send timeout. More...
 
class  Cap
 Capability type for RPC interfaces (see L4::Cap<T>). More...
 
class  Gen_fpage
 Generic RPC wrapper for L4 flex-pages. More...
 
struct  In_out
 Mark an argument as in-out argument. More...
 
class  Iostream
 Input/Output stream for IPC [un]marshalling. More...
 
class  Istream
 Input stream for IPC unmarshalling. More...
 
class  Msg_ptr
 Pointer to an element of type T in an Ipc::Istream. More...
 
struct  Opt
 Attribute for defining an optional RPC argument. More...
 
class  Ostream
 Output stream for IPC marshalling. More...
 
struct  Out
 Mark an argument as a output value in an RPC signature. More...
 
struct  Ret_array
 Dynamically sized output array of type T. More...
 
struct  Send_only
 RPC attribute for a send-only RPC. More...
 
class  Small_buf
 A receive item for receiving a single capability. More...
 
class  Snd_item
 RPC wrapper for a send item. More...
 
class  Str_cp_in
 Abstraction for extracting a zero-terminated string from an Ipc::Istream. More...
 
class  Varg
 Variably sized RPC argument. More...
 
class  Varg_list
 Self-contained list of variable-sized RPC parameters. More...
 
class  Varg_list_ref
 List of variable-sized RPC parameters as received by the server. More...
 

Typedefs

typedef unsigned short Array_len_default
 Default type for passing length of an array.
 
typedef Gen_fpage< Snd_itemSnd_fpage
 Send flex-page.
 
typedef Gen_fpage< Buf_itemRcv_fpage
 Rcv flex-page.
 

Functions

template<typename T >
Cap< T > make_cap (L4::Cap< T > cap, unsigned rights)
 Make an L4::Ipc::Cap<T> for the given capability and rights. More...
 
template<typename T >
Cap< T > make_cap_rw (L4::Cap< T > cap)
 Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RW rights. More...
 
template<typename T >
Cap< T > make_cap_rws (L4::Cap< T > cap)
 Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RWS rights. More...
 
template<typename T >
Cap< T > make_cap_full (L4::Cap< T > cap)
 Make an L4::IPC::Cap<T> for the given capability with full fpage and object-specific rights. More...
 
template<typename T >
Internal::Buf_cp_out< T > buf_cp_out (T const *v, unsigned long size)
 Insert an array into an Ipc::Ostream. More...
 
template<typename T >
Internal::Buf_cp_in< T > buf_cp_in (T *v, unsigned long &size)
 Extract an array from an Ipc::Istream. More...
 
template<typename T >
Str_cp_in< T > str_cp_in (T *v, unsigned long &size)
 Create a Str_cp_in for the given values. More...
 
template<typename T >
Msg_ptr< T > msg_ptr (T *&p)
 Create an Msg_ptr to adjust the given pointer. More...
 
template<typename T >
Internal::Buf_in< T > buf_in (T *&v, unsigned long &size)
 Return a pointer to stream array data. More...
 
template<typename T >
read (Istream &s)
 Read a value out of a stream. More...
 

Detailed Description

IPC related functionality.

Function Documentation

◆ buf_cp_in()

template<typename T >
Internal::Buf_cp_in<T> L4::Ipc::buf_cp_in ( T *  v,
unsigned long &  size 
)

Extract an array from an Ipc::Istream.

Parameters
vPointer to the array that shall receive the values from the Ipc::Istream.
[in,out]sizeInput: the number of elements the array can take at most
Output: the number of elements found in the stream.

buf_cp_in() can be used to extract an array from an Ipc::Istream. This is the counterpart buf_cp_out(). The data from the received message is thereby copied to the given buffer and size is set to the number of elements found in the stream. To avoid the copy operation buf_in() may be used instead.

See also
buf_in() and buf_cp_out().

Definition at line 172 of file ipc_stream.

◆ buf_cp_out()

template<typename T >
Internal::Buf_cp_out<T> L4::Ipc::buf_cp_out ( T const *  v,
unsigned long  size 
)

Insert an array into an Ipc::Ostream.

Parameters
vPointer to the array that shall be inserted into an Ipc::Ostream.
sizeNumber of elements in the array.

This function inserts an array (e.g. a string) into an Ipc::Ostream. The data is copied to the stream. On insertion into the Ipc::Ostream exactly the given number of elements of type T are copied to the message buffer, this means the source buffer is no longer referenced after insertion into the stream.

See also
The counterpart is either buf_cp_in() or buf_in().

Definition at line 113 of file ipc_stream.

◆ buf_in()

template<typename T >
Internal::Buf_in<T> L4::Ipc::buf_in ( T *&  v,
unsigned long &  size 
)

Return a pointer to stream array data.

Parameters
[out]vPointer to the array within the Ipc::Istream.
[out]sizeThe number of elements found in the stream.

This routine provdes a possibility to extract an array from an Ipc::Istream, without extra copy overhead. In contrast to buf_cp_in() the data is not copied to a buffer, but a pointer to the array is returned. The user must make sure the UTCB is not used for other purposes while the returned pointer is still in use.

The mechanism is comparable to that of Msg_ptr, however it handles arrays inserted with buf_cp_out().

See also
buf_cp_in() and buf_cp_out().

Definition at line 323 of file ipc_stream.

◆ make_cap()

template<typename T >
Cap<T> L4::Ipc::make_cap ( L4::Cap< T >  cap,
unsigned  rights 
)

Make an L4::Ipc::Cap<T> for the given capability and rights.

Template Parameters
T(IMPLICIT) type of the referenced interface
Parameters
capsource capability (L4::Cap<T>)
rightsrights mask that shall be applied on transfer.

Definition at line 624 of file ipc_types.

◆ make_cap_full()

template<typename T >
Cap<T> L4::Ipc::make_cap_full ( L4::Cap< T >  cap)

Make an L4::IPC::Cap<T> for the given capability with full fpage and object-specific rights.

Template Parameters
T(implicit) type of the referenced interface
Parameters
capsource capability (L4::Cap<T>)
See also
L4_cap_fpage_rights
L4_obj_fpage_ctl
Note
Full rights (including object-specific rights) are required when mapping an IPC gate where the receiver should become the server, i.e. where the receiver wants to call L4::Ipc_gate::bind_thread().

Definition at line 662 of file ipc_types.

◆ make_cap_rw()

template<typename T >
Cap<T> L4::Ipc::make_cap_rw ( L4::Cap< T >  cap)

Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RW rights.

Template Parameters
T(IMPLICIT) type of the referenced interface
Parameters
capsource capability (L4::Cap<T>)
Examples:
examples/libs/l4re/c++/mem_alloc/ma+rm.cc, examples/libs/l4re/c++/shared_ds/ds_clnt.cc, and examples/libs/l4re/c++/shared_ds/ds_srv.cc.

Definition at line 634 of file ipc_types.

◆ make_cap_rws()

template<typename T >
Cap<T> L4::Ipc::make_cap_rws ( L4::Cap< T >  cap)

Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RWS rights.

Template Parameters
T(IMPLICIT) type of the referenced interface
Parameters
capsource capability (L4::Cap<T>)

Definition at line 644 of file ipc_types.

◆ msg_ptr()

template<typename T >
Msg_ptr<T> L4::Ipc::msg_ptr ( T *&  p)

Create an Msg_ptr to adjust the given pointer.

This function makes it more convenient to extract pointers to data in the message buffer itself from an Ipc::Istream. This may be used to avoid copy out of large data structures. (See Msg_ptr.)

Definition at line 265 of file ipc_stream.

◆ read()

template<typename T >
T L4::Ipc::read ( Istream s)
inline

Read a value out of a stream.

Parameters
sAn Istream.
Returns
The value of type T.

The stream position is progressed accordingly.

Definition at line 1394 of file ipc_stream.

◆ str_cp_in()

template<typename T >
Str_cp_in<T> L4::Ipc::str_cp_in ( T *  v,
unsigned long &  size 
)

Create a Str_cp_in for the given values.

Parameters
vPointer to the array that shall receive the values from the Ipc::Istream.
[in,out]sizeInput: the number of elements the array can take at most
Output: the number of elements found in the stream.

This function makes it more convenient to extract arrays from an Ipc::Istream (

See also
Str_cp_in.)

Definition at line 226 of file ipc_stream.