__cmse_nonsecure_call
Syntax
See Syntax for type attributes used on functions.
Description
The keyword __cmse_nonsecure_call can be used on a function pointer, and indicates that a call via the pointer will enter non-secure state. The execution state will be cleared up before such a call, to avoid leaking sensitive data to the non-secure state.
The __cmse_nonsecure_call keyword can only be used with a function pointer, and it is only allowed when compiling with ‑‑cmse.
The keyword __cmse_nonsecure_call is not supported for variadic functions, for functions with parameters or return values that do not fit in registers, or for functions with parameters or return values in floating-point registers.
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>
typedef __cmse_nonsecure_call void (*fp_ns_t)(void);
static fp_ns_t callback_ns = 0;
__cmse_nonsecure_entry void set_callback_ns(fp_ns_t func_ns) {
callback_ns = cmse_nsfptr_create(func_ns);
}