2 * include/asm/irqflags.h
6 * This file gets included from lowlevel asm headers too, to provide
7 * wrapped versions of the local_irq_*() APIs, based on the
8 * arch_local_irq_*() functions from the lowlevel headers.
10 #ifndef _ASM_IRQFLAGS_H
11 #define _ASM_IRQFLAGS_H
17 static inline unsigned long arch_local_save_flags(void)
29 static inline void arch_local_irq_restore(unsigned long flags)
39 static inline void arch_local_irq_disable(void)
44 : "i" (PIL_NORMAL_MAX)
49 static inline void arch_local_irq_enable(void)
59 static inline int arch_irqs_disabled_flags(unsigned long flags)
64 static inline int arch_irqs_disabled(void)
66 return arch_irqs_disabled_flags(arch_local_save_flags());
69 static inline unsigned long arch_local_irq_save(void)
71 unsigned long flags, tmp;
73 /* Disable interrupts to PIL_NORMAL_MAX unless we already
74 * are using PIL_NMI, in which case PIL_NMI is retained.
76 * The only values we ever program into the %pil are 0,
77 * PIL_NORMAL_MAX and PIL_NMI.
79 * Since PIL_NMI is the largest %pil value and all bits are
80 * set in it (0xf), it doesn't matter what PIL_NORMAL_MAX
87 : "=r" (flags), "=r" (tmp)
88 : "i" (PIL_NORMAL_MAX)
95 #endif /* (__ASSEMBLY__) */
97 #endif /* !(_ASM_IRQFLAGS_H) */