SAMA5: Modification of some CPSR-related inline functions

This commit is contained in:
Gregory Nutt
2013-07-31 09:11:24 -06:00
parent fde3777e9e
commit 7dfef5e22e
3 changed files with 36 additions and 20 deletions
+17 -18
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)