|
@@ -114,6 +114,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
|
|
|
/* We always copy to/from vrsave, it's 0 if we don't have or don't
|
|
|
* use altivec.
|
|
|
*/
|
|
|
+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
|
|
+ current->thread.vrsave = mfspr(SPRN_VRSAVE);
|
|
|
err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
|
|
|
#else /* CONFIG_ALTIVEC */
|
|
|
err |= __put_user(0, &sc->v_regs);
|
|
@@ -217,6 +219,8 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc,
|
|
|
/* We always copy to/from vrsave, it's 0 if we don't have or don't
|
|
|
* use altivec.
|
|
|
*/
|
|
|
+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
|
|
+ current->thread.vrsave = mfspr(SPRN_VRSAVE);
|
|
|
err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
|
|
|
if (msr & MSR_VEC)
|
|
|
err |= __put_user(current->thread.transact_vrsave,
|
|
@@ -356,6 +360,8 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
|
|
|
err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
|
|
|
else
|
|
|
current->thread.vrsave = 0;
|
|
|
+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
|
|
+ mtspr(SPRN_VRSAVE, current->thread.vrsave);
|
|
|
#endif /* CONFIG_ALTIVEC */
|
|
|
/* restore floating point */
|
|
|
err |= copy_fpr_from_user(current, &sc->fp_regs);
|
|
@@ -484,6 +490,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
|
|
|
current->thread.vrsave = 0;
|
|
|
current->thread.transact_vrsave = 0;
|
|
|
}
|
|
|
+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
|
|
+ mtspr(SPRN_VRSAVE, current->thread.vrsave);
|
|
|
#endif /* CONFIG_ALTIVEC */
|
|
|
/* restore floating point */
|
|
|
err |= copy_fpr_from_user(current, &sc->fp_regs);
|