Interrupt question ARM?
Some microcontrollers require a different handling of the stack and return for interrupt handling functions as for normal functions.

For ARM controllers a normal entry to a subroutine uses a PUSH to save stuff on the stack, and on exit of the subroutine you would POP the saved state back and leave the subroutine. (ARM Assembly Reference page 65)

For an exception handler on modern ARM platforms the state is automatically pushed on the stack, so the compiler doesn't need to create a PUSH instruction on function entry. Also the exit from a exception handler can look different from a normal one, the ARMv7-M architecture will return from an exception if either POP/LDM, LDR or BX will load a value of 0xFXXXXXXX into the program counter (PC).

So the __irq tells the compiler that this functions entry and exit might require special treatment, and special depending on the set target (for 8051 I think there was RET for normal return and RETI for interrupt return).