diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index 51a9702ae8..09880f4507 100755 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -250,6 +250,23 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Return the current IRQ state */ + +static inline irqstate_t irqstate(void) +{ + unsigned int cpsr; + + __asm__ __volatile__ + ( + "\tmrs %0, cpsr\n" + : "=r" (cpsr) + : + : "memory" + ); + + return cpsr; +} + /* Disable IRQs and return the previous IRQ state */ static inline irqstate_t irqsave(void) @@ -286,24 +303,6 @@ static inline irqstate_t irqenable(void) return cpsr; } -/* Disable IRQs and return the previous IRQ state */ - -static inline irqstate_t irqdisable(void) -{ - unsigned int cpsr; - - __asm__ __volatile__ - ( - "\tmrs %0, cpsr\n" - "\tcpsid i\n" - : "=r" (cpsr) - : - : "memory" - ); - - return cpsr; -} - /* Restore saved IRQ & FIQ state */ static inline void irqrestore(irqstate_t flags)