aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:27 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:27 -0500
commit62d7d7ed11760a0fea40e4fc6f0553e721d00443 (patch)
tree8d298b4117765d7ab0be92673e134295a9c19c27
parent1b46cbe0ccaad25786526601bc54426f2e2abb20 (diff)
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>
-rw-r--r--include/asm-x86/processor.h19
-rw-r--r--include/asm-x86/processor_32.h17
2 files changed, 19 insertions, 17 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 */
84static 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/*
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
index e7fc023cd810..516a38ad2a7a 100644
--- a/include/asm-x86/processor_32.h
+++ b/include/asm-x86/processor_32.h
@@ -455,21 +455,6 @@ static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct
455 wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); 455 wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
456 } 456 }
457} 457}
458/*
459 * Set IOPL bits in EFLAGS from given mask
460 */
461static inline void native_set_iopl_mask(unsigned mask)
462{
463 unsigned int reg;
464 __asm__ __volatile__ ("pushfl;"
465 "popl %0;"
466 "andl %1, %0;"
467 "orl %2, %0;"
468 "pushl %0;"
469 "popfl"
470 : "=&r" (reg)
471 : "i" (~X86_EFLAGS_IOPL), "r" (mask));
472}
473 458
474#ifdef CONFIG_PARAVIRT 459#ifdef CONFIG_PARAVIRT
475#include <asm/paravirt.h> 460#include <asm/paravirt.h>
@@ -479,8 +464,6 @@ static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread
479{ 464{
480 native_load_sp0(tss, thread); 465 native_load_sp0(tss, thread);
481} 466}
482
483#define set_iopl_mask native_set_iopl_mask
484#endif /* CONFIG_PARAVIRT */ 467#endif /* CONFIG_PARAVIRT */
485 468
486/* generic versions from gas */ 469/* generic versions from gas */