25#define IRQ_MASK 0x00000080 
   27static inline unsigned __get_cpsr(
void)
 
   30    __asm__ 
volatile(
" mrs  %0, cpsr" : 
"=r"(retval) :  : 
"memory");
 
   34static inline void __set_cpsr(
unsigned val)
 
   36    __asm__ 
volatile(
" msr  cpsr, %0" :  : 
"r"(val) : 
"memory");
 
   42    __asm__ 
volatile(
" mrs  %0, cpsr" : 
"=r"(retval) :  : 
"memory");
 
   43    return (retval & INTMode) == 18;
 
   46static inline __attribute__((always_inline)) 
unsigned irq_disable(
void)
 
   51    __set_cpsr(_cpsr | IRQ_MASK);
 
   55static inline __attribute__((always_inline)) 
void irq_restore(
unsigned oldCPSR)
 
   60static inline __attribute__((always_inline)) 
unsigned irq_enable(
void)
 
   65    __set_cpsr(_cpsr & ~IRQ_MASK);
 
   69static inline __attribute__((always_inline)) 
bool irq_is_enabled(
void)
 
   71    return !(__get_cpsr() & IRQ_MASK);
 
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
 
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
 
MAYBE_INLINE bool irq_is_enabled(void)
Test if IRQs are currently enabled.
 
MAYBE_INLINE unsigned irq_enable(void)
This function clears the IRQ disable bit in the status register.
 
MAYBE_INLINE bool irq_is_in(void)
Check whether called from interrupt service routine.