Lines Matching full:current

243  * Save the current user registers on the user stack.
250 flush_fp_to_thread(current); in prepare_save_user_regs()
252 if (current->thread.used_vr) in prepare_save_user_regs()
253 flush_altivec_to_thread(current); in prepare_save_user_regs()
255 current->thread.vrsave = mfspr(SPRN_VRSAVE); in prepare_save_user_regs()
258 if (current->thread.used_vsr && ctx_has_vsx_region) in prepare_save_user_regs()
259 flush_vsx_to_thread(current); in prepare_save_user_regs()
262 if (current->thread.used_spe) in prepare_save_user_regs()
263 flush_spe_to_thread(current); in prepare_save_user_regs()
277 if (current->thread.used_vr) { in __unsafe_save_user_regs()
278 unsafe_copy_to_user(&frame->mc_vregs, &current->thread.vr_state, in __unsafe_save_user_regs()
290 * Note that the current VRSAVE value is in the SPR at this point. in __unsafe_save_user_regs()
292 unsafe_put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32], in __unsafe_save_user_regs()
295 unsafe_copy_fpr_to_user(&frame->mc_fregs, current, failed); in __unsafe_save_user_regs()
309 if (current->thread.used_vsr && ctx_has_vsx_region) { in __unsafe_save_user_regs()
310 unsafe_copy_vsx_to_user(&frame->mc_vsregs, current, failed); in __unsafe_save_user_regs()
316 if (current->thread.used_spe) { in __unsafe_save_user_regs()
317 unsafe_copy_to_user(&frame->mc_vregs, current->thread.evr, in __unsafe_save_user_regs()
326 unsafe_put_user(current->thread.spefscr, in __unsafe_save_user_regs()
351 * Save the current user registers on the user stack.
364 current->thread.ckvrsave = mfspr(SPRN_VRSAVE); in prepare_save_tm_user_regs()
371 unsafe_save_general_regs(&current->thread.ckpt_regs, frame, failed); in save_tm_user_regs_unsafe()
383 if (current->thread.used_vr) { in save_tm_user_regs_unsafe()
384 unsafe_copy_to_user(&frame->mc_vregs, &current->thread.ckvr_state, in save_tm_user_regs_unsafe()
388 &current->thread.vr_state, in save_tm_user_regs_unsafe()
392 &current->thread.ckvr_state, in save_tm_user_regs_unsafe()
406 unsafe_put_user(current->thread.ckvrsave, in save_tm_user_regs_unsafe()
409 unsafe_put_user(current->thread.vrsave, in save_tm_user_regs_unsafe()
412 unsafe_put_user(current->thread.ckvrsave, in save_tm_user_regs_unsafe()
415 unsafe_copy_ckfpr_to_user(&frame->mc_fregs, current, failed); in save_tm_user_regs_unsafe()
417 unsafe_copy_fpr_to_user(&tm_frame->mc_fregs, current, failed); in save_tm_user_regs_unsafe()
419 unsafe_copy_ckfpr_to_user(&tm_frame->mc_fregs, current, failed); in save_tm_user_regs_unsafe()
427 if (current->thread.used_vsr) { in save_tm_user_regs_unsafe()
428 unsafe_copy_ckvsx_to_user(&frame->mc_vsregs, current, failed); in save_tm_user_regs_unsafe()
430 unsafe_copy_vsx_to_user(&tm_frame->mc_vsregs, current, failed); in save_tm_user_regs_unsafe()
432 unsafe_copy_ckvsx_to_user(&tm_frame->mc_vsregs, current, failed); in save_tm_user_regs_unsafe()
460 * Restore the current user register values from the user stack,
493 * current->thread when it next does altivec instructions in restore_user_regs()
498 unsafe_copy_from_user(&current->thread.vr_state, &sr->mc_vregs, in restore_user_regs()
500 current->thread.used_vr = true; in restore_user_regs()
501 } else if (current->thread.used_vr) in restore_user_regs()
502 memset(&current->thread.vr_state, 0, in restore_user_regs()
506 unsafe_get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32], failed); in restore_user_regs()
508 mtspr(SPRN_VRSAVE, current->thread.vrsave); in restore_user_regs()
510 unsafe_copy_fpr_from_user(current, &sr->mc_fregs, failed); in restore_user_regs()
515 * current->thread when it next does VSX instruction. in restore_user_regs()
523 unsafe_copy_vsx_from_user(current, &sr->mc_vsregs, failed); in restore_user_regs()
524 current->thread.used_vsr = true; in restore_user_regs()
525 } else if (current->thread.used_vsr) in restore_user_regs()
527 current->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_user_regs()
531 * current->thread when it next does FP instructions in restore_user_regs()
538 * current->thread when it next does spe instructions. in restore_user_regs()
541 BUILD_BUG_ON(sizeof(current->thread.spe) != ELF_NEVRREG * sizeof(u32)); in restore_user_regs()
545 unsafe_copy_from_user(&current->thread.spe, &sr->mc_vregs, in restore_user_regs()
546 sizeof(current->thread.spe), failed); in restore_user_regs()
547 current->thread.used_spe = true; in restore_user_regs()
548 } else if (current->thread.used_spe) in restore_user_regs()
549 memset(&current->thread.spe, 0, sizeof(current->thread.spe)); in restore_user_regs()
552 unsafe_get_user(current->thread.spefscr, (u32 __user *)&sr->mc_vregs + ELF_NEVRREG, failed); in restore_user_regs()
565 * Restore the current user register values from the user stack, except for
588 unsafe_restore_general_regs(&current->thread.ckpt_regs, sr, failed); in restore_tm_user_regs()
589 unsafe_get_user(current->thread.tm_tfhar, &sr->mc_gregs[PT_NIP], failed); in restore_tm_user_regs()
598 unsafe_copy_from_user(&current->thread.ckvr_state, &sr->mc_vregs, in restore_tm_user_regs()
600 current->thread.used_vr = true; in restore_tm_user_regs()
601 } else if (current->thread.used_vr) { in restore_tm_user_regs()
602 memset(&current->thread.vr_state, 0, in restore_tm_user_regs()
604 memset(&current->thread.ckvr_state, 0, in restore_tm_user_regs()
609 unsafe_get_user(current->thread.ckvrsave, in restore_tm_user_regs()
612 mtspr(SPRN_VRSAVE, current->thread.ckvrsave); in restore_tm_user_regs()
616 unsafe_copy_fpr_from_user(current, &sr->mc_fregs, failed); in restore_tm_user_regs()
624 unsafe_copy_ckvsx_from_user(current, &sr->mc_vsregs, failed); in restore_tm_user_regs()
625 current->thread.used_vsr = true; in restore_tm_user_regs()
626 } else if (current->thread.used_vsr) in restore_tm_user_regs()
628 current->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_tm_user_regs()
629 current->thread.ckfp_state.fpr[i][TS_VSRLOWOFFSET] = 0; in restore_tm_user_regs()
641 unsafe_copy_from_user(&current->thread.vr_state, &tm_sr->mc_vregs, in restore_tm_user_regs()
645 unsafe_get_user(current->thread.vrsave, in restore_tm_user_regs()
648 unsafe_copy_ckfpr_from_user(current, &tm_sr->mc_fregs, failed); in restore_tm_user_regs()
655 unsafe_copy_vsx_from_user(current, &tm_sr->mc_vsregs, failed); in restore_tm_user_regs()
656 current->thread.used_vsr = true; in restore_tm_user_regs()
692 current->thread.tm_texasr |= TEXASR_FS; in restore_tm_user_regs()
694 tm_recheckpoint(&current->thread); in restore_tm_user_regs()
699 load_fp_state(&current->thread.fp_state); in restore_tm_user_regs()
700 regs_set_return_msr(regs, regs->msr | (MSR_FP | current->thread.fpexc_mode)); in restore_tm_user_regs()
703 load_vr_state(&current->thread.vr_state); in restore_tm_user_regs()
1054 unsafe_put_sigset_t(&old_ctx->uc_sigmask, &current->blocked, failed); in COMPAT_SYSCALL_DEFINE3()
1103 current->restart_block.fn = do_no_restart_syscall; in COMPAT_SYSCALL_DEFINE0()
1183 signal_fault(current, regs, "sys_rt_sigreturn", rt_sf); in COMPAT_SYSCALL_DEFINE0()
1198 unsigned long new_dbcr0 = current->thread.debug.dbcr0; in SYSCALL_DEFINE3()
1213 current->thread.debug.dbcr1)) { in SYSCALL_DEFINE3()
1248 current->thread.debug.dbcr0 = new_dbcr0; in SYSCALL_DEFINE3()
1267 signal_fault(current, regs, "sys_debug_setcontext", ctx); in SYSCALL_DEFINE3()
1308 current->restart_block.fn = do_no_restart_syscall; in COMPAT_SYSCALL_DEFINE0()
1341 signal_fault(current, regs, "sys_sigreturn", sr); in COMPAT_SYSCALL_DEFINE0()
1352 signal_fault(current, regs, "sys_sigreturn", sc); in COMPAT_SYSCALL_DEFINE0()