This source file includes following definitions.
- arch_local_save_flags
- arch_local_irq_restore
- arch_local_irq_disable
- arch_local_irq_enable
- arch_irqs_disabled_flags
- arch_irqs_disabled
- arch_local_irq_save
1
2
3
4
5 #ifndef _ASM_IRQFLAGS_H
6 #define _ASM_IRQFLAGS_H
7
8 #include <asm/registers.h>
9
10 static inline unsigned long arch_local_save_flags(void)
11 {
12 return RDCTL(CTL_STATUS);
13 }
14
15
16
17
18
19 static inline void arch_local_irq_restore(unsigned long flags)
20 {
21 WRCTL(CTL_STATUS, flags);
22 }
23
24 static inline void arch_local_irq_disable(void)
25 {
26 unsigned long flags;
27
28 flags = arch_local_save_flags();
29 arch_local_irq_restore(flags & ~STATUS_PIE);
30 }
31
32 static inline void arch_local_irq_enable(void)
33 {
34 unsigned long flags;
35
36 flags = arch_local_save_flags();
37 arch_local_irq_restore(flags | STATUS_PIE);
38 }
39
40 static inline int arch_irqs_disabled_flags(unsigned long flags)
41 {
42 return (flags & STATUS_PIE) == 0;
43 }
44
45 static inline int arch_irqs_disabled(void)
46 {
47 return arch_irqs_disabled_flags(arch_local_save_flags());
48 }
49
50 static inline unsigned long arch_local_irq_save(void)
51 {
52 unsigned long flags;
53
54 flags = arch_local_save_flags();
55 arch_local_irq_restore(flags & ~STATUS_PIE);
56 return flags;
57 }
58
59 #endif