diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-07-24 07:34:55 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-07-24 07:34:55 -0400 |
commit | 09529f7a1a010cc364267fc5895a71c3853eb82c (patch) | |
tree | 67c02ab7314c48766812065a199c2277f7fe6688 /arch/arm/mm/fault.c | |
parent | 16c79651a5ee1ad7e4fca65a7c5309dfca89ed28 (diff) |
nommu: Fix the fault processing for the MMU-less case
The patch adds the necessary ifdefs around functions that only make
sense when the MMU is enabled.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mm/fault.c')
-rw-r--r-- | arch/arm/mm/fault.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 6fdcbb709827..ee01ccae3f58 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "fault.h" | 24 | #include "fault.h" |
25 | 25 | ||
26 | #ifdef CONFIG_MMU | ||
26 | 27 | ||
27 | #ifdef CONFIG_KPROBES | 28 | #ifdef CONFIG_KPROBES |
28 | static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) | 29 | static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) |
@@ -97,6 +98,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr) | |||
97 | 98 | ||
98 | printk("\n"); | 99 | printk("\n"); |
99 | } | 100 | } |
101 | #else /* CONFIG_MMU */ | ||
102 | void show_pte(struct mm_struct *mm, unsigned long addr) | ||
103 | { } | ||
104 | #endif /* CONFIG_MMU */ | ||
100 | 105 | ||
101 | /* | 106 | /* |
102 | * Oops. The kernel tried to access some page that wasn't present. | 107 | * Oops. The kernel tried to access some page that wasn't present. |
@@ -171,6 +176,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
171 | __do_kernel_fault(mm, addr, fsr, regs); | 176 | __do_kernel_fault(mm, addr, fsr, regs); |
172 | } | 177 | } |
173 | 178 | ||
179 | #ifdef CONFIG_MMU | ||
174 | #define VM_FAULT_BADMAP 0x010000 | 180 | #define VM_FAULT_BADMAP 0x010000 |
175 | #define VM_FAULT_BADACCESS 0x020000 | 181 | #define VM_FAULT_BADACCESS 0x020000 |
176 | 182 | ||
@@ -322,6 +328,13 @@ no_context: | |||
322 | __do_kernel_fault(mm, addr, fsr, regs); | 328 | __do_kernel_fault(mm, addr, fsr, regs); |
323 | return 0; | 329 | return 0; |
324 | } | 330 | } |
331 | #else /* CONFIG_MMU */ | ||
332 | static int | ||
333 | do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | ||
334 | { | ||
335 | return 0; | ||
336 | } | ||
337 | #endif /* CONFIG_MMU */ | ||
325 | 338 | ||
326 | /* | 339 | /* |
327 | * First Level Translation Fault Handler | 340 | * First Level Translation Fault Handler |
@@ -340,6 +353,7 @@ no_context: | |||
340 | * interrupt or a critical region, and should only copy the information | 353 | * interrupt or a critical region, and should only copy the information |
341 | * from the master page table, nothing more. | 354 | * from the master page table, nothing more. |
342 | */ | 355 | */ |
356 | #ifdef CONFIG_MMU | ||
343 | static int __kprobes | 357 | static int __kprobes |
344 | do_translation_fault(unsigned long addr, unsigned int fsr, | 358 | do_translation_fault(unsigned long addr, unsigned int fsr, |
345 | struct pt_regs *regs) | 359 | struct pt_regs *regs) |
@@ -378,6 +392,14 @@ bad_area: | |||
378 | do_bad_area(addr, fsr, regs); | 392 | do_bad_area(addr, fsr, regs); |
379 | return 0; | 393 | return 0; |
380 | } | 394 | } |
395 | #else /* CONFIG_MMU */ | ||
396 | static int | ||
397 | do_translation_fault(unsigned long addr, unsigned int fsr, | ||
398 | struct pt_regs *regs) | ||
399 | { | ||
400 | return 0; | ||
401 | } | ||
402 | #endif /* CONFIG_MMU */ | ||
381 | 403 | ||
382 | /* | 404 | /* |
383 | * Some section permission faults need to be handled gracefully. | 405 | * Some section permission faults need to be handled gracefully. |