aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/irqflags.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/irqflags.h')
-rw-r--r--include/asm-x86/irqflags.h59
1 files changed, 13 insertions, 46 deletions
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h
index 0e2292483b35..c242527f970e 100644
--- a/include/asm-x86/irqflags.h
+++ b/include/asm-x86/irqflags.h
@@ -12,25 +12,21 @@ static inline unsigned long native_save_fl(void)
12{ 12{
13 unsigned long flags; 13 unsigned long flags;
14 14
15 __asm__ __volatile__( 15 asm volatile("# __raw_save_flags\n\t"
16 "# __raw_save_flags\n\t" 16 "pushf ; pop %0"
17 "pushf ; pop %0" 17 : "=g" (flags)
18 : "=g" (flags) 18 : /* no input */
19 : /* no input */ 19 : "memory");
20 : "memory"
21 );
22 20
23 return flags; 21 return flags;
24} 22}
25 23
26static inline void native_restore_fl(unsigned long flags) 24static inline void native_restore_fl(unsigned long flags)
27{ 25{
28 __asm__ __volatile__( 26 asm volatile("push %0 ; popf"
29 "push %0 ; popf" 27 : /* no output */
30 : /* no output */ 28 :"g" (flags)
31 :"g" (flags) 29 :"memory", "cc");
32 :"memory", "cc"
33 );
34} 30}
35 31
36static inline void native_irq_disable(void) 32static inline void native_irq_disable(void)
@@ -70,26 +66,6 @@ static inline void raw_local_irq_restore(unsigned long flags)
70 native_restore_fl(flags); 66 native_restore_fl(flags);
71} 67}
72 68
73#ifdef CONFIG_X86_VSMP
74
75/*
76 * Interrupt control for the VSMP architecture:
77 */
78
79static inline void raw_local_irq_disable(void)
80{
81 unsigned long flags = __raw_local_save_flags();
82 raw_local_irq_restore((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
83}
84
85static inline void raw_local_irq_enable(void)
86{
87 unsigned long flags = __raw_local_save_flags();
88 raw_local_irq_restore((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
89}
90
91#else
92
93static inline void raw_local_irq_disable(void) 69static inline void raw_local_irq_disable(void)
94{ 70{
95 native_irq_disable(); 71 native_irq_disable();
@@ -100,8 +76,6 @@ static inline void raw_local_irq_enable(void)
100 native_irq_enable(); 76 native_irq_enable();
101} 77}
102 78
103#endif
104
105/* 79/*
106 * Used in the idle loop; sti takes one instruction cycle 80 * Used in the idle loop; sti takes one instruction cycle
107 * to complete: 81 * to complete:
@@ -153,23 +127,16 @@ static inline unsigned long __raw_local_irq_save(void)
153#endif /* CONFIG_PARAVIRT */ 127#endif /* CONFIG_PARAVIRT */
154 128
155#ifndef __ASSEMBLY__ 129#ifndef __ASSEMBLY__
156#define raw_local_save_flags(flags) \ 130#define raw_local_save_flags(flags) \
157 do { (flags) = __raw_local_save_flags(); } while (0) 131 do { (flags) = __raw_local_save_flags(); } while (0)
158 132
159#define raw_local_irq_save(flags) \ 133#define raw_local_irq_save(flags) \
160 do { (flags) = __raw_local_irq_save(); } while (0) 134 do { (flags) = __raw_local_irq_save(); } while (0)
161 135
162#ifdef CONFIG_X86_VSMP
163static inline int raw_irqs_disabled_flags(unsigned long flags)
164{
165 return !(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC);
166}
167#else
168static inline int raw_irqs_disabled_flags(unsigned long flags) 136static inline int raw_irqs_disabled_flags(unsigned long flags)
169{ 137{
170 return !(flags & X86_EFLAGS_IF); 138 return !(flags & X86_EFLAGS_IF);
171} 139}
172#endif
173 140
174static inline int raw_irqs_disabled(void) 141static inline int raw_irqs_disabled(void)
175{ 142{