Merge branches 'fixes', 'pgt-next' and 'versatile' into devel
[pandora-kernel.git] / arch / arm / kernel / traps.c
index 10f5b89..f0000e1 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/kexec.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/sched.h>
 
 #include <asm/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/unwind.h>
 #include <asm/tls.h>
 
-#include "ptrace.h"
 #include "signal.h"
 
 static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
 
+void *vectors_page;
+
 #ifdef CONFIG_DEBUG_USER
 unsigned int user_debug;
 
@@ -254,7 +256,7 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
        return ret;
 }
 
-DEFINE_SPINLOCK(die_lock);
+static DEFINE_SPINLOCK(die_lock);
 
 /*
  * This function is protected against re-entrancy.
@@ -756,7 +758,11 @@ static void __init kuser_get_tls_init(unsigned long vectors)
 
 void __init early_trap_init(void)
 {
+#if defined(CONFIG_CPU_USE_DOMAINS)
        unsigned long vectors = CONFIG_VECTORS_BASE;
+#else
+       unsigned long vectors = (unsigned long)vectors_page;
+#endif
        extern char __stubs_start[], __stubs_end[];
        extern char __vectors_start[], __vectors_end[];
        extern char __kuser_helper_start[], __kuser_helper_end[];
@@ -780,10 +786,10 @@ void __init early_trap_init(void)
         * Copy signal return handlers into the vector page, and
         * set sigreturn to be a pointer to these.
         */
-       memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
-              sizeof(sigreturn_codes));
-       memcpy((void *)KERN_RESTART_CODE, syscall_restart_code,
-              sizeof(syscall_restart_code));
+       memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE),
+              sigreturn_codes, sizeof(sigreturn_codes));
+       memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE),
+              syscall_restart_code, sizeof(syscall_restart_code));
 
        flush_icache_range(vectors, vectors + PAGE_SIZE);
        modify_domain(DOMAIN_USER, DOMAIN_CLIENT);