Merge nommu tree
[sfrench/cifs-2.6.git] / arch / arm / kernel / traps.c
index 93cfd3ffcc72b6cbc90ff6c7ff8f808b15e3ea15..35230a06010813b0131808acb2fb01ca2bc8c636 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/personality.h>
 #include <linux/ptrace.h>
 #include <linux/kallsyms.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 
 #include <asm/atomic.h>
@@ -231,6 +232,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
        __die(str, err, thread, regs);
        bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
+
+       if (panic_on_oops) {
+               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+               ssleep(5);
+               panic("Fatal exception");
+       }
+
        do_exit(SIGSEGV);
 }
 
@@ -404,7 +412,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
        struct thread_info *thread = current_thread_info();
        siginfo_t info;
 
-       if ((no >> 16) != 0x9f)
+       if ((no >> 16) != (__ARM_NR_BASE>> 16))
                return bad_syscall(no, regs);
 
        switch (no & 0xffff) {
@@ -498,7 +506,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
                if (!pmd_present(*pmd))
                        goto bad_access;
                pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
-               if (!pte_present(*pte) || !pte_write(*pte)) {
+               if (!pte_present(*pte) || !pte_dirty(*pte)) {
                        pte_unmap_unlock(pte, ptl);
                        goto bad_access;
                }
@@ -680,6 +688,7 @@ EXPORT_SYMBOL(abort);
 
 void __init trap_init(void)
 {
+       unsigned long vectors = CONFIG_VECTORS_BASE;
        extern char __stubs_start[], __stubs_end[];
        extern char __vectors_start[], __vectors_end[];
        extern char __kuser_helper_start[], __kuser_helper_end[];
@@ -690,9 +699,9 @@ void __init trap_init(void)
         * into the vector page, mapped at 0xffff0000, and ensure these
         * are visible to the instruction stream.
         */
-       memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start);
-       memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start);
-       memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz);
+       memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start);
+       memcpy((void *)vectors + 0x200, __stubs_start, __stubs_end - __stubs_start);
+       memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
 
        /*
         * Copy signal return handlers into the vector page, and
@@ -701,6 +710,6 @@ void __init trap_init(void)
        memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
               sizeof(sigreturn_codes));
 
-       flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);
+       flush_icache_range(vectors, vectors + PAGE_SIZE);
        modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
 }