[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11979319953427-git-send-email-gcosta@redhat.com>
Date: Mon, 17 Dec 2007 20:52:29 -0200
From: Glauber de Oliveira Costa <gcosta@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, glommer@...il.com, tglx@...utronix.de,
mingo@...e.hu, ehabkost@...hat.com, jeremy@...p.org,
avi@...ranet.com, anthony@...emonkey.ws,
virtualization@...ts.linux-foundation.org, rusty@...tcorp.com.au,
ak@...e.de, chrisw@...s-sol.org, rostedt@...dmis.org,
hpa@...or.com, zach@...are.com, roland@...hat.com,
Glauber de Oliveira Costa <gcosta@...hat.com>
Subject: [PATCH 6/21] [PATCH] 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@...hat.com>
---
include/asm-x86/processor.h | 19 +++++++++++++++++++
include/asm-x86/processor_32.h | 17 -----------------
2 files changed, 19 insertions(+), 17 deletions(-)
Index: linux-2.6-x86/include/asm-x86/processor.h
===================================================================
--- linux-2.6-x86.orig/include/asm-x86/processor.h
+++ linux-2.6-x86/include/asm-x86/processor.h
@@ -78,6 +78,24 @@ static inline void native_set_debugreg(i
}
}
+/*
+ * 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(i
#define set_debugreg(value, register) \
native_set_debugreg(register, value)
+#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT */
/*
Index: linux-2.6-x86/include/asm-x86/processor_32.h
===================================================================
--- linux-2.6-x86.orig/include/asm-x86/processor_32.h
+++ linux-2.6-x86/include/asm-x86/processor_32.h
@@ -455,21 +455,6 @@ static inline void native_load_sp0(struc
wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
}
}
-/*
- * Set IOPL bits in EFLAGS from given mask
- */
-static inline void native_set_iopl_mask(unsigned mask)
-{
- 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));
-}
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
@@ -479,8 +464,6 @@ static inline void load_sp0(struct tss_s
{
native_load_sp0(tss, thread);
}
-
-#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT */
/* generic versions from gas */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists