Compartir a través de


_swi (Windows Embedded CE 6.0)

1/5/2010

This intrinsic function generates a call to an OS routine using the software interrupt instruction SWI.

Syntax

unsigned int __swi(
   unsigned swi_number,
   arg2,
   arg3,
   arg4
);

Parameters

  • swi_number
    Software Interrupt number
  • arg2-arg4
    Additional arguments for passing

Return Values

The _swi intrinsic function returns the value left in register R0 when control is returned to the instruction following the SWI.

Remarks

The _swi intrinsic applies to the ARM or the Thumb instruction set, depending on whether the compiler is generating 32-bit or 16-bit code.

The first parameter, *swi_number,*is encoded directly into the immediate field of the instruction. It must be an integer constant in the range [0 - 16777215] for ARM or [0 - 255] for Thumb.

If additional arguments are included, the function passes the values according to the standard ARM calling convention with one exception: no arguments or parts of arguments may be passed in memory, that is, on the stack.

Therefore, all arguments must be able to be passed using only registers R0, R1, R2, and R3.

Requirements

Architecture ARM
Header armintr.h
Routine _swi

See Also

Reference

ARM10 Intrinsic Functions
/QRArch - Specify Target Architecture
/QRthumb