4.1.2 __cmse_nonsecure_call Keyword

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.

In 64-bit mode, this keyword cannot be used.

On IAR, can only be used when passing --cmse to compiler.

On XC32, can only be used when passing -mcmse to compiler.

Suggested Replacement

cmse_nonsecure_call

Caveats

None.

Examples

Consider migrating IAR code such as:
__cmse_nonsecure_call void test();
to MPLAB XC codes similar to:
__attribute__((cmse_nonsecure_call)) void test();

Further Information

None.