Commit 8e56af5d 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 a1c816f6
......@@ -20,6 +20,7 @@
#include "fault.h"
#ifdef CONFIG_MMU
/*
* This is useful to dump out the page tables associated with
* 'addr' in mm 'mm'.
......@@ -71,6 +72,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
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.
......@@ -145,6 +150,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
__do_kernel_fault(mm, addr, fsr, regs);
}
#ifdef CONFIG_MMU
#define VM_FAULT_BADMAP 0x010000
#define VM_FAULT_BADACCESS 0x020000
......@@ -293,6 +299,13 @@ no_context:
__do_kernel_fault(mm, addr, fsr, regs);
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
......@@ -311,6 +324,7 @@ no_context:
* interrupt or a critical region, and should only copy the information
* from the master page table, nothing more.
*/
#ifdef CONFIG_MMU
static int
do_translation_fault(unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
......@@ -349,6 +363,14 @@ bad_area:
do_bad_area(addr, fsr, regs);
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.
......
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