linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / arm26 / kernel / traps.c
index f0a49fe..4110862 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/arm/kernel/traps.c
+ *  linux/arch/arm26/kernel/traps.c
  *
  *  Copyright (C) 1995-2002 Russell King
  *  Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds
  * published by the Free Software Foundation.
  *
  *  'traps.c' handles hardware exceptions after we have saved some state in
- *  'linux/arch/arm/lib/traps.S'.  Mostly a debugging aid, but will probably
+ *  'linux/arch/arm26/lib/traps.S'.  Mostly a debugging aid, but will probably
  *  kill the offending process.
  */
+
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -28,7 +30,6 @@
 
 #include <asm/atomic.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -131,11 +132,9 @@ static void dump_instr(struct pt_regs *regs)
 
 /*static*/ void __dump_stack(struct task_struct *tsk, unsigned long sp)
 {
-       dump_mem("Stack: ", sp, 8192+(unsigned long)tsk->thread_info);
+       dump_mem("Stack: ", sp, 8192+(unsigned long)task_stack_page(tsk));
 }
 
-EXPORT_SYMBOL(dump_stack);
-
 void dump_stack(void)
 {
 #ifdef CONFIG_DEBUG_ERRORS
@@ -143,6 +142,8 @@ void dump_stack(void)
 #endif
 }
 
+EXPORT_SYMBOL(dump_stack);
+
 //FIXME - was a static fn
 void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 {
@@ -157,7 +158,7 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
        } else if (verify_stack(fp)) {
                printk("invalid frame pointer 0x%08x", fp);
                ok = 0;
-       } else if (fp < (unsigned long)(tsk->thread_info + 1))
+       } else if (fp < (unsigned long)end_of_stack(tsk))
                printk("frame pointer underflow");
        printk("\n");
 
@@ -167,10 +168,10 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 
 /* FIXME - this is probably wrong.. */
 void show_stack(struct task_struct *task, unsigned long *sp) {
-       dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task->thread_info);
+       dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task_stack_page(task));
 }
 
-spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(die_lock);
 
 /*
  * This function is protected against re-entrancy.
@@ -185,8 +186,9 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
        printk("Internal error: %s: %x\n", str, err);
        printk("CPU: %d\n", smp_processor_id());
        show_regs(regs);
-       printk("Process %s (pid: %d, stack limit = 0x%p)\n",
-               current->comm, current->pid, tsk->thread_info + 1);
+       printk("Process %s (pid: %d[#%u], stack limit = 0x%p)\n",
+               current->comm, current->pid,
+               current->xid, end_of_stack(tsk));
 
        if (!user_mode(regs) || in_interrupt()) {
                __dump_stack(tsk, (unsigned long)(regs + 1));
@@ -425,7 +427,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
                return 0;
 
        case NR(usr26):
-       case NR(usr32):
                break;
 
        default: