The SWI_ALIAS Pragma

The SWI_ALIAS pragma allows you to refer to a particular software interrupt as a function name and to invocations of the software interrupt as function calls. Since the function name is simply an alias for the software interrupt, no function definition exists for the function name.

The syntax of the pragma in C is:

#pragma SWI_ALIAS(func,swi_number)

The syntax of the pragma in C++ is:

#pragma SWI_ALIAS(swi_number)

Calls to the applied function are compiled as software interrupts whose number is swi_number. The swi_number variable must be an integer constant.

A function prototype must exist for the alias and it must occur after the pragma and before the alias is used. Software interrupts whose number is not known until run time are not supported.

For information about using the GCC function attribute syntax to declare function aliases, see Section 5.17.2.

For more information about using software interrupts, including restrictions on passing arguments and register usage, see Section 6.7.5.