This intrinsic disables IRQ interrupts.
int __disable_irq(void)
Note
On ARMv7 and ARMv7‑M, the __disable_irq intrinsic has prototype:
void __disable_irq(void)
__irq returns the value the IRQ interrupt mask has in the PSR prior to the disabling of IRQ interrupts.
void foo(void)
{
int was_masked = __disable_irq();
/* ... */
if (!was_masked)
__enable_irq();
}
The __disable_irq intrinsic can only be executed in privileged modes, that is, in non user modes. In User mode this intrinsic does not change the interrupt flags in the CPSR.