CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
Multi-field utility macros
Collaboration diagram for Multi-field utility macros:

Topics

 Internal helpers
 Macros_vararg_internal
 

Macros

#define BITPACK_WITHS(b, ...)
 Construct a chain of .with() whose arguments are all qualified with the type of the bitpack.
#define BITPACK_WITHS_DECLTYPE(b, ...)
 A version of BITPACK_WITHS where the arguments to .with() are qualified with the type of the bitpack.
#define BITPACK_WITHS_DEPENDENT(b, ...)
 A version of BITPACK_WITHS where the arguments to .with() are dependently qualified with the type of the bitpack.
#define BITPACK_RELATE_MASKED(b, operator, ...)
 Given a list of field values (which must be fully qualified names), compute the mask of these fields and the bitpack value holding these field values, then mask b with the computed mask, and then use operator to relate the result with the computed bitpack value.
#define BITPACK_RELATE_MASKED_DECLTYPE(b, operator, ...)
 A version of BITPACK_RELATE_MASKED where the field values are qualified with the type of the bitpack.
#define BITPACK_RELATE_MASKED_DEPENDENT(b, operator, ...)
 A version of BITPACK_RELATE_MASKED where the field values are dependently qualified with the type of the bitpack.

Detailed Description

Macro Definition Documentation

◆ BITPACK_RELATE_MASKED

#define BITPACK_RELATE_MASKED ( b,
operator,
... )
Value:
({ \
static_assert(BITPACK_HAS_MACRO_MAP, \
"BITPACK_MASKED_REL requires __macro_map.h"); \
constexpr decltype(b.raw()) __bitpack_mask = \
(0)CHERIOT_MAP_UD(BITPACK_RELATE_MASKED_HELPER, b, __VA_ARGS__); \
constexpr auto __bitpack_query = \
BITPACK_WITHS((decltype(b))(0), __VA_ARGS__).raw(); \
(b.raw() & __bitpack_mask) operator(__bitpack_query); \
})
#define BITPACK_HAS_MACRO_MAP
An in-situ probe for the include-sion of <__macro_map.h>.
Definition bitpack.hh:1352
#define BITPACK_RELATE_MASKED_HELPER(x, b)
Helper for BITPACK_RELATE_MASKED, for computing individual field's masks.
Definition bitpack.hh:1433

Given a list of field values (which must be fully qualified names), compute the mask of these fields and the bitpack value holding these field values, then mask b with the computed mask, and then use operator to relate the result with the computed bitpack value.

The last value for each field is used. #include <__macro_map.h> if you want to use this.

Definition at line 1449 of file bitpack.hh.

◆ BITPACK_RELATE_MASKED_DECLTYPE

#define BITPACK_RELATE_MASKED_DECLTYPE ( b,
operator,
... )
Value:
BITPACK_RELATE_MASKED(b, operator, BITPACK_MAP_DECLTYPE(b, __VA_ARGS__))
#define BITPACK_MAP_DECLTYPE(b,...)
Given bitpack b, qualify each additional argument with decltype(b).
Definition bitpack.hh:1380
#define BITPACK_RELATE_MASKED(b, operator,...)
Given a list of field values (which must be fully qualified names), compute the mask of these fields ...
Definition bitpack.hh:1449

A version of BITPACK_RELATE_MASKED where the field values are qualified with the type of the bitpack.

Definition at line 1464 of file bitpack.hh.

◆ BITPACK_RELATE_MASKED_DEPENDENT

#define BITPACK_RELATE_MASKED_DEPENDENT ( b,
operator,
... )
Value:
BITPACK_RELATE_MASKED(b, operator, BITPACK_MAP_DEPENDENT(b, __VA_ARGS__))
#define BITPACK_MAP_DEPENDENT(b,...)
Given bitpack b, qualify each additional argument with typename decltype(b).
Definition bitpack.hh:1394

A version of BITPACK_RELATE_MASKED where the field values are dependently qualified with the type of the bitpack.

Definition at line 1471 of file bitpack.hh.

◆ BITPACK_WITHS

#define BITPACK_WITHS ( b,
... )
Value:
({ \
static_assert(BITPACK_HAS_MACRO_MAP, \
"BITPACK_WITHS requires __macro_map.h"); \
(b) CHERIOT_MAP(BITPACK_MAP_WITHS_HELPER, __VA_ARGS__); \
})
#define BITPACK_MAP_WITHS_HELPER(x)
Map function for BITPACK_WITHS.
Definition bitpack.hh:1398

Construct a chain of .with() whose arguments are all qualified with the type of the bitpack.

#include <__macro_map.h> if you want to use this.

Definition at line 1406 of file bitpack.hh.

◆ BITPACK_WITHS_DECLTYPE

#define BITPACK_WITHS_DECLTYPE ( b,
... )
Value:
#define BITPACK_WITHS(b,...)
Construct a chain of .with() whose arguments are all qualified with the type of the bitpack.
Definition bitpack.hh:1406

A version of BITPACK_WITHS where the arguments to .with() are qualified with the type of the bitpack.

Definition at line 1417 of file bitpack.hh.

◆ BITPACK_WITHS_DEPENDENT

#define BITPACK_WITHS_DEPENDENT ( b,
... )
Value:

A version of BITPACK_WITHS where the arguments to .with() are dependently qualified with the type of the bitpack.

Definition at line 1424 of file bitpack.hh.