Commit 6b6891f9 authored by gorcunov@gmail.com's avatar gorcunov@gmail.com Committed by Ingo Molnar

x86: cleanup - rename VM_MASK to X86_VM_MASK

This patch renames VM_MASK to X86_VM_MASK (which
in turn defined as alias to X86_EFLAGS_VM) to better
distinguish from virtual memory flags. We can't just
use X86_EFLAGS_VM instead because it is also used
for conditional compilation
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6093015d
...@@ -498,7 +498,7 @@ do_trap(int trapnr, int signr, char *str, int vm86, struct pt_regs *regs, ...@@ -498,7 +498,7 @@ do_trap(int trapnr, int signr, char *str, int vm86, struct pt_regs *regs,
{ {
struct task_struct *tsk = current; struct task_struct *tsk = current;
if (regs->flags & VM_MASK) { if (regs->flags & X86_VM_MASK) {
if (vm86) if (vm86)
goto vm86_trap; goto vm86_trap;
goto trap_signal; goto trap_signal;
...@@ -643,7 +643,7 @@ void __kprobes do_general_protection(struct pt_regs *regs, long error_code) ...@@ -643,7 +643,7 @@ void __kprobes do_general_protection(struct pt_regs *regs, long error_code)
} }
put_cpu(); put_cpu();
if (regs->flags & VM_MASK) if (regs->flags & X86_VM_MASK)
goto gp_in_vm86; goto gp_in_vm86;
if (!user_mode(regs)) if (!user_mode(regs))
...@@ -922,7 +922,7 @@ void __kprobes do_debug(struct pt_regs *regs, long error_code) ...@@ -922,7 +922,7 @@ void __kprobes do_debug(struct pt_regs *regs, long error_code)
goto clear_dr7; goto clear_dr7;
} }
if (regs->flags & VM_MASK) if (regs->flags & X86_VM_MASK)
goto debug_vm86; goto debug_vm86;
/* Save debug status register where ptrace can see it */ /* Save debug status register where ptrace can see it */
...@@ -1094,7 +1094,7 @@ void do_simd_coprocessor_error(struct pt_regs *regs, long error_code) ...@@ -1094,7 +1094,7 @@ void do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
* Handle strange cache flush from user space exception * Handle strange cache flush from user space exception
* in all other cases. This is undocumented behaviour. * in all other cases. This is undocumented behaviour.
*/ */
if (regs->flags & VM_MASK) { if (regs->flags & X86_VM_MASK) {
handle_vm86_fault((struct kernel_vm86_regs *)regs, error_code); handle_vm86_fault((struct kernel_vm86_regs *)regs, error_code);
return; return;
} }
......
...@@ -299,7 +299,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk ...@@ -299,7 +299,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
VEFLAGS = info->regs.pt.flags; VEFLAGS = info->regs.pt.flags;
info->regs.pt.flags &= SAFE_MASK; info->regs.pt.flags &= SAFE_MASK;
info->regs.pt.flags |= info->regs32->flags & ~SAFE_MASK; info->regs.pt.flags |= info->regs32->flags & ~SAFE_MASK;
info->regs.pt.flags |= VM_MASK; info->regs.pt.flags |= X86_VM_MASK;
switch (info->cpu_type) { switch (info->cpu_type) {
case CPU_286: case CPU_286:
......
...@@ -639,7 +639,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) ...@@ -639,7 +639,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* It's safe to allow irq's after cr2 has been saved and the vmalloc /* It's safe to allow irq's after cr2 has been saved and the vmalloc
fault has been handled. */ fault has been handled. */
if (regs->flags & (X86_EFLAGS_IF|VM_MASK)) if (regs->flags & (X86_EFLAGS_IF | X86_VM_MASK))
local_irq_enable(); local_irq_enable();
/* /*
......
...@@ -170,7 +170,7 @@ static inline int user_mode(struct pt_regs *regs) ...@@ -170,7 +170,7 @@ static inline int user_mode(struct pt_regs *regs)
static inline int user_mode_vm(struct pt_regs *regs) static inline int user_mode_vm(struct pt_regs *regs)
{ {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
return ((regs->cs & SEGMENT_RPL_MASK) | (regs->flags & VM_MASK)) >= return ((regs->cs & SEGMENT_RPL_MASK) | (regs->flags & X86_VM_MASK)) >=
USER_RPL; USER_RPL;
#else #else
return user_mode(regs); return user_mode(regs);
...@@ -180,7 +180,7 @@ static inline int user_mode_vm(struct pt_regs *regs) ...@@ -180,7 +180,7 @@ static inline int user_mode_vm(struct pt_regs *regs)
static inline int v8086_mode(struct pt_regs *regs) static inline int v8086_mode(struct pt_regs *regs)
{ {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
return (regs->flags & VM_MASK); return (regs->flags & X86_VM_MASK);
#else #else
return 0; /* No V86 mode support in long mode */ return 0; /* No V86 mode support in long mode */
#endif #endif
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#define IOPL_MASK 0x00003000 #define IOPL_MASK 0x00003000
#define NT_MASK 0x00004000 #define NT_MASK 0x00004000
#ifdef CONFIG_VM86 #ifdef CONFIG_VM86
#define VM_MASK 0x00020000 #define X86_VM_MASK X86_EFLAGS_VM
#else #else
#define VM_MASK 0 /* ignored */ #define X86_VM_MASK 0 /* No VM86 support */
#endif #endif
#define AC_MASK 0x00040000 #define AC_MASK 0x00040000
#define VIF_MASK 0x00080000 /* virtual interrupt flag */ #define VIF_MASK 0x00080000 /* virtual interrupt flag */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment