Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80032
b: refs/heads/master
c: 62d7d7e
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Jan 30, 2008
1 parent 60dd767 commit ae548f1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b46cbe0ccaad25786526601bc54426f2e2abb20
refs/heads/master: 62d7d7ed11760a0fea40e4fc6f0553e721d00443
19 changes: 19 additions & 0 deletions trunk/include/asm-x86/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */

/*
Expand Down
17 changes: 0 additions & 17 deletions trunk/include/asm-x86/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
/*
* 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>
Expand All @@ -479,8 +464,6 @@ static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread
{
native_load_sp0(tss, thread);
}

#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT */

/* generic versions from gas */
Expand Down

0 comments on commit ae548f1

Please sign in to comment.