1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ALPHA_IRQFLAGS_H
3 #define __ALPHA_IRQFLAGS_H
14 #define IPL_POWERFAIL 6
18 #ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
20 #define IPL_MIN __min_ipl
24 #define getipl() (rdps() & 7)
25 #define setipl(ipl) ((void) swpipl(ipl))
27 static inline unsigned long arch_local_save_flags(void)
32 static inline void arch_local_irq_disable(void)
38 static inline unsigned long arch_local_irq_save(void)
40 unsigned long flags
= swpipl(IPL_MAX
);
45 static inline void arch_local_irq_enable(void)
51 static inline void arch_local_irq_restore(unsigned long flags
)
58 static inline bool arch_irqs_disabled_flags(unsigned long flags
)
60 return flags
== IPL_MAX
;
63 static inline bool arch_irqs_disabled(void)
65 return arch_irqs_disabled_flags(getipl());
68 #endif /* __ALPHA_IRQFLAGS_H */