This source file includes following definitions.
- __arch_local_irq_ssm
- arch_local_save_flags
- arch_local_irq_save
- arch_local_irq_disable
- arch_local_irq_enable
- arch_local_irq_restore
- arch_irqs_disabled_flags
- arch_irqs_disabled
1
2
3
4
5
6
7 #ifndef __ASM_IRQFLAGS_H
8 #define __ASM_IRQFLAGS_H
9
10 #include <linux/types.h>
11
12 #define ARCH_IRQ_ENABLED (3UL << (BITS_PER_LONG - 8))
13
14
15 #define __arch_local_irq_stosm(__or) \
16 ({ \
17 unsigned long __mask; \
18 asm volatile( \
19 " stosm %0,%1" \
20 : "=Q" (__mask) : "i" (__or) : "memory"); \
21 __mask; \
22 })
23
24
25 #define __arch_local_irq_stnsm(__and) \
26 ({ \
27 unsigned long __mask; \
28 asm volatile( \
29 " stnsm %0,%1" \
30 : "=Q" (__mask) : "i" (__and) : "memory"); \
31 __mask; \
32 })
33
34
35 static inline notrace void __arch_local_irq_ssm(unsigned long flags)
36 {
37 asm volatile("ssm %0" : : "Q" (flags) : "memory");
38 }
39
40 static inline notrace unsigned long arch_local_save_flags(void)
41 {
42 return __arch_local_irq_stnsm(0xff);
43 }
44
45 static inline notrace unsigned long arch_local_irq_save(void)
46 {
47 return __arch_local_irq_stnsm(0xfc);
48 }
49
50 static inline notrace void arch_local_irq_disable(void)
51 {
52 arch_local_irq_save();
53 }
54
55 static inline notrace void arch_local_irq_enable(void)
56 {
57 __arch_local_irq_stosm(0x03);
58 }
59
60
61 static inline notrace void arch_local_irq_restore(unsigned long flags)
62 {
63
64 if (flags & ARCH_IRQ_ENABLED)
65 arch_local_irq_enable();
66 }
67
68 static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
69 {
70 return !(flags & ARCH_IRQ_ENABLED);
71 }
72
73 static inline notrace bool arch_irqs_disabled(void)
74 {
75 return arch_irqs_disabled_flags(arch_local_save_flags());
76 }
77
78 #endif