]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/cris/mm/fault.c
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
[linux-2.6-omap-h63xx.git] / arch / cris / mm / fault.c
index c73e91f1299a773ec8964f512f169429e16b6175..8aab814306955a68a150a2453cfcb72f62c2441f 100644 (file)
@@ -179,6 +179,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
        struct mm_struct *mm;
        struct vm_area_struct * vma;
        siginfo_t info;
+       int fault;
 
         D(printk("Page fault for %lX on %X at %lX, prot %d write %d\n",
                  address, smp_processor_id(), instruction_pointer(regs),
@@ -283,18 +284,18 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
         * the fault.
         */
 
-       switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) {
-       case VM_FAULT_MINOR:
-               tsk->min_flt++;
-               break;
-       case VM_FAULT_MAJOR:
-               tsk->maj_flt++;
-               break;
-       case VM_FAULT_SIGBUS:
-               goto do_sigbus;
-       default:
-               goto out_of_memory;
+       fault = handle_mm_fault(mm, vma, address, writeaccess & 1);
+       if (unlikely(fault & VM_FAULT_ERROR)) {
+               if (fault & VM_FAULT_OOM)
+                       goto out_of_memory;
+               else if (fault & VM_FAULT_SIGBUS)
+                       goto do_sigbus;
+               BUG();
        }
+       if (fault & VM_FAULT_MAJOR)
+               tsk->maj_flt++;
+       else
+               tsk->min_flt++;
 
        up_read(&mm->mmap_sem);
        return;
@@ -359,7 +360,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
        up_read(&mm->mmap_sem);
        printk("VM: killing process %s\n", tsk->comm);
        if (user_mode(regs))
-               do_exit(SIGKILL);
+               do_group_exit(SIGKILL);
        goto no_context;
 
  do_sigbus: