diff options
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 8d0af7bf090a..8b7794766884 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -78,6 +78,24 @@ static inline void native_set_debugreg(int regno, unsigned long value) | |||
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | /* | ||
82 | * Set IOPL bits in EFLAGS from given mask | ||
83 | */ | ||
84 | static inline void native_set_iopl_mask(unsigned mask) | ||
85 | { | ||
86 | #ifdef CONFIG_X86_32 | ||
87 | unsigned int reg; | ||
88 | __asm__ __volatile__ ("pushfl;" | ||
89 | "popl %0;" | ||
90 | "andl %1, %0;" | ||
91 | "orl %2, %0;" | ||
92 | "pushl %0;" | ||
93 | "popfl" | ||
94 | : "=&r" (reg) | ||
95 | : "i" (~X86_EFLAGS_IOPL), "r" (mask)); | ||
96 | #endif | ||
97 | } | ||
98 | |||
81 | 99 | ||
82 | #ifndef CONFIG_PARAVIRT | 100 | #ifndef CONFIG_PARAVIRT |
83 | #define __cpuid native_cpuid | 101 | #define __cpuid native_cpuid |
@@ -91,6 +109,7 @@ static inline void native_set_debugreg(int regno, unsigned long value) | |||
91 | #define set_debugreg(value, register) \ | 109 | #define set_debugreg(value, register) \ |
92 | native_set_debugreg(register, value) | 110 | native_set_debugreg(register, value) |
93 | 111 | ||
112 | #define set_iopl_mask native_set_iopl_mask | ||
94 | #endif /* CONFIG_PARAVIRT */ | 113 | #endif /* CONFIG_PARAVIRT */ |
95 | 114 | ||
96 | /* | 115 | /* |