vserver 1.9.3
[linux-2.6.git] / arch / ia64 / kernel / traps.c
index e021594..3dd9b1d 100644 (file)
 #include <linux/tty.h>
 #include <linux/vt_kern.h>             /* For unblank_screen() */
 #include <linux/module.h>       /* for EXPORT_SYMBOL */
+#include <linux/hardirq.h>
 
 #include <asm/fpswa.h>
-#include <asm/hardirq.h>
 #include <asm/ia32.h>
 #include <asm/intrinsics.h>
 #include <asm/processor.h>
 #include <asm/uaccess.h>
 
-/*
- * fp_emulate() needs to be able to access and update all floating point registers.  Those
- * saved in pt_regs can be accessed through that structure, but those not saved, will be
- * accessed directly.  To make this work, we need to ensure that the compiler does not end
- * up using a preserved floating point register on its own.  The following achieves this
- * by declaring preserved registers that are not marked as "fixed" as global register
- * variables.
- */
-#ifdef ASM_SUPPORTED
-register double f2 asm ("f2"); register double f3 asm ("f3");
-register double f4 asm ("f4"); register double f5 asm ("f5");
-
-register long f16 asm ("f16"); register long f17 asm ("f17");
-register long f18 asm ("f18"); register long f19 asm ("f19");
-register long f20 asm ("f20"); register long f21 asm ("f21");
-register long f22 asm ("f22"); register long f23 asm ("f23");
-
-register double f24 asm ("f24"); register double f25 asm ("f25");
-register double f26 asm ("f26"); register double f27 asm ("f27");
-register double f28 asm ("f28"); register double f29 asm ("f29");
-register double f30 asm ("f30"); register double f31 asm ("f31");
-#endif
-
 extern spinlock_t timerlist_lock;
 
 fpswa_interface_t *fpswa_interface;
@@ -135,7 +112,7 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
        int sig, code;
 
        /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
-       siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+       siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
        siginfo.si_imm = break_num;
        siginfo.si_flags = 0;           /* clear __ISR_VALID */
        siginfo.si_isr = 0;
@@ -305,7 +282,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
        fault_ip = regs->cr_iip;
        if (!fp_fault && (ia64_psr(regs)->ri == 0))
                fault_ip -= 16;
-       if (copy_from_user(bundle, (void *) fault_ip, sizeof(bundle)))
+       if (copy_from_user(bundle, (void __user *) fault_ip, sizeof(bundle)))
                return -1;
 
        if (jiffies - last_time > 5*HZ)
@@ -335,7 +312,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
                        siginfo.si_signo = SIGFPE;
                        siginfo.si_errno = 0;
                        siginfo.si_code = __SI_FAULT;   /* default code */
-                       siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                       siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        if (isr & 0x11) {
                                siginfo.si_code = FPE_FLTINV;
                        } else if (isr & 0x22) {
@@ -359,7 +336,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
                        siginfo.si_signo = SIGFPE;
                        siginfo.si_errno = 0;
                        siginfo.si_code = __SI_FAULT;   /* default code */
-                       siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                       siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        if (isr & 0x880) {
                                siginfo.si_code = FPE_FLTOVF;
                        } else if (isr & 0x1100) {
@@ -406,7 +383,7 @@ ia64_illegal_op_fault (unsigned long ec, unsigned long arg1, unsigned long arg2,
        memset(&si, 0, sizeof(si));
        si.si_signo = SIGILL;
        si.si_code = ILL_ILLOPC;
-       si.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+       si.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
        force_sig_info(SIGILL, &si, current);
        rv.fkt = 0;
        return rv;
@@ -468,18 +445,18 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
 
              case 26: /* NaT Consumption */
                if (user_mode(regs)) {
-                       void *addr;
+                       void __user *addr;
 
                        if (((isr >> 4) & 0xf) == 2) {
                                /* NaT page consumption */
                                sig = SIGSEGV;
                                code = SEGV_ACCERR;
-                               addr = (void *) ifa;
+                               addr = (void __user *) ifa;
                        } else {
                                /* register NaT consumption */
                                sig = SIGILL;
                                code = ILL_ILLOPN;
-                               addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                               addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        }
                        siginfo.si_signo = sig;
                        siginfo.si_code = code;
@@ -500,7 +477,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
                        siginfo.si_signo = SIGILL;
                        siginfo.si_code = ILL_ILLOPN;
                        siginfo.si_errno = 0;
-                       siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                       siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        siginfo.si_imm = vector;
                        siginfo.si_flags = __ISR_VALID;
                        siginfo.si_isr = isr;
@@ -547,7 +524,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
                }
                siginfo.si_signo = SIGTRAP;
                siginfo.si_errno = 0;
-               siginfo.si_addr  = (void *) ifa;
+               siginfo.si_addr  = (void __user *) ifa;
                siginfo.si_imm   = 0;
                siginfo.si_flags = __ISR_VALID;
                siginfo.si_isr   = isr;
@@ -561,7 +538,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
                        siginfo.si_signo = SIGFPE;
                        siginfo.si_errno = 0;
                        siginfo.si_code = FPE_FLTINV;
-                       siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                       siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
                        siginfo.si_flags = __ISR_VALID;
                        siginfo.si_isr = isr;
                        siginfo.si_imm = 0;
@@ -588,7 +565,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
                                siginfo.si_flags = 0;
                                siginfo.si_isr = 0;
                                siginfo.si_imm = 0;
-                               siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+                               siginfo.si_addr = (void __user *)
+                                       (regs->cr_iip + ia64_psr(regs)->ri);
                                force_sig_info(SIGILL, &siginfo, current);
                                return;
                        }