9 #include <linux/module.h>
10 #include <linux/wait.h>
11 #include <asm/uaccess.h>
12 #include <arch/system.h>
54 int protection,
int writeaccess)
61 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
62 ((writeaccess & 1) ? FAULT_FLAG_WRITE : 0);
65 "Page fault for %lX on %X at %lX, prot %d write %d\n",
67 protection, writeaccess));
127 if (!(vma->
vm_flags & VM_GROWSDOWN))
152 if (writeaccess == 2){
155 }
else if (writeaccess == 1) {
159 if (!(vma->
vm_flags & (VM_READ | VM_EXEC)))
171 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(
current))
174 if (
unlikely(fault & VM_FAULT_ERROR)) {
175 if (fault & VM_FAULT_OOM)
177 else if (fault & VM_FAULT_SIGBUS)
182 if (flags & FAULT_FLAG_ALLOW_RETRY) {
183 if (fault & VM_FAULT_MAJOR)
187 if (fault & VM_FAULT_RETRY) {
188 flags &= ~FAULT_FLAG_ALLOW_RETRY;
189 flags |= FAULT_FLAG_TRIED;
212 bad_area_nosemaphore:
219 "address %08lx at pc %08lx\n",
227 #ifdef CONFIG_NO_SEGFAULT_TERMINATION
234 info.si_addr = (
void *)address;
261 if ((
unsigned long) (address) <
PAGE_SIZE)
263 "pointer dereference");
266 " at virtual address %08lx\n", address);
268 die_if_kernel(
"Oops", regs, (writeaccess << 1) | protection);
296 info.si_addr = (
void *)address;
347 goto bad_area_nosemaphore;