Commit 09529f7a authored by Catalin Marinas's avatar Catalin Marinas

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: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 16c79651
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "fault.h" #include "fault.h"
#ifdef CONFIG_MMU
#ifdef CONFIG_KPROBES #ifdef CONFIG_KPROBES
static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) 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,6 +98,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
printk("\n"); printk("\n");
} }
#else /* CONFIG_MMU */
void show_pte(struct mm_struct *mm, unsigned long addr)
{ }
#endif /* CONFIG_MMU */
/* /*
* Oops. The kernel tried to access some page that wasn't present. * 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,6 +176,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
__do_kernel_fault(mm, addr, fsr, regs); __do_kernel_fault(mm, addr, fsr, regs);
} }
#ifdef CONFIG_MMU
#define VM_FAULT_BADMAP 0x010000 #define VM_FAULT_BADMAP 0x010000
#define VM_FAULT_BADACCESS 0x020000 #define VM_FAULT_BADACCESS 0x020000
...@@ -322,6 +328,13 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ...@@ -322,6 +328,13 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
__do_kernel_fault(mm, addr, fsr, regs); __do_kernel_fault(mm, addr, fsr, regs);
return 0; return 0;
} }
#else /* CONFIG_MMU */
static int
do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
return 0;
}
#endif /* CONFIG_MMU */
/* /*
* First Level Translation Fault Handler * First Level Translation Fault Handler
...@@ -340,6 +353,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ...@@ -340,6 +353,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
* interrupt or a critical region, and should only copy the information * interrupt or a critical region, and should only copy the information
* from the master page table, nothing more. * from the master page table, nothing more.
*/ */
#ifdef CONFIG_MMU
static int __kprobes static int __kprobes
do_translation_fault(unsigned long addr, unsigned int fsr, do_translation_fault(unsigned long addr, unsigned int fsr,
struct pt_regs *regs) struct pt_regs *regs)
...@@ -378,6 +392,14 @@ do_translation_fault(unsigned long addr, unsigned int fsr, ...@@ -378,6 +392,14 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
do_bad_area(addr, fsr, regs); do_bad_area(addr, fsr, regs);
return 0; return 0;
} }
#else /* CONFIG_MMU */
static int
do_translation_fault(unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
{
return 0;
}
#endif /* CONFIG_MMU */
/* /*
* Some section permission faults need to be handled gracefully. * Some section permission faults need to be handled gracefully.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment