29 #define IRQ_MASK 0x00000080
31 static inline unsigned __get_cpsr(
void)
34 __asm__
volatile(
" mrs %0, cpsr" :
"=r"(retval) : :
"memory");
38 static inline void __set_cpsr(
unsigned val)
40 __asm__
volatile(
" msr cpsr, %0" : :
"r"(val) :
"memory");
46 __asm__
volatile(
" mrs %0, cpsr" :
"=r"(retval) : :
"memory");
47 return (retval & INTMode) == 18;
50 static inline __attribute__((always_inline))
unsigned irq_disable(
void)
55 __set_cpsr(_cpsr | IRQ_MASK);
59 static inline __attribute__((always_inline))
void irq_restore(
unsigned oldCPSR)
64 static inline __attribute__((always_inline))
unsigned irq_enable(
void)
69 __set_cpsr(_cpsr & ~IRQ_MASK);