__irq keyword enables a C or C++ function to be used as an exception handler.
__irq is a function qualifier. It affects the type of the function.
__irq keyword causes the compiler to generate a function in a manner
that makes it suitable for use as an exception handler. This means that the compiler makes
Preserve all processor registers, not only those required to be preserved by the AAPCS. Floating-point registers are not preserved.
Return using an instruction that is architecturally defined as causing an exception return.
No arguments or return values can be used with
__irq functions are incompatible with
In ARMv6-M and ARMv7-M the architectural exception handling mechanism preserves all
processor registers, and a standard function return can cause an exception return.
__irq does not affect the behavior of the compiled
output. However, ARM recommends using
__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
__irqcompile 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