aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/mm
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/mn10300/mm
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/mn10300/mm')
-rw-r--r--arch/mn10300/mm/dma-alloc.c1
-rw-r--r--arch/mn10300/mm/fault.c34
-rw-r--r--arch/mn10300/mm/init.c1
-rw-r--r--arch/mn10300/mm/misalignment.c1
-rw-r--r--arch/mn10300/mm/pgtable.c3
-rw-r--r--arch/mn10300/mm/tlb-smp.c1
6 files changed, 14 insertions, 27 deletions
diff --git a/arch/mn10300/mm/dma-alloc.c b/arch/mn10300/mm/dma-alloc.c
index e244ebe637e..159acb02cfd 100644
--- a/arch/mn10300/mm/dma-alloc.c
+++ b/arch/mn10300/mm/dma-alloc.c
@@ -15,7 +15,6 @@
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/gfp.h> 17#include <linux/gfp.h>
18#include <linux/export.h>
19#include <asm/io.h> 18#include <asm/io.h>
20 19
21static unsigned long pci_sram_allocated = 0xbc000000; 20static unsigned long pci_sram_allocated = 0xbc000000;
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c
index d48a84fd7fa..0945409a802 100644
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/vt_kern.h> /* For unblank_screen() */ 25#include <linux/vt_kern.h> /* For unblank_screen() */
26 26
27#include <asm/system.h>
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/pgalloc.h> 29#include <asm/pgalloc.h>
29#include <asm/hardirq.h> 30#include <asm/hardirq.h>
@@ -123,8 +124,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long fault_code,
123 struct mm_struct *mm; 124 struct mm_struct *mm;
124 unsigned long page; 125 unsigned long page;
125 siginfo_t info; 126 siginfo_t info;
126 int fault; 127 int write, fault;
127 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
128 128
129#ifdef CONFIG_GDBSTUB 129#ifdef CONFIG_GDBSTUB
130 /* handle GDB stub causing a fault */ 130 /* handle GDB stub causing a fault */
@@ -171,7 +171,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long fault_code,
171 if (in_atomic() || !mm) 171 if (in_atomic() || !mm)
172 goto no_context; 172 goto no_context;
173 173
174retry:
175 down_read(&mm->mmap_sem); 174 down_read(&mm->mmap_sem);
176 175
177 vma = find_vma(mm, address); 176 vma = find_vma(mm, address);
@@ -222,6 +221,7 @@ retry:
222 */ 221 */
223good_area: 222good_area:
224 info.si_code = SEGV_ACCERR; 223 info.si_code = SEGV_ACCERR;
224 write = 0;
225 switch (fault_code & (MMUFCR_xFC_PGINVAL|MMUFCR_xFC_TYPE)) { 225 switch (fault_code & (MMUFCR_xFC_PGINVAL|MMUFCR_xFC_TYPE)) {
226 default: /* 3: write, present */ 226 default: /* 3: write, present */
227 case MMUFCR_xFC_TYPE_WRITE: 227 case MMUFCR_xFC_TYPE_WRITE:
@@ -233,7 +233,7 @@ good_area:
233 case MMUFCR_xFC_PGINVAL | MMUFCR_xFC_TYPE_WRITE: 233 case MMUFCR_xFC_PGINVAL | MMUFCR_xFC_TYPE_WRITE:
234 if (!(vma->vm_flags & VM_WRITE)) 234 if (!(vma->vm_flags & VM_WRITE))
235 goto bad_area; 235 goto bad_area;
236 flags |= FAULT_FLAG_WRITE; 236 write++;
237 break; 237 break;
238 238
239 /* read from protected page */ 239 /* read from protected page */
@@ -252,11 +252,7 @@ good_area:
252 * make sure we exit gracefully rather than endlessly redo 252 * make sure we exit gracefully rather than endlessly redo
253 * the fault. 253 * the fault.
254 */ 254 */
255 fault = handle_mm_fault(mm, vma, address, flags); 255 fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
256
257 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
258 return;
259
260 if (unlikely(fault & VM_FAULT_ERROR)) { 256 if (unlikely(fault & VM_FAULT_ERROR)) {
261 if (fault & VM_FAULT_OOM) 257 if (fault & VM_FAULT_OOM)
262 goto out_of_memory; 258 goto out_of_memory;
@@ -264,22 +260,10 @@ good_area:
264 goto do_sigbus; 260 goto do_sigbus;
265 BUG(); 261 BUG();
266 } 262 }
267 if (flags & FAULT_FLAG_ALLOW_RETRY) { 263 if (fault & VM_FAULT_MAJOR)
268 if (fault & VM_FAULT_MAJOR) 264 current->maj_flt++;
269 current->maj_flt++; 265 else
270 else 266 current->min_flt++;
271 current->min_flt++;
272 if (fault & VM_FAULT_RETRY) {
273 flags &= ~FAULT_FLAG_ALLOW_RETRY;
274
275 /* No need to up_read(&mm->mmap_sem) as we would
276 * have already released it in __lock_page_or_retry
277 * in mm/filemap.c.
278 */
279
280 goto retry;
281 }
282 }
283 267
284 up_read(&mm->mmap_sem); 268 up_read(&mm->mmap_sem);
285 return; 269 return;
diff --git a/arch/mn10300/mm/init.c b/arch/mn10300/mm/init.c
index e57e5bc2356..13801824e3e 100644
--- a/arch/mn10300/mm/init.c
+++ b/arch/mn10300/mm/init.c
@@ -29,6 +29,7 @@
29#include <linux/gfp.h> 29#include <linux/gfp.h>
30 30
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34#include <asm/pgalloc.h> 35#include <asm/pgalloc.h>
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index b9920b1edd5..f9bb8cb1c14 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/system.h>
26#include <asm/uaccess.h> 27#include <asm/uaccess.h>
27#include <asm/io.h> 28#include <asm/io.h>
28#include <linux/atomic.h> 29#include <linux/atomic.h>
diff --git a/arch/mn10300/mm/pgtable.c b/arch/mn10300/mm/pgtable.c
index bd9ada693f9..450f7ba3f8f 100644
--- a/arch/mn10300/mm/pgtable.c
+++ b/arch/mn10300/mm/pgtable.c
@@ -21,6 +21,7 @@
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/quicklist.h> 22#include <linux/quicklist.h>
23 23
24#include <asm/system.h>
24#include <asm/pgtable.h> 25#include <asm/pgtable.h>
25#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
26#include <asm/tlb.h> 27#include <asm/tlb.h>
@@ -95,7 +96,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
95 * checks at dup_mmap(), exec(), and other mmlist addition points 96 * checks at dup_mmap(), exec(), and other mmlist addition points
96 * could be used. The locking scheme was chosen on the basis of 97 * could be used. The locking scheme was chosen on the basis of
97 * manfred's recommendations and having no core impact whatsoever. 98 * manfred's recommendations and having no core impact whatsoever.
98 * -- nyc 99 * -- wli
99 */ 100 */
100DEFINE_SPINLOCK(pgd_lock); 101DEFINE_SPINLOCK(pgd_lock);
101struct page *pgd_list; 102struct page *pgd_list;
diff --git a/arch/mn10300/mm/tlb-smp.c b/arch/mn10300/mm/tlb-smp.c
index 3e57faf0408..9a777498a91 100644
--- a/arch/mn10300/mm/tlb-smp.c
+++ b/arch/mn10300/mm/tlb-smp.c
@@ -24,6 +24,7 @@
24#include <linux/profile.h> 24#include <linux/profile.h>
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27#include <asm/system.h>
27#include <asm/bitops.h> 28#include <asm/bitops.h>
28#include <asm/processor.h> 29#include <asm/processor.h>
29#include <asm/bug.h> 30#include <asm/bug.h>