1 #ifndef __ASM_ARM_IRQFLAGS_H
2 #define __ASM_ARM_IRQFLAGS_H
6 #include <asm/ptrace.h>
9 * CPU interrupt mask handling.
11 #if __LINUX_ARM_ARCH__ >= 6
13 static inline unsigned long arch_local_irq_save(void)
18 " mrs %0, cpsr @ arch_local_irq_save\n"
20 : "=r" (flags
) : : "memory", "cc");
24 static inline void arch_local_irq_enable(void)
27 " cpsie i @ arch_local_irq_enable"
33 static inline void arch_local_irq_disable(void)
36 " cpsid i @ arch_local_irq_disable"
42 #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
43 #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
47 * Save the current interrupt enable state & disable IRQs
49 static inline unsigned long arch_local_irq_save(void)
51 unsigned long flags
, temp
;
54 " mrs %0, cpsr @ arch_local_irq_save\n"
57 : "=r" (flags
), "=r" (temp
)
66 static inline void arch_local_irq_enable(void)
70 " mrs %0, cpsr @ arch_local_irq_enable\n"
81 static inline void arch_local_irq_disable(void)
85 " mrs %0, cpsr @ arch_local_irq_disable\n"
96 #define local_fiq_enable() \
99 __asm__ __volatile__( \
100 "mrs %0, cpsr @ stf\n" \
101 " bic %0, %0, #64\n" \
111 #define local_fiq_disable() \
113 unsigned long temp; \
114 __asm__ __volatile__( \
115 "mrs %0, cpsr @ clf\n" \
116 " orr %0, %0, #64\n" \
126 * Save the current interrupt enable state.
128 static inline unsigned long arch_local_save_flags(void)
132 " mrs %0, cpsr @ local_save_flags"
133 : "=r" (flags
) : : "memory", "cc");
138 * restore saved IRQ & FIQ state
140 static inline void arch_local_irq_restore(unsigned long flags
)
143 " msr cpsr_c, %0 @ local_irq_restore"
149 static inline int arch_irqs_disabled_flags(unsigned long flags
)
151 return flags
& PSR_I_BIT
;