]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - arch/arm/mm/fault.c
ARM: 6269/1: Add 'code' parameter for hook_fault_code()
[lisovros/linux_canprio.git] / arch / arm / mm / fault.c
index 92f5801f99c1d09c735fb586c9c44bc5df802f13..84131c832430b129b4db1d9999e86dba926f8a9c 100644 (file)
@@ -393,6 +393,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
        if (addr < TASK_SIZE)
                return do_page_fault(addr, fsr, regs);
 
+       if (user_mode(regs))
+               goto bad_area;
+
        index = pgd_index(addr);
 
        /*
@@ -460,9 +463,9 @@ static struct fsr_info {
         * defines these to be "precise" aborts.
         */
        { do_bad,               SIGSEGV, 0,             "vector exception"                 },
-       { do_bad,               SIGILL,  BUS_ADRALN,    "alignment exception"              },
+       { do_bad,               SIGBUS,  BUS_ADRALN,    "alignment exception"              },
        { do_bad,               SIGKILL, 0,             "terminal exception"               },
-       { do_bad,               SIGILL,  BUS_ADRALN,    "alignment 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"      },
@@ -505,13 +508,15 @@ static struct fsr_info {
 
 void __init
 hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
-               int sig, const char *name)
+               int sig, int code, const char *name)
 {
-       if (nr >= 0 && nr < ARRAY_SIZE(fsr_info)) {
-               fsr_info[nr].fn   = fn;
-               fsr_info[nr].sig  = sig;
-               fsr_info[nr].name = name;
-       }
+       if (nr < 0 || nr >= ARRAY_SIZE(fsr_info))
+               BUG();
+
+       fsr_info[nr].fn   = fn;
+       fsr_info[nr].sig  = sig;
+       fsr_info[nr].code = code;
+       fsr_info[nr].name = name;
 }
 
 /*