2 * linux/arch/arm/mm/fault-armo.c
4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-1999 Russell King
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #include <linux/signal.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/errno.h>
15 #include <linux/string.h>
16 #include <linux/types.h>
17 #include <linux/ptrace.h>
18 #include <linux/mman.h>
20 #include <linux/interrupt.h>
22 #include <asm/system.h>
23 #include <asm/uaccess.h>
24 #include <asm/pgtable.h>
26 #define FAULT_CODE_FORCECOW 0x80
27 #define FAULT_CODE_PREFETCH 0x04
28 #define FAULT_CODE_WRITE 0x02
30 #define DO_COW(m) ((m) & (FAULT_CODE_WRITE|FAULT_CODE_FORCECOW))
31 #define READ_FAULT(m) (!((m) & FAULT_CODE_WRITE))
33 #include "fault-common.c"
36 * Handle a data abort. Note that we have to handle a range of addresses
37 * on ARM2/3 for ldm. If both pages are zero-mapped, then we have to force
38 * a copy-on-write. However, on the second page, we always force COW.
41 do_DataAbort(unsigned long min_addr, unsigned long max_addr, int mode, struct pt_regs *regs)
43 do_page_fault(min_addr, mode, regs);
45 if ((min_addr ^ max_addr) >> PAGE_SHIFT)
46 do_page_fault(max_addr, mode | FAULT_CODE_FORCECOW, regs);
50 do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
53 if (the memc mapping for this page exists) {
54 printk ("Page in, but got abort (undefined instruction?)\n");
58 do_page_fault(addr, FAULT_CODE_PREFETCH, regs);