xref: /linux/arch/um/include/asm/irqflags.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 #ifndef __UM_IRQFLAGS_H
2 #define __UM_IRQFLAGS_H
3 
4 extern int get_signals(void);
5 extern int set_signals(int enable);
6 extern void block_signals(void);
7 extern void unblock_signals(void);
8 
9 static inline unsigned long arch_local_save_flags(void)
10 {
11 	return get_signals();
12 }
13 
14 static inline void arch_local_irq_restore(unsigned long flags)
15 {
16 	set_signals(flags);
17 }
18 
19 static inline void arch_local_irq_enable(void)
20 {
21 	unblock_signals();
22 }
23 
24 static inline void arch_local_irq_disable(void)
25 {
26 	block_signals();
27 }
28 
29 static inline unsigned long arch_local_irq_save(void)
30 {
31 	unsigned long flags;
32 	flags = arch_local_save_flags();
33 	arch_local_irq_disable();
34 	return flags;
35 }
36 
37 static inline bool arch_irqs_disabled(void)
38 {
39 	return arch_local_save_flags() == 0;
40 }
41 
42 #endif
43