X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=arch%2Fparisc%2Fmm%2Ffault.c;h=b2e3e9a8cecefce049d43ef1a5d36d61403cc9b9;hb=407d819cf0fd54c6fc1138a509225696aecafd15;hp=f6f67554c6235d4aceb5c51d2c3b5c0a82051d1b;hpb=c207908fcc451e31d7fbba31541bd04f93787eb4;p=linux-2.6-omap-h63xx.git diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index f6f67554c62..b2e3e9a8cec 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -147,6 +147,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, struct mm_struct *mm = tsk->mm; const struct exception_table_entry *fix; unsigned long acc_type; + int fault; if (in_atomic() || !mm) goto no_context; @@ -173,23 +174,23 @@ good_area: * fault. */ - switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { - case VM_FAULT_MINOR: - ++current->min_flt; - break; - case VM_FAULT_MAJOR: - ++current->maj_flt; - break; - case VM_FAULT_SIGBUS: + fault = handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0); + if (unlikely(fault & VM_FAULT_ERROR)) { /* * We hit a shared mapping outside of the file, or some * other thing happened to us that made us unable to * handle the page fault gracefully. */ - goto bad_area; - default: - goto out_of_memory; + if (fault & VM_FAULT_OOM) + goto out_of_memory; + else if (fault & VM_FAULT_SIGBUS) + goto bad_area; + BUG(); } + if (fault & VM_FAULT_MAJOR) + current->maj_flt++; + else + current->min_flt++; up_read(&mm->mmap_sem); return; @@ -210,7 +211,7 @@ bad_area: #ifdef PRINT_USER_FAULTS printk(KERN_DEBUG "\n"); printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", - tsk->pid, tsk->comm, code, address); + task_pid_nr(tsk), tsk->comm, code, address); if (vma) { printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", vma->vm_start, vma->vm_end); @@ -262,6 +263,6 @@ no_context: up_read(&mm->mmap_sem); printk(KERN_CRIT "VM: killing process %s\n", current->comm); if (user_mode(regs)) - do_exit(SIGKILL); + do_group_exit(SIGKILL); goto no_context; }