Move FAULT_FLAG_xyz into handle_mm_fault() callers
[linux-2.6-block.git] / arch / sh / mm / fault_32.c
index 898d477e47c171e6930832d950d85f0a3bd9a617..cc8ddbdf3d7a75005c2c9590fe386d20bb79050c 100644 (file)
@@ -20,7 +20,6 @@
 #include <asm/system.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbflush.h>
-#include <asm/kgdb.h>
 
 /*
  * This routine handles page faults.  It determines the address,
@@ -134,7 +133,7 @@ good_area:
         * the fault.
         */
 survive:
-       fault = handle_mm_fault(mm, vma, address, writeaccess);
+       fault = handle_mm_fault(mm, vma, address, writeaccess ? FAULT_FLAG_WRITE : 0);
        if (unlikely(fault & VM_FAULT_ERROR)) {
                if (fault & VM_FAULT_OOM)
                        goto out_of_memory;
@@ -250,9 +249,6 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap)
 {
        int ret = 0;
 
-       trace_mark(kernel_arch_trap_entry, "trap_id %d ip #p%ld",
-                  trap >> 5, instruction_pointer(regs));
-
 #ifdef CONFIG_KPROBES
        if (!user_mode(regs)) {
                preempt_disable();
@@ -265,17 +261,6 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap)
        return ret;
 }
 
-#ifdef CONFIG_SH_STORE_QUEUES
-/*
- * This is a special case for the SH-4 store queues, as pages for this
- * space still need to be faulted in before it's possible to flush the
- * store queue cache for writeout to the remapped region.
- */
-#define P3_ADDR_MAX            (P4SEG_STORE_QUE + 0x04000000)
-#else
-#define P3_ADDR_MAX            P4SEG
-#endif
-
 /*
  * Called with interrupts disabled.
  */
@@ -293,11 +278,6 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
        if (notify_page_fault(regs, lookup_exception_vector()))
                goto out;
 
-#ifdef CONFIG_SH_KGDB
-       if (kgdb_nofault && kgdb_bus_err_hook)
-               kgdb_bus_err_hook();
-#endif
-
        ret = 1;
 
        /*
@@ -344,6 +324,5 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
 
        ret = 0;
 out:
-       trace_mark(kernel_arch_trap_exit, MARK_NOARGS);
        return ret;
 }