x86: use v8086_mode helper, trivial unification
Harvey Harrison [Wed, 30 Jan 2008 12:33:23 +0000 (13:33 +0100)]
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: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

arch/x86/mm/fault_32.c
arch/x86/mm/fault_64.c

index 276863d..93ede2d 100644 (file)
@@ -475,14 +475,16 @@ good_area:
        else
                tsk->min_flt++;
 
+#ifdef CONFIG_X86_32
        /*
         * 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;
                if (bit < 32)
                        tsk->thread.screen_bitmap |= 1 << bit;
        }
+#endif
        up_read(&mm->mmap_sem);
        return;
 
index 9ef0306..2d9e6da 100644 (file)
@@ -514,6 +514,17 @@ good_area:
                tsk->maj_flt++;
        else
                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);
        return;