Commit d729ab35 authored by Harvey Harrison's avatar Harvey Harrison Committed by Ingo Molnar

x86: use v8086_mode helper, trivial unification

Use v8086_mode inline in fault_32.c, no functional change
also ifdef the section for 32-bit only and add to fault_64.c
Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 5f5cd8fd
...@@ -475,14 +475,16 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code) ...@@ -475,14 +475,16 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
else else
tsk->min_flt++; tsk->min_flt++;
#ifdef CONFIG_X86_32
/* /*
* Did it hit the DOS screen memory VA from vm86 mode? * Did it hit the DOS screen memory VA from vm86 mode?
*/ */
if (regs->flags & VM_MASK) { if (v8086_mode(regs)) {
unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT; unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT;
if (bit < 32) if (bit < 32)
tsk->thread.screen_bitmap |= 1 << bit; tsk->thread.screen_bitmap |= 1 << bit;
} }
#endif
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
return; return;
......
...@@ -514,6 +514,17 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -514,6 +514,17 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
tsk->maj_flt++; tsk->maj_flt++;
else else
tsk->min_flt++; tsk->min_flt++;
#ifdef CONFIG_X86_32
/*
* Did it hit the DOS screen memory VA from vm86 mode?
*/
if (v8086_mode(regs)) {
unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT;
if (bit < 32)
tsk->thread.screen_bitmap |= 1 << bit;
}
#endif
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
return; return;
......
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