The __svc keyword declares a SuperVisor Call (SVC) function taking up to four integer-like arguments and returning up to four results in a value_in_regs structure.
__svc is a function qualifier. It affects the type of a function.
Is the immediate value used in the SVC instruction.
It is an expression evaluating to an integer in the range:
0 to 224–1 (a 24-bit value) in an ARM instruction.
0-255 (an 8-bit value) in a 16-bit Thumb instruction.
Usage
This causes function invocations to be compiled inline as an AAPCS-compliant operation that
behaves similarly to a normal call to a function.
You can use the __value_in_regs qualifier to specify that a small
structure of up to 16 bytes is returned in registers, rather than by the usual
structure-passing mechanism defined in the AAPCS.
Errors
When an ARM architecture variant or ARM architecture-based processor that does not support
an SVC instruction is specified on the command line using the
--cpu option, the compiler generates an error.
Example
__svc(42) void terminate_1(int procnum); // terminate_1 returns no results
__svc(42) int terminate_2(int procnum); // terminate_2 returns one result
typedef struct res_type
{
int res_1;
int res_2;
int res_3;
int res_4;
} res_type;
__svc(42) __value_in_regs res_type terminate_3(int procnum);
// terminate_3 returns more than
// one result
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.