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 #define raw_local_irq_save(x) \
15 __asm__ __volatile__( \
16 "mrs %0, cpsr @ local_irq_save\n" \
18 : "=r" (x) : : "memory", "cc"); \
21 #define raw_local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc")
22 #define raw_local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc")
23 #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
24 #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
29 * Save the current interrupt enable state & disable IRQs
31 #define raw_local_irq_save(x) \
34 (void) (&temp == &x); \
35 __asm__ __volatile__( \
36 "mrs %0, cpsr @ local_irq_save\n" \
37 " orr %1, %0, #128\n" \
39 : "=r" (x), "=r" (temp) \
47 #define raw_local_irq_enable() \
50 __asm__ __volatile__( \
51 "mrs %0, cpsr @ local_irq_enable\n" \
52 " bic %0, %0, #128\n" \
62 #define raw_local_irq_disable() \
65 __asm__ __volatile__( \
66 "mrs %0, cpsr @ local_irq_disable\n" \
67 " orr %0, %0, #128\n" \
77 #define local_fiq_enable() \
80 __asm__ __volatile__( \
81 "mrs %0, cpsr @ stf\n" \
82 " bic %0, %0, #64\n" \
92 #define local_fiq_disable() \
95 __asm__ __volatile__( \
96 "mrs %0, cpsr @ clf\n" \
97 " orr %0, %0, #64\n" \
107 * Save the current interrupt enable state.
109 #define raw_local_save_flags(x) \
111 __asm__ __volatile__( \
112 "mrs %0, cpsr @ local_save_flags" \
113 : "=r" (x) : : "memory", "cc"); \
117 * restore saved IRQ & FIQ state
119 #define raw_local_irq_restore(x) \
120 __asm__ __volatile__( \
121 "msr cpsr_c, %0 @ local_irq_restore\n" \
126 #define raw_irqs_disabled_flags(flags) \
128 (int)((flags) & PSR_I_BIT); \