Generic preprocessor macros that don't really fit anywhere else. More...
Go to the source code of this file.
Data Structures | |
struct | OtSignConversionUnsupportedType |
Macros | |
#define | ARRAYSIZE(array) (sizeof(array) / sizeof(array[0])) |
Computes the number of elements in the given array. More... | |
#define | OT_FALLTHROUGH_INTENDED __attribute__((fallthrough)) |
An annotation that a switch/case fallthrough is the intended behavior. | |
#define | OT_ALWAYS_INLINE __attribute__((always_inline)) inline |
A directive to force the compiler to inline a function. | |
#define | OT_RESTRICT __restrict__ |
The restrict keyword is C specific, so we provide a C++-portable wrapper that uses the GCC name. More... | |
#define | OT_STRINGIFY(a) OT_STRINGIFY_(a) |
An argument stringification macro. | |
#define | OT_STRINGIFY_(a) #a |
#define | OT_VA_ARGS_COUNT(dummy, ...) |
A variable-argument macro that expands to the number of arguments passed into it, between 0 and 31 arguments. More... | |
#define | OT_SHIFT_N_VARIABLE_ARGS_(...) OT_GET_NTH_VARIABLE_ARG_(__VA_ARGS__) |
#define | OT_GET_NTH_VARIABLE_ARG_(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, n, ...) n |
#define | OT_CAT(a, ...) OT_PRIMITIVE_CAT(a, __VA_ARGS__) |
An argument concatenation macro. More... | |
#define | OT_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__ |
#define | OT_GET_ARG(n, ...) OT_CAT(OT_CAT(OT_GET_ARG_, n), _)(__VA_ARGS__) |
A macro which gets the nth arg from a VA_LIST | |
#define | OT_GET_LAST_ARG(...) OT_GET_ARG(OT_VA_ARGS_COUNT(__VA_ARGS__), ##__VA_ARGS__) |
A macro which gets the last arg from a VA_LIST More... | |
#define | OT_GET_ARG_0_(x0, ...) x0 |
The following collection of OT_GET_ARG macros are used to construct the generic "get nth arg" macro. | |
#define | OT_GET_ARG_1_(x1, x0, ...) x0 |
#define | OT_GET_ARG_2_(x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_3_(x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_4_(x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_5_(x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_6_(x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_7_(x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_8_(x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_9_(x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_10_(x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_11_(x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_12_(x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_13_(x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_14_(x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_15_(x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_16_(x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_17_(x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_18_(x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_19_(x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_20_(x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_21_(x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_22_(x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_23_(x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_24_(x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_25_(x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_26_(x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_27_(x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_28_(x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_29_(x29, x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_30_(x30, x29, x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_GET_ARG_31_(x31, x30, x29, x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 |
#define | OT_ASSERT_MEMBER_OFFSET(type, member, offset) |
A macro that expands to an assertion for the offset of a struct member. More... | |
#define | OT_ASSERT_MEMBER_OFFSET_AS_ENUM(type, member, enum_offset) |
A macro that expands to an assertion for the offset of a struct member. More... | |
#define | OT_ASSERT_MEMBER_SIZE(type, member, size) |
A macro that expands to an assertion for the size of a struct member. More... | |
#define | OT_ASSERT_MEMBER_SIZE_AS_ENUM(type, member, enum_size) |
A macro that expands to an assertion for the size of a struct member. More... | |
#define | OT_ASSERT_SIZE(type, size) static_assert(sizeof(type) == UINT32_C(size), "Unexpected size for " #type) |
A macro that expands to an assertion for the size of a type. More... | |
#define | OT_ASSERT_ENUM_VALUE(var, expected_value) static_assert(var == expected_value, "Unexpected value for " #var) |
A macro that expands to an assertion for an expected enum value. More... | |
#define | OT_VA_FOR_EACH(action, ...) |
A variable-argument macro that expands to the number of arguments passed into it, between 1 and 32 arguments (1 action and 0-31 others). More... | |
#define | OT_VA_FOR_EACH_0_(action) |
The following collection of OT_VA_FOR_EACH macros are used to construct the generic "for each" OT_VA_FOR_EACH macro. | |
#define | OT_VA_FOR_EACH_1_(action, item, ...) |
#define | OT_VA_FOR_EACH_2_(action, item, ...) |
#define | OT_VA_FOR_EACH_3_(action, item, ...) |
#define | OT_VA_FOR_EACH_4_(action, item, ...) |
#define | OT_VA_FOR_EACH_5_(action, item, ...) |
#define | OT_VA_FOR_EACH_6_(action, item, ...) |
#define | OT_VA_FOR_EACH_7_(action, item, ...) |
#define | OT_VA_FOR_EACH_8_(action, item, ...) |
#define | OT_VA_FOR_EACH_9_(action, item, ...) |
#define | OT_VA_FOR_EACH_10_(action, item, ...) |
#define | OT_VA_FOR_EACH_11_(action, item, ...) |
#define | OT_VA_FOR_EACH_12_(action, item, ...) |
#define | OT_VA_FOR_EACH_13_(action, item, ...) |
#define | OT_VA_FOR_EACH_14_(action, item, ...) |
#define | OT_VA_FOR_EACH_15_(action, item, ...) |
#define | OT_VA_FOR_EACH_16_(action, item, ...) |
#define | OT_VA_FOR_EACH_17_(action, item, ...) |
#define | OT_VA_FOR_EACH_18_(action, item, ...) |
#define | OT_VA_FOR_EACH_19_(action, item, ...) |
#define | OT_VA_FOR_EACH_20_(action, item, ...) |
#define | OT_VA_FOR_EACH_21_(action, item, ...) |
#define | OT_VA_FOR_EACH_22_(action, item, ...) |
#define | OT_VA_FOR_EACH_23_(action, item, ...) |
#define | OT_VA_FOR_EACH_24_(action, item, ...) |
#define | OT_VA_FOR_EACH_25_(action, item, ...) |
#define | OT_VA_FOR_EACH_26_(action, item, ...) |
#define | OT_VA_FOR_EACH_27_(action, item, ...) |
#define | OT_VA_FOR_EACH_28_(action, item, ...) |
#define | OT_VA_FOR_EACH_29_(action, item, ...) |
#define | OT_VA_FOR_EACH_30_(action, item, ...) |
#define | OT_VA_FOR_EACH_31_(action, item, ...) |
#define | OT_CHECK_NOT_INT64(arg) _Generic((arg), int64_t: false, uint64_t: false, default: true) |
A macro that checks whether a specified argument is not a standard C integer type with a width of 64 bits. More... | |
#define | OT_FAIL_IF_64_BIT(arg, func_name) |
A macro that expands to an assertion that wraps the OT_CHECK_NOT_INT64 macro, failing with a relevant error message if the provided argument is a standard C integer type with a width of 64 bits. More... | |
#define | OT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
A macro representing the OpenTitan execution platform. More... | |
#define | OT_WEAK __attribute__((weak)) |
Attribute for weak functions that can be overridden, e.g., ISRs. | |
#define | OT_NAKED __attribute__((naked)) |
Attribute to construct functions without prologue/epilogue sequences. More... | |
#define | OT_SECTION(name) __attribute__((section(name))) |
Attribute to place symbols into particular sections. More... | |
#define | OT_SET_BSS_SECTION(name, ...) |
Pragma meant to place symbols into a NOBITS section with a specified name. More... | |
#define | OT_SET_BSS_SECTION_(section) _Pragma(#section) |
#define | OT_NOINLINE __attribute__((noinline)) |
Attribute to suppress the inlining of a function at its call sites. More... | |
#define | OT_FRAME_ADDR() __builtin_frame_address(0) |
Returns the address of the current function stack frame. More... | |
#define | OT_UNREACHABLE() __builtin_unreachable() |
Hints to the compiler that some point is not reachable. More... | |
#define | OT_ALIAS(name) __attribute__((alias(name))) |
Attribute for weak alias that can be overridden, e.g., Mock overrides in DIFs. | |
#define | OT_ADDRESSABLE_LABEL(kName_) |
Defines a local symbol named kName_ whose address resolves to the program counter value an inline assembly block at this location would see. More... | |
#define | OT_DISCARD(expr_) |
Evaluates and discards expr_ . More... | |
#define | OT_USED __attribute__((used)) |
An attribute used for static variables indicating that they should be retained in the object file, even if they are seemingly unreferenced. | |
#define | OT_BUILD_FOR_STATIC_ANALYZER 0 |
OT_BUILD_FOR_STATIC_ANALYZER indicates whether we are compiling for the purpose of static analysis. More... | |
#define | OT_ALIGN_MEM(x) (uint32_t)(4 + (((uintptr_t)(x)-1) & ~3u)) |
This macro is used to align an offset to point to a 32b value. | |
#define | OT_SIGNED(value) |
This macro converts a given unsigned integer value to its signed counterpart. More... | |
#define | OT_UNSIGNED(value) |
This macro converts a given signed integer value to its unsigned counterpart. More... | |
#define | ATOMIC_WAIT_FOR_INTERRUPT(_volatile_condition) |
#define | OT_WORD_SIZE 4 |
Macros for implementing OT ISRs. | |
#define | OT_HALF_WORD_SIZE (OT_WORD_SIZE / 2) |
#define | OT_CONTEXT_SIZE (OT_WORD_SIZE * 30) |
Generic preprocessor macros that don't really fit anywhere else.
Definition in file macros.h.
struct OtSignConversionUnsupportedType |
#define ARRAYSIZE | ( | array | ) | (sizeof(array) / sizeof(array[0])) |
Computes the number of elements in the given array.
Note that this can only determine the length of fixed-size arrays. Due to limitations of C, it will incorrectly compute the size of an array passed as a function argument, because those automatically decay into pointers. This function can only be used correctly with:
array | The array expression to measure. |
size_t
. #define ATOMIC_WAIT_FOR_INTERRUPT | ( | _volatile_condition | ) |
#define OT_ADDRESSABLE_LABEL | ( | kName_ | ) |
Defines a local symbol named kName_
whose address resolves to the program counter value an inline assembly block at this location would see.
The primary intention of this macro is to allow for peripheral tests to be written that want to assert that a specific program counter reported by the hardware corresponds to actual code that executed.
For example, suppose that we're waiting for an interrupt to fire, and want to verify that it fired in a specific region. We have two volatile globals: irq_happened
, which the ISR sets before returning, and irq_pc
, which the ISR sets to whatever PC the hardware reports it came from. The code below tests that the reported PC matches expectations.
Note that this only works if all functions called between the two labels are actually inlined; if the interrupt fires inside of one of those two functions, it will appear to not have the right PC, even though it is logically inside the pair of labels.
This has the same semantics as a volatile
inline assembly block: it may be reordered with respect to all operations except other volatile operations (i.e. volatile assembly and volatile read/write, such as MMIO). For example, in the following code, kBefore
and kAfter
can wind up having the same address:
Because it can be reordered and the compiler is free to emit whatever instructions it likes, comparing a program counter value obtained from the hardware with a symbol emitted by this macro is brittle (and, ultimately, futile). Instead, it should be used in pairs to create a range of addresses that a value can be checked for being within.
For this primitive to work correctly there must be something that counts as a volatile operation between the two labels. These include:
LOG
ging, printf
ing, or CHECK
ing.wait_for_interrupt()
.barrier32()
, but NOT launder32()
.This macro should not be used on the host side. It will compile, but will probably not provide any meaningful values. In the future, it may start producing a garbage value on the host side.
The symbol reference kName_
will only be scoped to the current block in a function, but it can be redeclared in the same file with
if needed elsewhere (although this should be avoided for readability's sake). The name of the constant is global to the current .c
file only.
#define OT_ASSERT_ENUM_VALUE | ( | var, | |
expected_value | |||
) | static_assert(var == expected_value, "Unexpected value for " #var) |
#define OT_ASSERT_MEMBER_OFFSET | ( | type, | |
member, | |||
offset | |||
) |
A macro that expands to an assertion for the offset of a struct member.
type | A struct type. |
member | A member of the struct. |
offset | Expected offset of the member. |
#define OT_ASSERT_MEMBER_OFFSET_AS_ENUM | ( | type, | |
member, | |||
enum_offset | |||
) |
A macro that expands to an assertion for the offset of a struct member.
type | A struct type. |
member | A member of the struct. |
enum_offset | Expected offset of the member as an enum constant. |
#define OT_ASSERT_MEMBER_SIZE | ( | type, | |
member, | |||
size | |||
) |
A macro that expands to an assertion for the size of a struct member.
type | A struct type. |
member | A member of the struct. |
size | Expected size of the type. |
#define OT_ASSERT_MEMBER_SIZE_AS_ENUM | ( | type, | |
member, | |||
enum_size | |||
) |
A macro that expands to an assertion for the size of a struct member.
Identical to OT_ASSERT_MEMBER_SIZE
, except the size parameter is provided as an enum constant.
type | A struct type. |
member | A member of the struct. |
enum_size | Expected size of the type as an enum constant. |
#define OT_ASSERT_SIZE | ( | type, | |
size | |||
) | static_assert(sizeof(type) == UINT32_C(size), "Unexpected size for " #type) |
#define OT_BUILD_FOR_STATIC_ANALYZER 0 |
#define OT_CAT | ( | a, | |
... | |||
) | OT_PRIMITIVE_CAT(a, __VA_ARGS__) |
#define OT_CHECK_NOT_INT64 | ( | arg | ) | _Generic((arg), int64_t: false, uint64_t: false, default: true) |
#define OT_DISCARD | ( | expr_ | ) |
#define OT_FAIL_IF_64_BIT | ( | arg, | |
func_name | |||
) |
A macro that expands to an assertion that wraps the OT_CHECK_NOT_INT64
macro, failing with a relevant error message if the provided argument is a standard C integer type with a width of 64 bits.
arg | An argument/expression to check |
func_name | The name of the macro/functionality being invoked, to be printed in a relevant error if the assertion fails. |
#define OT_FRAME_ADDR | ( | ) | __builtin_frame_address(0) |
Returns the address of the current function stack frame.
#define OT_GET_LAST_ARG | ( | ... | ) | OT_GET_ARG(OT_VA_ARGS_COUNT(__VA_ARGS__), ##__VA_ARGS__) |
#define OT_NAKED __attribute__((naked)) |
Attribute to construct functions without prologue/epilogue sequences.
Only basic asm statements can be safely included in naked functions.
See https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Function-Attributes.html #RISC-V-Function-Attributes
#define OT_NOINLINE __attribute__((noinline)) |
Attribute to suppress the inlining of a function at its call sites.
See https://clang.llvm.org/docs/AttributeReference.html#noinline.
#define OT_RESTRICT __restrict__ |
#define OT_SECTION | ( | name | ) | __attribute__((section(name))) |
Attribute to place symbols into particular sections.
See https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html #Common-Function-Attributes
#define OT_SET_BSS_SECTION | ( | name, | |
... | |||
) |
Pragma meant to place symbols into a NOBITS section with a specified name.
This should only be used for zero-initialized globals (including implicitly zero-initialized ones, when the initializer is missing). The pragma won't affect variables that do not go into the bss section.
Example:
OT_SET_BSS_SECTION(".foo", uint32_t x; // emitted in section .foo instead of .bss uint32_t y = 42; // emitted in regular .data section (but don't do this) )
#define OT_SIGNED | ( | value | ) |
This macro converts a given unsigned integer value to its signed counterpart.
#define OT_UNREACHABLE | ( | ) | __builtin_unreachable() |
Hints to the compiler that some point is not reachable.
One use case could be a function that never returns.
Please not that if the control flow reaches the point of the __builtin_unreachable, the program is undefined.
#define OT_UNSIGNED | ( | value | ) |
This macro converts a given signed integer value to its unsigned counterpart.
#define OT_VA_ARGS_COUNT | ( | dummy, | |
... | |||
) |
A variable-argument macro that expands to the number of arguments passed into it, between 0 and 31 arguments.
This macro is based off of a well-known preprocessor trick. This StackOverflow post expains the trick in detail: https://stackoverflow.com/questions/2308243/macro-returning-the-number-of-arguments-it-is-given-in-c TODO #2026: a dummy token is required for this to work correctly.
dummy | a dummy token that is required to be passed for the calculation to work correctly. |
... | the variable args list. |
#define OT_VA_FOR_EACH | ( | action, | |
... | |||
) |
A variable-argument macro that expands to the number of arguments passed into it, between 1 and 32 arguments (1 action and 0-31 others).
This macro accepts a macro name and a variable list of items, and will then expand to sequentially call the macro with each provided item in order. This can be useful for performing compile-time checks on arguments in variadic functions defined via macros.
For example, OT_VAR_FOR_EACH(TEST, 5, 19, 32, 1, 4) would expand to be do {TEST(5); TEST(19); TEST(32); TEST(1); TEST(4);} while (false)
action | The name of the macro to invoke with each item individually. |
... | The variable args list to call the macro on. |
#define OT_VA_FOR_EACH_10_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_11_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_12_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_13_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_14_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_15_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_16_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_17_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_18_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_19_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_1_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_20_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_21_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_22_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_23_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_24_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_25_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_26_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_27_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_28_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_29_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_2_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_30_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_31_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_3_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_4_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_5_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_6_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_7_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_8_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_VA_FOR_EACH_9_ | ( | action, | |
item, | |||
... | |||
) |
#define OT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
A macro representing the OpenTitan execution platform.
A macro indicating whether software should assume reduced hardware support (for the top_englishbreakafst
toplevel). Attribute for functions which return errors that must be acknowledged.
This attribute must be used to mark all DIFs which return an error value of some kind, to ensure that callers do not accidentally drop the error on the ground.
Normally, the standard way to drop such a value on the ground explicitly is with the syntax (void)expr;
, in analogy with the behavior of C++'s [[nodiscard]]
attribute. However, GCC does not implement this, so the idiom if (expr) {}
should be used instead, for the time being. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509.