L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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

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

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]

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

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.

References align_to().

+ Here is the call graph for this function:

◆ align_to() [2/2]

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

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.

Referenced by align_to().

+ Here is the caller graph for this function:

◆ check_size() [1/2]

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

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 
)
inlinenoexcept

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.

References L4_UNLIKELY.

◆ msg_add()

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

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.

References L4_EMSGTOOLONG, and L4_UNLIKELY.

◆ msg_get()

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

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.

References L4_EMSGTOOSHORT, and L4_UNLIKELY.