__irq keyword enables a C or C++ function
to be used as an interrupt routine.
__irq is a function qualifier. It affects
the type of the function.
All corrupted registers except floating-point registers are preserved, not only those that are normally preserved under the AAPCS. The default AAPCS mode must be used.
No arguments or return values can be used with
In architectures other than ARMv6-M and ARMv7-M, the function
exits by setting the program counter to
CPSR to the value in
In ARMv6-M and ARMv7-M, specifying
not affect the behavior of the compiled output. However, ARM recommends
__irq on exception handlers for clarity
and easier software porting.
For architectures that support ARM and Thumb-2 technology, for example ARMv6T2, ARMv7-A, and ARMv7-R, functions specified as __irq compile to ARM or Thumb code depending on whether the compile option or
#pragmaspecify ARM or Thumb.
For Thumb only architectures, for example ARMv6-M and ARMv7-M, functions specified as
__irqcompile to Thumb code.
For architectures before ARMv6T2, functions specified as
__irqcompile to ARM code even if you compile with --thumb or