L4Re - L4 Runtime Environment
L4::Ipc::Msg Namespace Reference

IPC Message related functionality. More...

Data Structures

struct  Clnt_val_ops
 Defines client-side handling of `MTYPE' as RPC argument. More...
 
struct  Cls_buffer
 Marker type for receive buffer values. More...
 
struct  Cls_data
 Marker type for data values. More...
 
struct  Cls_item
 Marker type for item values. More...
 
struct  Dir_in
 Marker type for input values. More...
 
struct  Dir_out
 Marker type for output values. More...
 
struct  Do_in_data
 Marker for Input data. More...
 
struct  Do_in_items
 Marker for Input items. More...
 
struct  Do_out_data
 Marker for Output data. More...
 
struct  Do_out_items
 Marker for Output items. More...
 
struct  Do_rcv_buffers
 Marker for receive buffers. More...
 
struct  Elem< Array< A, LEN > &>
 Array as output argument. More...
 
struct  Elem< Array< A, LEN > >
 Array as input arguments. More...
 
struct  Elem< Array_ref< A, LEN > &>
 Array_ref as output argument. More...
 
struct  Is_valid_rpc_type
 Type trait defining a valid RPC parameter type. More...
 
struct  Svr_arg_pack
 Server-side RPC arguments data structure used to provide arguments to the server-side implementation of an RPC function. More...
 
struct  Svr_val_ops
 Defines server-side handling for MTYPE server arguments. More...
 

Enumerations

enum  {
  Word_bytes = sizeof(l4_umword_t), Item_words = 2, Item_bytes = Word_bytes * Item_words, Mr_words = L4_UTCB_GENERIC_DATA_SIZE,
  Mr_bytes = Word_bytes * Mr_words, Br_bytes = Word_bytes * L4_UTCB_GENERIC_BUFFERS_SIZE
}
 

Functions

unsigned long align_to (unsigned long bytes, unsigned long align)
 Pad bytes to the given alignment align (in bytes) More...
 
template<typename T >
unsigned long align_to (unsigned long bytes)
 Pad bytes to the alignment of the type T. More...
 
template<typename T >
bool check_size (unsigned offset, unsigned limit)
 Check if there is enough space for T from offset to limit. More...
 
template<typename T , typename CTYPE >
bool check_size (unsigned offset, unsigned limit, CTYPE cnt)
 Check if there is enough space for an array of T from offset to limit. More...
 
template<typename T >
int msg_add (char *msg, unsigned offs, unsigned limit, T v)
 Add some data to a message at offs. More...
 
template<typename T >
int msg_get (char *msg, unsigned offs, unsigned limit, T &v)
 Get some data from a message at offs. More...
 

Detailed Description

IPC Message related functionality.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Word_bytes 

number of bytes for one message word

Item_words 

number of message words for one message item

Item_bytes 

number of bytes for one message item

Mr_words 

number of message words available in the UTCB

Mr_bytes 

number of bytes available in the UTCB message registers

Br_bytes 

number of bytes available in the UTCB buffer registers

Definition at line 96 of file ipc_basics.

Function Documentation

◆ align_to() [1/2]

unsigned long L4::Ipc::Msg::align_to ( unsigned long  bytes,
unsigned long  align 
)
inline

Pad bytes to the given alignment align (in bytes)

Parameters
bytesThe input value in bytes
alignThe alignment value in bytes
Returns
the result after padding bytes to align.

Definition at line 41 of file ipc_basics.

◆ align_to() [2/2]

template<typename T >
unsigned long L4::Ipc::Msg::align_to ( unsigned long  bytes)
inline

Pad bytes to the alignment of the type T.

Template Parameters
TThe data type used for the alignment
Parameters
bytesThe value to add the padding to
Returns
bytes padded to achieve the alignment of T.

Definition at line 51 of file ipc_basics.

◆ check_size() [1/2]

template<typename T >
bool L4::Ipc::Msg::check_size ( unsigned  offset,
unsigned  limit 
)
inline

Check if there is enough space for T from offset to limit.

Template Parameters
TThe data type that shall be fitted at offset
Parameters
offsetThe current offset in bytes (must already be padded if desired).
limitThe limit in bytes that must not be exceeded after adding the size of T.
Returns
true if the limit will not be exceeded, false else.

Definition at line 64 of file ipc_basics.

◆ check_size() [2/2]

template<typename T , typename CTYPE >
bool L4::Ipc::Msg::check_size ( unsigned  offset,
unsigned  limit,
CTYPE  cnt 
)
inline

Check if there is enough space for an array of T from offset to limit.

Template Parameters
TThe data type that shall be fitted at offset
CTYPEType of the cnt parameter
Parameters
offsetThe current offset in bytes (must already be padded if desired).
limitThe limit in bytes that must not be exceeded after adding cnt times the size of T.
cntThe number of elements of type T that shall be put at offset.
Returns
true if the limit will not be exceeded, false else.

Definition at line 82 of file ipc_basics.

◆ msg_add()

template<typename T >
int L4::Ipc::Msg::msg_add ( char *  msg,
unsigned  offs,
unsigned  limit,
v 
)
inline

Add some data to a message at offs.

Template Parameters
TThe type of the data to add
Parameters
msgpointer to the start of the message
offsThe current offset within the message, this shall be padded to the alignment of T if v is added.
limitThe size limit in bytes that offset must not exceed.
vThe value to add to the message
Returns
The new offset when successful, a negative value if the given limit will be exceeded.

Definition at line 125 of file ipc_basics.

◆ msg_get()

template<typename T >
int L4::Ipc::Msg::msg_get ( char *  msg,
unsigned  offs,
unsigned  limit,
T &  v 
)
inline

Get some data from a message at offs.

Template Parameters
TThe type of the data to read
Parameters
msgPointer to the start of the message
offsThe current offset within the message, this shall be padded to the alignment of T if a v can be read.
limitThe size limit in bytes that offset must not exceed.
vA reference to receive the value from the message
Returns
The new offset when successful, a negative value if the given limit will be exceeded.

Definition at line 146 of file ipc_basics.