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:
({ \
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_RELATE_MASKED_HELPER(x, b)
Helper for BITPACK_RELATE_MASKED, for computing individual field's masks.
Definition bitpack.hh:1387

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.

Definition at line 1403 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:1340
#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:1403

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

Definition at line 1416 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:1352

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

Definition at line 1423 of file bitpack.hh.

◆ BITPACK_WITHS

#define BITPACK_WITHS ( b,
... )
Value:
(b) CHERIOT_MAP(BITPACK_MAP_WITHS_HELPER, __VA_ARGS__)
#define BITPACK_MAP_WITHS_HELPER(x)
Map function for BITPACK_WITHS.
Definition bitpack.hh:1356

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

Definition at line 1364 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:1364

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

Definition at line 1371 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 1378 of file bitpack.hh.