SAMA5: Modification of some CPSR-related inline functions

This commit is contained in:
Gregory Nutt 2013-07-31 09:11:24 -06:00
parent db20c5fc43
commit 8695c89aa4

View File

@ -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)