Lines Matching refs:tsk
95 struct task_struct *tsk, int signr, sigset_t *set, in setup_sigcontext() argument
110 struct pt_regs *regs = tsk->thread.regs; in setup_sigcontext()
114 BUG_ON(tsk != current); in setup_sigcontext()
120 if (tsk->thread.used_vr) { in setup_sigcontext()
121 flush_altivec_to_thread(tsk); in setup_sigcontext()
123 err |= __copy_to_user(v_regs, &tsk->thread.vr_state, in setup_sigcontext()
136 tsk->thread.vrsave = vrsave; in setup_sigcontext()
143 flush_fp_to_thread(tsk); in setup_sigcontext()
145 err |= copy_fpr_to_user(&sc->fp_regs, tsk); in setup_sigcontext()
158 if (tsk->thread.used_vsr && ctx_has_vsx_region) { in setup_sigcontext()
159 flush_vsx_to_thread(tsk); in setup_sigcontext()
161 err |= copy_vsx_to_user(v_regs, tsk); in setup_sigcontext()
194 struct task_struct *tsk, in setup_tm_sigcontexts() argument
209 struct pt_regs *regs = tsk->thread.regs; in setup_tm_sigcontexts()
210 unsigned long msr = tsk->thread.ckpt_regs.msr; in setup_tm_sigcontexts()
213 BUG_ON(tsk != current); in setup_tm_sigcontexts()
229 if (tsk->thread.used_vr) { in setup_tm_sigcontexts()
231 err |= __copy_to_user(v_regs, &tsk->thread.ckvr_state, in setup_tm_sigcontexts()
238 &tsk->thread.vr_state, in setup_tm_sigcontexts()
242 &tsk->thread.ckvr_state, in setup_tm_sigcontexts()
254 tsk->thread.ckvrsave = mfspr(SPRN_VRSAVE); in setup_tm_sigcontexts()
255 err |= __put_user(tsk->thread.ckvrsave, (u32 __user *)&v_regs[33]); in setup_tm_sigcontexts()
257 err |= __put_user(tsk->thread.vrsave, in setup_tm_sigcontexts()
260 err |= __put_user(tsk->thread.ckvrsave, in setup_tm_sigcontexts()
269 err |= copy_ckfpr_to_user(&sc->fp_regs, tsk); in setup_tm_sigcontexts()
271 err |= copy_fpr_to_user(&tm_sc->fp_regs, tsk); in setup_tm_sigcontexts()
273 err |= copy_ckfpr_to_user(&tm_sc->fp_regs, tsk); in setup_tm_sigcontexts()
281 if (tsk->thread.used_vsr) { in setup_tm_sigcontexts()
285 err |= copy_ckvsx_to_user(v_regs, tsk); in setup_tm_sigcontexts()
288 err |= copy_vsx_to_user(tm_v_regs, tsk); in setup_tm_sigcontexts()
290 err |= copy_ckvsx_to_user(tm_v_regs, tsk); in setup_tm_sigcontexts()
304 &tsk->thread.ckpt_regs, GP_REGS_SIZE); in setup_tm_sigcontexts()
320 static long restore_sigcontext(struct task_struct *tsk, sigset_t *set, int sig, in restore_sigcontext() argument
329 struct pt_regs *regs = tsk->thread.regs; in restore_sigcontext()
334 BUG_ON(tsk != current); in restore_sigcontext()
378 err |= __copy_from_user(&tsk->thread.vr_state, v_regs, in restore_sigcontext()
380 tsk->thread.used_vr = true; in restore_sigcontext()
381 } else if (tsk->thread.used_vr) { in restore_sigcontext()
382 memset(&tsk->thread.vr_state, 0, 33 * sizeof(vector128)); in restore_sigcontext()
386 err |= __get_user(tsk->thread.vrsave, (u32 __user *)&v_regs[33]); in restore_sigcontext()
388 tsk->thread.vrsave = 0; in restore_sigcontext()
390 mtspr(SPRN_VRSAVE, tsk->thread.vrsave); in restore_sigcontext()
393 err |= copy_fpr_from_user(tsk, &sc->fp_regs); in restore_sigcontext()
402 err |= copy_vsx_from_user(tsk, v_regs); in restore_sigcontext()
403 tsk->thread.used_vsr = true; in restore_sigcontext()
406 tsk->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_sigcontext()
417 static long restore_tm_sigcontexts(struct task_struct *tsk, in restore_tm_sigcontexts() argument
426 struct pt_regs *regs = tsk->thread.regs; in restore_tm_sigcontexts()
431 BUG_ON(tsk != current); in restore_tm_sigcontexts()
435 err |= __copy_from_user(&tsk->thread.ckpt_regs, sc->gp_regs, in restore_tm_sigcontexts()
447 err |= __get_user(tsk->thread.tm_tfhar, &sc->gp_regs[PT_NIP]); in restore_tm_sigcontexts()
463 err |= __get_user(tsk->thread.ckpt_regs.ctr, in restore_tm_sigcontexts()
465 err |= __get_user(tsk->thread.ckpt_regs.link, in restore_tm_sigcontexts()
467 err |= __get_user(tsk->thread.ckpt_regs.xer, in restore_tm_sigcontexts()
469 err |= __get_user(tsk->thread.ckpt_regs.ccr, in restore_tm_sigcontexts()
497 err |= __copy_from_user(&tsk->thread.ckvr_state, v_regs, in restore_tm_sigcontexts()
499 err |= __copy_from_user(&tsk->thread.vr_state, tm_v_regs, in restore_tm_sigcontexts()
503 else if (tsk->thread.used_vr) { in restore_tm_sigcontexts()
504 memset(&tsk->thread.vr_state, 0, 33 * sizeof(vector128)); in restore_tm_sigcontexts()
505 memset(&tsk->thread.ckvr_state, 0, 33 * sizeof(vector128)); in restore_tm_sigcontexts()
509 err |= __get_user(tsk->thread.ckvrsave, in restore_tm_sigcontexts()
511 err |= __get_user(tsk->thread.vrsave, in restore_tm_sigcontexts()
515 tsk->thread.vrsave = 0; in restore_tm_sigcontexts()
516 tsk->thread.ckvrsave = 0; in restore_tm_sigcontexts()
519 mtspr(SPRN_VRSAVE, tsk->thread.vrsave); in restore_tm_sigcontexts()
522 err |= copy_fpr_from_user(tsk, &tm_sc->fp_regs); in restore_tm_sigcontexts()
523 err |= copy_ckfpr_from_user(tsk, &sc->fp_regs); in restore_tm_sigcontexts()
533 err |= copy_vsx_from_user(tsk, tm_v_regs); in restore_tm_sigcontexts()
534 err |= copy_ckvsx_from_user(tsk, v_regs); in restore_tm_sigcontexts()
535 tsk->thread.used_vsr = true; in restore_tm_sigcontexts()
538 tsk->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_tm_sigcontexts()
539 tsk->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_tm_sigcontexts()
545 tsk->thread.tm_texasr |= TEXASR_FS; in restore_tm_sigcontexts()
575 tm_recheckpoint(&tsk->thread, msr); in restore_tm_sigcontexts()
579 load_fp_state(&tsk->thread.fp_state); in restore_tm_sigcontexts()
580 regs->msr |= (MSR_FP | tsk->thread.fpexc_mode); in restore_tm_sigcontexts()
583 load_vr_state(&tsk->thread.vr_state); in restore_tm_sigcontexts()
791 struct task_struct *tsk) in handle_rt_signal64() argument
796 struct pt_regs *regs = tsk->thread.regs; in handle_rt_signal64()
798 BUG_ON(tsk != current); in handle_rt_signal64()
800 frame = get_sigframe(ksig, get_tm_stackpointer(tsk), sizeof(*frame), 0); in handle_rt_signal64()
821 tsk, ksig->sig, NULL, in handle_rt_signal64()
827 err |= setup_sigcontext(&frame->uc.uc_mcontext, tsk, ksig->sig, in handle_rt_signal64()
836 tsk->thread.fp_state.fpscr = 0; in handle_rt_signal64()
839 if (vdso64_rt_sigtramp && tsk->mm->context.vdso_base) { in handle_rt_signal64()
840 regs->link = tsk->mm->context.vdso_base + vdso64_rt_sigtramp; in handle_rt_signal64()
890 tsk->comm, tsk->pid, "setup_rt_frame", in handle_rt_signal64()