__smc

The __smc keyword declares an SMC (Secure Monitor Call) function. A call to the SMC function inserts an SMC instruction into the instruction stream generated by the compiler at the point of function invocation.

Note

The SMC instruction replaces the SMI instruction used in previous versions of the ARM assembly language.

__smc is a function qualifier. It affects the type of a function.

Show/hideSyntax

__smc(int smc_num) return-type function-name([argument-list]);

Where:

smc_num

Is a 4-bit immediate value used in the SMC instruction.

The value of smc_num is ignored by the ARM processor, but can be used by the SMC exception handler to determine what service is being requested.

Show/hideRestrictions

The SMC instruction is available for selected ARM architecture-based processors, if they have the Security Extensions. See SMC in the Assembler Reference for more information.

The compiler generates an error if you compile source code containing the __smc keyword for an architecture that does not support the SMC instruction.

Show/hideExample

__smc(5) void mycall(void); /* declare a name by which SMC #5 can be called */
...
mycall();                   /* invoke the function */

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0491H
Non-ConfidentialID070912