diff options
| author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-05-21 21:39:42 +0200 | 
|---|---|---|
| committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-05-21 21:39:42 +0200 | 
| commit | 0ad8c6a22d03a1598f7cc6585c65354dadca62ad (patch) | |
| tree | 1507deef3d55d5f3c71b2f76924fe1f6c6211905 /arch/arm/kernel/signal.c | |
| parent | 8527f8e2934683e53405fbe876a4e6f4a0c46eb8 (diff) | |
| parent | 76e10d158efb6d4516018846f60c2ab5501900bc (diff) | |
Merge tag 'v3.4' with SCSI updates, needed for subsequent firewire-sbp2 changes
Linux 3.4
Diffstat (limited to 'arch/arm/kernel/signal.c')
| -rw-r--r-- | arch/arm/kernel/signal.c | 55 | 
1 files changed, 4 insertions, 51 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 7cb532fc8aa4..d68d1b694680 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -180,44 +180,23 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)  static int preserve_vfp_context(struct vfp_sigframe __user *frame)  { -	struct thread_info *thread = current_thread_info(); -	struct vfp_hard_struct *h = &thread->vfpstate.hard;  	const unsigned long magic = VFP_MAGIC;  	const unsigned long size = VFP_STORAGE_SIZE;  	int err = 0; -	vfp_sync_hwstate(thread);  	__put_user_error(magic, &frame->magic, err);  	__put_user_error(size, &frame->size, err); -	/* -	 * Copy the floating point registers. There can be unused -	 * registers see asm/hwcap.h for details. -	 */ -	err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs, -			      sizeof(h->fpregs)); -	/* -	 * Copy the status and control register. -	 */ -	__put_user_error(h->fpscr, &frame->ufp.fpscr, err); - -	/* -	 * Copy the exception registers. -	 */ -	__put_user_error(h->fpexc, &frame->ufp_exc.fpexc, err); -	__put_user_error(h->fpinst, &frame->ufp_exc.fpinst, err); -	__put_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err); +	if (err) +		return -EFAULT; -	return err ? -EFAULT : 0; +	return vfp_preserve_user_clear_hwstate(&frame->ufp, &frame->ufp_exc);  }  static int restore_vfp_context(struct vfp_sigframe __user *frame)  { -	struct thread_info *thread = current_thread_info(); -	struct vfp_hard_struct *h = &thread->vfpstate.hard;  	unsigned long magic;  	unsigned long size; -	unsigned long fpexc;  	int err = 0;  	__get_user_error(magic, &frame->magic, err); @@ -228,33 +207,7 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame)  	if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)  		return -EINVAL; -	vfp_flush_hwstate(thread); - -	/* -	 * Copy the floating point registers. There can be unused -	 * registers see asm/hwcap.h for details. -	 */ -	err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs, -				sizeof(h->fpregs)); -	/* -	 * Copy the status and control register. -	 */ -	__get_user_error(h->fpscr, &frame->ufp.fpscr, err); - -	/* -	 * Sanitise and restore the exception registers. -	 */ -	__get_user_error(fpexc, &frame->ufp_exc.fpexc, err); -	/* Ensure the VFP is enabled. */ -	fpexc |= FPEXC_EN; -	/* Ensure FPINST2 is invalid and the exception flag is cleared. */ -	fpexc &= ~(FPEXC_EX | FPEXC_FP2V); -	h->fpexc = fpexc; - -	__get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err); -	__get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err); - -	return err ? -EFAULT : 0; +	return vfp_restore_user_hwstate(&frame->ufp, &frame->ufp_exc);  }  #endif  | 
