Loading...
Searching...
No Matches
L4::Ipc::Msg Namespace Reference

IPC Message related functionality. More...

## Data Structures

struct | Elem< Array< A, LEN > >
| Array as input arguments. More...
struct | Elem< Array< A, LEN > & >
| Array as output argument. More...
struct | Elem< Array_ref< A, LEN > & >
| Array_ref as output argument. More...
struct | Dir_in
| Marker type for input values. More...
struct | Dir_out
| Marker type for output values. More...
struct | Cls_data
| Marker type for data values. More...
struct | Cls_item
| Marker type for item values. More...
struct | Cls_buffer
| Marker type for receive buffer values. More...
struct | Do_in_data
| Marker for Input data. More...
struct | Do_out_data
| Marker for Output data. More...
struct | Do_in_items
| Marker for Input items. More...
struct | Do_out_items
| Marker for Output items. More...
struct | Do_rcv_buffers
| Marker for receive buffers. More...
struct | Svr_val_ops
| Defines client-side handling of `MTYPE' as RPC 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 | True
| True meta value. More...
struct | False
| False meta value. 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 85 of file ipc_basics.

## Function Documentation

## align_to() [1/2]

template<typename T>

unsigned long L4::Ipc::Msg::align_to | ( | unsigned long | bytes | ) |

constexprnoexcept

Pad bytes to the alignment of the type T.

Template Parameters

  T | The data type used for the alignment

Parameters

  bytes | The value to add the padding to

Returns
  bytes padded to achieve the alignment of T.

Definition at line 40 of file ipc_basics.

References align_to().

Here is the call graph for this function:

## align_to() [2/2]

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

constexprnoexcept

Pad bytes to the given alignment align (in bytes).

Parameters

  bytes | The input value in bytes
  align | The alignment value in bytes

Returns
  the result after padding bytes to align.

Definition at line 30 of file ipc_basics.

Referenced by align_to(), msg_add(), and msg_get().

Here is the caller graph for this function:

## check_size() [1/2]

template<typename T>

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

  T | The data type that shall be fitted at offset

Parameters

  offset | The current offset in bytes (must already be padded if desired).
  limit | The 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 53 of file ipc_basics.

Referenced by msg_add(), and msg_get().

Here is the caller graph for this function:

## 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

  T | The data type that shall be fitted at offset
  CTYPE | Type of the cnt parameter

Parameters

  offset | The current offset in bytes (must already be padded if desired).
  limit | The limit in bytes that must not be exceeded after adding cnt times the size of T.
  cnt | The 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 71 of file ipc_basics.

References L4_UNLIKELY.

## msg_add()

template<typename T>

int L4::Ipc::Msg::msg_add | ( | char * | msg,
|  | unsigned | offs,
|  | unsigned | limit,
|  | T | v )

inlinenoexcept

Add some data to a message at offs.

Template Parameters

  T | The type of the data to add

Parameters

  msg | pointer to the start of the message
  offs | The current offset within the message, this shall be padded to the alignment of T if v is added.
  limit | The size limit in bytes that offset must not exceed.
  v | The 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 114 of file ipc_basics.

References align_to(), check_size(), L4_EMSGTOOLONG, and L4_UNLIKELY.

Here is the call graph for this function:

## 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

  T | The type of the data to read

Parameters

  msg | Pointer to the start of the message
  offs | The current offset within the message, this shall be padded to the alignment of T if a v can be read.
  limit | The size limit in bytes that offset must not exceed.
  v | A 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 135 of file ipc_basics.

References align_to(), check_size(), L4_EMSGTOOSHORT, and L4_UNLIKELY.

Here is the call graph for this function: