aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mm/fault.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2010-07-22 13:23:25 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-27 10:48:41 +0100
commit993bf4ec8c2a2b7979389ab196bf2fe217117158 (patch)
treea7363405e866c1ae7a6259fb7fc85adf2208adaa /arch/arm/mm/fault.c
parent33a9c41bf5d8adae9d882513e617c4c645195e71 (diff)
ARM: 6256/1: Check arch version and modify fsr_info[] depends on it at runtime
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/fault.c')
-rw-r--r--arch/arm/mm/fault.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 564b1c4829e..5835e63454f 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -475,12 +475,7 @@ static struct fsr_info {
{ do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
{ do_bad, SIGKILL, 0, "terminal exception" },
{ do_bad, SIGBUS, BUS_ADRALN, "alignment exception" },
-/* Do we need runtime check ? */
-#if __LINUX_ARM_ARCH__ < 6
{ do_bad, SIGBUS, 0, "external abort on linefetch" },
-#else
- { do_translation_fault, SIGSEGV, SEGV_MAPERR, "I-cache maintenance fault" },
-#endif
{ do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
{ do_bad, SIGBUS, 0, "external abort on linefetch" },
{ do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
@@ -605,3 +600,14 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
arm_notify_die("", regs, &info, ifsr, 0);
}
+static int __init exceptions_init(void)
+{
+ if (cpu_architecture() >= CPU_ARCH_ARMv6) {
+ hook_fault_code(4, do_translation_fault, SIGSEGV, SEGV_MAPERR,
+ "I-cache maintenance fault");
+ }
+
+ return 0;
+}
+
+arch_initcall(exceptions_init);