L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Ipc Namespace Reference

IPC related functionality. More...

Namespaces

namespace  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...
 
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 base 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...
 
class  Rcv_fpage
 Rcv flex-page. 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 object capability. More...
 
class  Snd_fpage
 Send flex-page. 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.
 

Functions

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

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 170 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 111 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 321 of file ipc_stream.

◆ make_cap()

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

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 649 of file ipc_types.

Referenced by L4virtio::Svr::Driver_mem_region_t< DATA >::Driver_mem_region_t().

+ Here is the caller graph for this function:

◆ make_cap_full()

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

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 687 of file ipc_types.

References L4_CAP_FPAGE_RWSD, and L4_FPAGE_C_OBJ_RIGHTS.

◆ make_cap_rw()

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

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 659 of file ipc_types.

References L4_CAP_FPAGE_RW.

Referenced by L4Re::Util::Event_buffer_t< PAYLOAD >::attach(), L4virtio::Driver::Device::driver_connect(), L4Re::Util::Event_t< PAYLOAD >::init(), L4Re::Util::Event_t< PAYLOAD >::init_poll(), L4virtio::Driver::Device::register_ds(), L4virtio::Driver::Virtio_net_device::setup_device(), and L4virtio::Driver::Block_device::setup_device().

+ Here is the caller graph for this function:

◆ make_cap_rws()

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

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 669 of file ipc_types.

References L4_CAP_FPAGE_RWS.

◆ 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 263 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 1300 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 224 of file ipc_stream.