mirror of
https://github.com/adulau/aha.git
synced 2025-01-03 22:53:18 +00:00
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>
This commit is contained in:
parent
1b46cbe0cc
commit
62d7d7ed11
2 changed files with 19 additions and 17 deletions
|
@ -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
|
#ifndef CONFIG_PARAVIRT
|
||||||
#define __cpuid native_cpuid
|
#define __cpuid native_cpuid
|
||||||
|
@ -91,6 +109,7 @@ static inline void native_set_debugreg(int regno, unsigned long value)
|
||||||
#define set_debugreg(value, register) \
|
#define set_debugreg(value, register) \
|
||||||
native_set_debugreg(register, value)
|
native_set_debugreg(register, value)
|
||||||
|
|
||||||
|
#define set_iopl_mask native_set_iopl_mask
|
||||||
#endif /* CONFIG_PARAVIRT */
|
#endif /* CONFIG_PARAVIRT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -455,21 +455,6 @@ static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct
|
||||||
wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
|
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
|
#ifdef CONFIG_PARAVIRT
|
||||||
#include <asm/paravirt.h>
|
#include <asm/paravirt.h>
|
||||||
|
@ -479,8 +464,6 @@ static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread
|
||||||
{
|
{
|
||||||
native_load_sp0(tss, thread);
|
native_load_sp0(tss, thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define set_iopl_mask native_set_iopl_mask
|
|
||||||
#endif /* CONFIG_PARAVIRT */
|
#endif /* CONFIG_PARAVIRT */
|
||||||
|
|
||||||
/* generic versions from gas */
|
/* generic versions from gas */
|
||||||
|
|
Loading…
Reference in a new issue