20 #include <linux/module.h>
21 #include <linux/sched.h>
23 #include <asm/uaccess.h>
24 #include <asm/siginfo.h>
25 #include <asm/signal.h>
27 #define NUM_TLB_ENTRIES 64
28 #define TLB_OFFSET(add) (((add) >> PAGE_SHIFT) & (NUM_TLB_ENTRIES-1))
38 extern void die(
char *,
struct pt_regs *,
long);
50 unsigned long vector,
int write_acc)
57 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
81 (vector != 0x300 && vector != 0x400) &&
119 if (!(vma->
vm_flags & VM_GROWSDOWN))
129 if (address + PAGE_SIZE < regs->
sp)
148 flags |= FAULT_FLAG_WRITE;
151 if (!(vma->
vm_flags & (VM_READ | VM_EXEC)))
167 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(
current))
170 if (
unlikely(fault & VM_FAULT_ERROR)) {
171 if (fault & VM_FAULT_OOM)
173 else if (fault & VM_FAULT_SIGBUS)
178 if (flags & FAULT_FLAG_ALLOW_RETRY) {
180 if (fault & VM_FAULT_MAJOR)
184 if (fault & VM_FAULT_RETRY) {
185 flags &= ~FAULT_FLAG_ALLOW_RETRY;
186 flags |= FAULT_FLAG_TRIED;
208 bad_area_nosemaphore:
216 info.si_addr = (
void *)address;
235 __asm__ __volatile__(
"l.nop 42");
249 if ((
unsigned long)(address) <
PAGE_SIZE)
251 "Unable to handle kernel NULL pointer dereference");
254 printk(
" at virtual address 0x%08lx\n", address);
256 die(
"Oops", regs, write_acc);
266 __asm__ __volatile__(
"l.nop 42");
267 __asm__ __volatile__(
"l.nop 1");
270 printk(
"VM: killing process %s\n", tsk->
comm);
285 info.si_addr = (
void *)address;
319 pgd = (
pgd_t *)current_pgd + offset;
343 goto bad_area_nosemaphore;