diff options
Diffstat (limited to 'arch/arm/mm/fault.c')
-rw-r--r-- | arch/arm/mm/fault.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 6fdcbb709827..cc8829d7e116 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/kprobes.h> | 16 | #include <linux/kprobes.h> |
17 | #include <linux/uaccess.h> | 17 | #include <linux/uaccess.h> |
18 | #include <linux/page-flags.h> | 18 | #include <linux/page-flags.h> |
19 | #include <linux/sched.h> | ||
20 | #include <linux/highmem.h> | ||
19 | 21 | ||
20 | #include <asm/system.h> | 22 | #include <asm/system.h> |
21 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
@@ -23,6 +25,7 @@ | |||
23 | 25 | ||
24 | #include "fault.h" | 26 | #include "fault.h" |
25 | 27 | ||
28 | #ifdef CONFIG_MMU | ||
26 | 29 | ||
27 | #ifdef CONFIG_KPROBES | 30 | #ifdef CONFIG_KPROBES |
28 | static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) | 31 | static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) |
@@ -97,6 +100,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr) | |||
97 | 100 | ||
98 | printk("\n"); | 101 | printk("\n"); |
99 | } | 102 | } |
103 | #else /* CONFIG_MMU */ | ||
104 | void show_pte(struct mm_struct *mm, unsigned long addr) | ||
105 | { } | ||
106 | #endif /* CONFIG_MMU */ | ||
100 | 107 | ||
101 | /* | 108 | /* |
102 | * Oops. The kernel tried to access some page that wasn't present. | 109 | * Oops. The kernel tried to access some page that wasn't present. |
@@ -171,6 +178,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
171 | __do_kernel_fault(mm, addr, fsr, regs); | 178 | __do_kernel_fault(mm, addr, fsr, regs); |
172 | } | 179 | } |
173 | 180 | ||
181 | #ifdef CONFIG_MMU | ||
174 | #define VM_FAULT_BADMAP 0x010000 | 182 | #define VM_FAULT_BADMAP 0x010000 |
175 | #define VM_FAULT_BADACCESS 0x020000 | 183 | #define VM_FAULT_BADACCESS 0x020000 |
176 | 184 | ||
@@ -322,6 +330,13 @@ no_context: | |||
322 | __do_kernel_fault(mm, addr, fsr, regs); | 330 | __do_kernel_fault(mm, addr, fsr, regs); |
323 | return 0; | 331 | return 0; |
324 | } | 332 | } |
333 | #else /* CONFIG_MMU */ | ||
334 | static int | ||
335 | do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | ||
336 | { | ||
337 | return 0; | ||
338 | } | ||
339 | #endif /* CONFIG_MMU */ | ||
325 | 340 | ||
326 | /* | 341 | /* |
327 | * First Level Translation Fault Handler | 342 | * First Level Translation Fault Handler |
@@ -340,6 +355,7 @@ no_context: | |||
340 | * interrupt or a critical region, and should only copy the information | 355 | * interrupt or a critical region, and should only copy the information |
341 | * from the master page table, nothing more. | 356 | * from the master page table, nothing more. |
342 | */ | 357 | */ |
358 | #ifdef CONFIG_MMU | ||
343 | static int __kprobes | 359 | static int __kprobes |
344 | do_translation_fault(unsigned long addr, unsigned int fsr, | 360 | do_translation_fault(unsigned long addr, unsigned int fsr, |
345 | struct pt_regs *regs) | 361 | struct pt_regs *regs) |
@@ -378,6 +394,14 @@ bad_area: | |||
378 | do_bad_area(addr, fsr, regs); | 394 | do_bad_area(addr, fsr, regs); |
379 | return 0; | 395 | return 0; |
380 | } | 396 | } |
397 | #else /* CONFIG_MMU */ | ||
398 | static int | ||
399 | do_translation_fault(unsigned long addr, unsigned int fsr, | ||
400 | struct pt_regs *regs) | ||
401 | { | ||
402 | return 0; | ||
403 | } | ||
404 | #endif /* CONFIG_MMU */ | ||
381 | 405 | ||
382 | /* | 406 | /* |
383 | * Some section permission faults need to be handled gracefully. | 407 | * Some section permission faults need to be handled gracefully. |