X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fsparc%2Fmm%2Ffault.c;h=50747fe443568219995122592797e6e9f0be00c1;hb=5e16e3f0e24dadb79b96b6134cd3303f0d42f0c5;hp=9eeed3347df3297f4790ff8a7f39b73fa4a38f6e;hpb=e130bedb7ce718a8eb6b56a3806b96281f618111;p=linux-2.6-omap-h63xx.git diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c index 9eeed3347df..50747fe4435 100644 --- a/arch/sparc/mm/fault.c +++ b/arch/sparc/mm/fault.c @@ -18,9 +18,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -30,7 +30,6 @@ #include #include #include -#include #include extern int prom_node_root; @@ -227,6 +226,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, unsigned long g2; siginfo_t info; int from_user = !(regs->psr & PSR_PS); + int fault; if(text_fault) address = regs->pc; @@ -290,19 +290,18 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault. */ - switch (handle_mm_fault(mm, vma, address, write)) { - case VM_FAULT_SIGBUS: - goto do_sigbus; - case VM_FAULT_OOM: - goto out_of_memory; - case VM_FAULT_MAJOR: + fault = handle_mm_fault(mm, vma, address, write); + 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) current->maj_flt++; - break; - case VM_FAULT_MINOR: - default: + else current->min_flt++; - break; - } up_read(&mm->mmap_sem); return;