Add ARMv7-A irqdisable() inline function
This commit is contained in:
parent
84150fd7ed
commit
b75a0cf8be
@ -286,6 +286,24 @@ static inline irqstate_t irqenable(void)
|
|||||||
return cpsr;
|
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 */
|
/* Restore saved IRQ & FIQ state */
|
||||||
|
|
||||||
static inline void irqrestore(irqstate_t flags)
|
static inline void irqrestore(irqstate_t flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user