summaryrefslogtreecommitdiffstats
path: root/include/asm-x86/processor.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa2008-01-30 13:31:27 +0100
committerIngo Molnar2008-01-30 13:31:27 +0100
commit62d7d7ed11760a0fea40e4fc6f0553e721d00443 (patch)
tree8d298b4117765d7ab0be92673e134295a9c19c27 /include/asm-x86/processor.h
parentx86: unify paravirt pieces of processor.h (diff)
downloadkernel-qcow2-linux-62d7d7ed11760a0fea40e4fc6f0553e721d00443.tar.gz
kernel-qcow2-linux-62d7d7ed11760a0fea40e4fc6f0553e721d00443.tar.xz
kernel-qcow2-linux-62d7d7ed11760a0fea40e4fc6f0553e721d00443.zip
x86: move the definition of set_iopl_mask to common header
This patch moves the definition of set_iopl_mask to processor.h, instead of letting it at processor_32.h. For x86_64, nothing is done, as we don't really need such a function. However, having it on both arches saves us from putting an ifdef in the pv_cpu_ops struct. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r--include/asm-x86/processor.h19
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)
}
}
+/*
+ * Set IOPL bits in EFLAGS from given mask
+ */
+static inline void native_set_iopl_mask(unsigned mask)
+{
+#ifdef CONFIG_X86_32
+ unsigned int reg;
+ __asm__ __volatile__ ("pushfl;"
+ "popl %0;"
+ "andl %1, %0;"
+ "orl %2, %0;"
+ "pushl %0;"
+ "popfl"
+ : "=&r" (reg)
+ : "i" (~X86_EFLAGS_IOPL), "r" (mask));
+#endif
+}
+
#ifndef CONFIG_PARAVIRT
#define __cpuid native_cpuid
@@ -91,6 +109,7 @@ static inline void native_set_debugreg(int regno, unsigned long value)
#define set_debugreg(value, register) \
native_set_debugreg(register, value)
+#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT */
/*