4.7.14. __disable_irq

This intrinsic disables IRQ interrupts.

Syntax

int __disable_irq(void)

Note

On ARMv7 and ARMv7-M, the __disable_irq intrinsic has prototype:

void __disable_irq(void)

Return value

__irq returns the value the IRQ interrupt mask has in the PSR prior to the disabling of IRQ interrupts.

Example

void foo(void)
{
    int was_masked = __disable_irq();

    /* ... */

    if (!was_masked)
        __enable_irq();
}

Restrictions

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.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential