|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Helpers for exposing field offsets and structure sizes into assembly. More...
Go to the source code of this file.
Classes | |
| struct | CheckSize< Real, Expected > |
| Helper class for checking the size of a structure. More... | |
Macros | |
| #define | EXPORT_ASSEMBLY_NAME(name, val) |
| Export a macro into assembly named name with value value. | |
| #define | EXPORT_ASSEMBLY_EXPRESSION(name, expression, val) |
| Export a macro into assembly named name with value value. | |
| #define | EXPORT_ASSEMBLY_OFFSET(structure, field, val) |
| Export a macro into assembly of the form {structure}_offset_{field}. | |
| #define | EXPORT_ASSEMBLY_OFFSET_NAMED(structure, field, value, name) |
| Variant of EXPORT_ASSEMBLY_OFFSET that can be used to specify the name of the exported offset. | |
| #define | EXPORT_ASSEMBLY_SIZE(structure, val) |
| Export a macro into assembly of the form {structure}_size. | |
Helpers for exposing field offsets and structure sizes into assembly.
This file provides macros that should be included in both C++ and assembly files. In C++, they will check (at compile time) that the values are correct and print a helpful error message if they do not. In assembly, they will simply expose the values as assembler symbol definitions.
Definition in file assembly-helpers.h.
| #define EXPORT_ASSEMBLY_EXPRESSION | ( | name, | |
| expression, | |||
| val ) |
Export a macro into assembly named name with value value.
In C++, this macro will report an error if the provided value does not equal the constexpr evaluation of expression.
Definition at line 41 of file assembly-helpers.h.
| #define EXPORT_ASSEMBLY_NAME | ( | name, | |
| val ) |
Export a macro into assembly named name with value value.
In C++, this macro will report an error if the provided value does not equal the constexpr evaluation of expression.
Definition at line 32 of file assembly-helpers.h.
| #define EXPORT_ASSEMBLY_OFFSET | ( | structure, | |
| field, | |||
| val ) |
Export a macro into assembly of the form {structure}_offset_{field}.
The value of this macro will be value. In C++, this macro will report an error if the provided value does not match the compiler's understanding of the field offset. The error message will contain the correct value.
This macros also defines a static constexpr value of the same name as the assembly definition.
Definition at line 55 of file assembly-helpers.h.
| #define EXPORT_ASSEMBLY_OFFSET_NAMED | ( | structure, | |
| field, | |||
| value, | |||
| name ) |
Variant of EXPORT_ASSEMBLY_OFFSET that can be used to specify the name of the exported offset.
This is useful for providing the offset of fields in nested structures when assembly code does not need to know the shape of the overall structure, only the offset of various fields.
This macros also defines a static constexpr value of the same name as the assembly definition.
Definition at line 69 of file assembly-helpers.h.
| #define EXPORT_ASSEMBLY_SIZE | ( | structure, | |
| val ) |
Export a macro into assembly of the form {structure}_size.
The value of this macro will be value. In C++, this macro will report an error if the provided value does not match the compiler's understanding of the structure size. The error message will contain the correct value.
This macros also defines a static constexpr value of the same name as the assembly definition.
Definition at line 81 of file assembly-helpers.h.