__cmse_nonsecure_entry
In this section:
Syntax
See Syntax for object attributes.
Description
The __cmse_nonsecure_entry keyword declares an entry function that can be called from the non-secure state. The execution state will be cleared before returning to the caller, to avoid leaking sensitive data to the non-secure state.
The keyword __cmse_nonsecure_entry is not supported for variadic functions or functions with parameters or return values that do not fit in registers.
The keyword __cmse_nonsecure_entry is only allowed when compiling with ‑‑cmse.
Note
This keyword can also be used as a GCC-style attribute, using the __attribute__ (( syntax.attribute-list))
In 64-bit mode, this keyword cannot be used.
Example
#include <arm_cmse.h>
__cmse_nonsecure_entry int secure_add(int a, int b) {
return cmse_nonsecure_caller() ? a + b : 0;
}