Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[sfrench/cifs-2.6.git] / arch / arm / vfp / vfpmodule.c
index dc7e6b50ef674839a21480c69e12bec144d19194..aff6e6eadc700f08241668e66c1235ea825217ce 100644 (file)
@@ -216,13 +216,6 @@ static struct notifier_block vfp_notifier_block = {
  */
 static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
 {
-       siginfo_t info;
-
-       clear_siginfo(&info);
-       info.si_signo = SIGFPE;
-       info.si_code = sicode;
-       info.si_addr = (void __user *)(instruction_pointer(regs) - 4);
-
        /*
         * This is the same as NWFPE, because it's not clear what
         * this is used for
@@ -230,7 +223,9 @@ static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
        current->thread.error_code = 0;
        current->thread.trap_no = 6;
 
-       send_sig_info(SIGFPE, &info, current);
+       send_sig_fault(SIGFPE, sicode,
+                      (void __user *)(instruction_pointer(regs) - 4),
+                      current);
 }
 
 static void vfp_panic(char *reason, u32 inst)
@@ -553,12 +548,11 @@ void vfp_flush_hwstate(struct thread_info *thread)
  * Save the current VFP state into the provided structures and prepare
  * for entry into a new function (signal handler).
  */
-int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
-                                   struct user_vfp_exc __user *ufp_exc)
+int vfp_preserve_user_clear_hwstate(struct user_vfp *ufp,
+                                   struct user_vfp_exc *ufp_exc)
 {
        struct thread_info *thread = current_thread_info();
        struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
-       int err = 0;
 
        /* Ensure that the saved hwstate is up-to-date. */
        vfp_sync_hwstate(thread);
@@ -567,22 +561,19 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
         * Copy the floating point registers. There can be unused
         * registers see asm/hwcap.h for details.
         */
-       err |= __copy_to_user(&ufp->fpregs, &hwstate->fpregs,
-                             sizeof(hwstate->fpregs));
+       memcpy(&ufp->fpregs, &hwstate->fpregs, sizeof(hwstate->fpregs));
+
        /*
         * Copy the status and control register.
         */
-       __put_user_error(hwstate->fpscr, &ufp->fpscr, err);
+       ufp->fpscr = hwstate->fpscr;
 
        /*
         * Copy the exception registers.
         */
-       __put_user_error(hwstate->fpexc, &ufp_exc->fpexc, err);
-       __put_user_error(hwstate->fpinst, &ufp_exc->fpinst, err);
-       __put_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err);
-
-       if (err)
-               return -EFAULT;
+       ufp_exc->fpexc = hwstate->fpexc;
+       ufp_exc->fpinst = hwstate->fpinst;
+       ufp_exc->fpinst2 = ufp_exc->fpinst2;
 
        /* Ensure that VFP is disabled. */
        vfp_flush_hwstate(thread);