Skip to main content

IAR Embedded Workbench for Arm 9.70.x

__cmse_nonsecure_call

In this section:
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__ ((attribute-list)) syntax.

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);
}
See also

‑‑cmse.