16 #include <linux/module.h>
18 #include <asm/mmu_context.h>
19 #include <asm/cacheflush.h>
20 #include <asm/hardirq.h>
21 #include <asm/uaccess.h>
22 #include <asm/pgalloc.h>
27 #undef DEBUG_PAGE_FAULT
41 unsigned int exccause = regs->
exccause;
45 int is_write, is_exec;
47 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
70 #ifdef DEBUG_PAGE_FAULT
72 address, exccause, regs->
pc, is_write?
"w":
"", is_exec?
"x":
"");
98 flags |= FAULT_FLAG_WRITE;
103 if (!(vma->
vm_flags & (VM_READ | VM_WRITE)))
112 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(
current))
115 if (
unlikely(fault & VM_FAULT_ERROR)) {
116 if (fault & VM_FAULT_OOM)
118 else if (fault & VM_FAULT_SIGBUS)
122 if (flags & FAULT_FLAG_ALLOW_RETRY) {
123 if (fault & VM_FAULT_MAJOR)
127 if (fault & VM_FAULT_RETRY) {
128 flags &= ~FAULT_FLAG_ALLOW_RETRY;
129 flags |= FAULT_FLAG_TRIED;
150 current->thread.error_code = is_write;
154 info.si_addr = (
void *) address;
183 info.si_addr = (
void *) address;
234 extern void die(
const char*,
struct pt_regs*,
long);
239 #ifdef DEBUG_PAGE_FAULT
252 "address %08lx\n pc = %08lx, ra = %08lx\n",
253 address, regs->
pc, regs->
areg[0]);
254 die(
"Oops", regs, sig);