SAMA5: Modification of some CPSR-related inline functions
This commit is contained in:
parent
db20c5fc43
commit
8695c89aa4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user