Add ARMv7-A irqdisable() inline function

This commit is contained in:
Gregory Nutt 2013-07-30 11:37:09 -06:00
parent 84150fd7ed
commit b75a0cf8be
1 changed files with 18 additions and 0 deletions

View File

@ -286,6 +286,24 @@ 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)