Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / arch / sparc / kernel / traps.c
index 136a00c..e246a33 100644 (file)
@@ -9,7 +9,6 @@
  * I hate traps on the sparc, grrr...
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>  /* for jiffies */
 #include <linux/kernel.h>
 #include <linux/kallsyms.h>
@@ -100,7 +99,8 @@ void die_if_kernel(char *str, struct pt_regs *regs)
 "              /_| \\__/ |_\\\n"
 "                 \\__U_/\n");
 
-       printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter);
+       printk("%s(%d[#%u]): %s [#%d]\n", current->comm,
+               current->pid, current->xid, str, ++die_counter);
        show_regs(regs);
 
        __SAVE; __SAVE; __SAVE; __SAVE;
@@ -147,7 +147,7 @@ void do_hw_interrupt(struct pt_regs *regs, unsigned long type)
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code = ILL_ILLTRP;
-       info.si_addr = (void *)regs->pc;
+       info.si_addr = (void __user *)regs->pc;
        info.si_trapno = type - 0x80;
        force_sig_info(SIGILL, &info, current);
 }
@@ -170,7 +170,7 @@ void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned lon
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code = ILL_ILLOPC;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGILL, &info, current);
 }
@@ -185,7 +185,7 @@ void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long n
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code = ILL_PRVOPC;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGILL, &info, current);
 }
@@ -246,17 +246,17 @@ void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
                       &fptask->thread.fpqueue[0], &fptask->thread.fpqdepth);
        }
        last_task_used_math = current;
-       if(current->used_math) {
+       if(used_math()) {
                fpload(&current->thread.float_regs[0], &current->thread.fsr);
        } else {
                /* Set initial sane state. */
                fpload(&init_fregs[0], &init_fsr);
-               current->used_math = 1;
+               set_used_math();
        }
 #else
-       if(!current->used_math) {
+       if(!used_math()) {
                fpload(&init_fregs[0], &init_fsr);
-               current->used_math = 1;
+               set_used_math();
        } else {
                fpload(&current->thread.float_regs[0], &current->thread.fsr);
        }
@@ -291,7 +291,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
 #ifndef CONFIG_SMP
        if(!fpt) {
 #else
-        if(!(fpt->thread_info->flags & _TIF_USEDFPU)) {
+        if(!(task_thread_info(fpt)->flags & _TIF_USEDFPU)) {
 #endif
                fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth);
                regs->psr &= ~PSR_EF;
@@ -334,7 +334,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
        /* nope, better SIGFPE the offending process... */
               
 #ifdef CONFIG_SMP
-       fpt->thread_info->flags &= ~_TIF_USEDFPU;
+       task_thread_info(fpt)->flags &= ~_TIF_USEDFPU;
 #endif
        if(psr & PSR_PS) {
                /* The first fsr store/load we tried trapped,
@@ -354,7 +354,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
        fsr = fpt->thread.fsr;
        info.si_signo = SIGFPE;
        info.si_errno = 0;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        info.si_code = __SI_FAULT;
        if ((fsr & 0x1c000) == (1 << 14)) {
@@ -388,7 +388,7 @@ void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, unsigned long n
        info.si_signo = SIGEMT;
        info.si_errno = 0;
        info.si_code = EMT_TAGOVF;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGEMT, &info, current);
 }
@@ -417,7 +417,7 @@ void handle_reg_access(struct pt_regs *regs, unsigned long pc, unsigned long npc
        info.si_signo = SIGBUS;
        info.si_errno = 0;
        info.si_code = BUS_OBJERR;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        force_sig_info(SIGBUS, &info, current);
 }
@@ -430,7 +430,7 @@ void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, unsigned long np
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code = ILL_COPROC;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGILL, &info, current);
 }
@@ -447,7 +447,7 @@ void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long n
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code = ILL_COPROC;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGILL, &info, current);
 }
@@ -460,7 +460,7 @@ void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, unsigned long npc
        info.si_signo = SIGFPE;
        info.si_errno = 0;
        info.si_code = FPE_INTDIV;
-       info.si_addr = (void *)pc;
+       info.si_addr = (void __user *)pc;
        info.si_trapno = 0;
        send_sig_info(SIGFPE, &info, current);
 }