Lines Matching refs:thread

96 	if (tsk == current && tsk->thread.regs &&  in check_if_tm_restore_required()
97 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
99 tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr; in check_if_tm_restore_required()
164 msr = tsk->thread.regs->msr; in __giveup_fpu()
170 tsk->thread.regs->msr = msr; in __giveup_fpu()
189 if (tsk->thread.regs) { in flush_fp_to_thread()
199 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
223 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { in enable_kernel_fp()
233 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_fp()
242 if (tsk->thread.load_fp) { in restore_fp()
243 load_fp_state(&current->thread.fp_state); in restore_fp()
244 current->thread.load_fp++; in restore_fp()
261 msr = tsk->thread.regs->msr; in __giveup_altivec()
267 tsk->thread.regs->msr = msr; in __giveup_altivec()
288 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { in enable_kernel_altivec()
298 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_altivec()
311 if (tsk->thread.regs) { in flush_altivec_to_thread()
313 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
324 if (cpu_has_feature(CPU_FTR_ALTIVEC) && (tsk->thread.load_vec)) { in restore_altivec()
325 load_vr_state(&tsk->thread.vr_state); in restore_altivec()
326 tsk->thread.used_vr = 1; in restore_altivec()
327 tsk->thread.load_vec++; in restore_altivec()
341 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
373 if (current->thread.regs && in enable_kernel_vsx()
374 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) { in enable_kernel_vsx()
384 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_vsx()
393 if (tsk->thread.regs) { in flush_vsx_to_thread()
395 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
407 tsk->thread.used_vsr = 1; in restore_vsx()
434 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { in enable_kernel_spe()
443 if (tsk->thread.regs) { in flush_spe_to_thread()
445 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
447 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
483 if (!tsk->thread.regs) in giveup_all()
488 usermsr = tsk->thread.regs->msr; in giveup_all()
529 !current->thread.load_fp && !loadvec(current->thread)) in restore_math()
540 msr |= MSR_FP | current->thread.fpexc_mode; in restore_math()
559 if (!tsk->thread.regs) in save_all()
562 usermsr = tsk->thread.regs->msr; in save_all()
581 thread_pkey_regs_save(&tsk->thread); in save_all()
586 if (tsk->thread.regs) { in flush_all_to_thread()
590 if (tsk->thread.regs->msr & MSR_SPE) in flush_all_to_thread()
591 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_all_to_thread()
604 current->thread.trap_nr = TRAP_HWBKPT; in do_send_trap()
617 current->thread.trap_nr = TRAP_HWBKPT; in do_break()
639 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
641 thread->debug.iac1 = thread->debug.iac2 = 0; in set_debug_reg_defaults()
643 thread->debug.iac3 = thread->debug.iac4 = 0; in set_debug_reg_defaults()
645 thread->debug.dac1 = thread->debug.dac2 = 0; in set_debug_reg_defaults()
647 thread->debug.dvc1 = thread->debug.dvc2 = 0; in set_debug_reg_defaults()
649 thread->debug.dbcr0 = 0; in set_debug_reg_defaults()
654 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | in set_debug_reg_defaults()
660 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US; in set_debug_reg_defaults()
662 thread->debug.dbcr1 = 0; in set_debug_reg_defaults()
700 if ((current->thread.debug.dbcr0 & DBCR0_IDM) in switch_booke_debug_regs()
714 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
716 thread->hw_brk.address = 0; in set_debug_reg_defaults()
717 thread->hw_brk.type = 0; in set_debug_reg_defaults()
719 set_breakpoint(&thread->hw_brk); in set_debug_reg_defaults()
826 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
849 giveup_all(container_of(thr, struct task_struct, thread)); in tm_reclaim_thread()
876 tm_reclaim_thread(&current->thread, cause); in tm_reclaim_current()
891 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
921 extern void __tm_recheckpoint(struct thread_struct *thread);
923 void tm_recheckpoint(struct thread_struct *thread) in tm_recheckpoint() argument
927 if (!(thread->regs->msr & MSR_TM)) in tm_recheckpoint()
940 tm_restore_sprs(thread); in tm_recheckpoint()
942 __tm_recheckpoint(thread); in tm_recheckpoint()
963 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ in tm_recheckpoint_new_task()
964 tm_restore_sprs(&new->thread); in tm_recheckpoint_new_task()
969 new->pid, new->thread.regs->msr); in tm_recheckpoint_new_task()
971 tm_recheckpoint(&new->thread); in tm_recheckpoint_new_task()
978 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX); in tm_recheckpoint_new_task()
993 prev->thread.load_tm++; in __switch_to_tm()
995 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0) in __switch_to_tm()
996 prev->thread.regs->msr &= ~MSR_TM; in __switch_to_tm()
1031 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; in restore_tm_state()
1036 current->thread.load_fp = 1; in restore_tm_state()
1039 current->thread.load_vec = 1; in restore_tm_state()
1131 new_thread = &new->thread; in __switch_to()
1132 old_thread = &current->thread; in __switch_to()
1147 switch_booke_debug_regs(&new->thread.debug); in __switch_to()
1154 if (unlikely(!hw_brk_match(this_cpu_ptr(&current_brk), &new->thread.hw_brk))) in __switch_to()
1155 __set_breakpoint(&new->thread.hw_brk); in __switch_to()
1163 save_sprs(&prev->thread); in __switch_to()
1197 if (current->thread.regs) { in __switch_to()
1198 restore_math(current->thread.regs); in __switch_to()
1208 if (current->thread.used_vas) in __switch_to()
1444 set_debug_reg_defaults(&current->thread); in flush_thread()
1463 current->thread.used_vas = 1; in set_thread_uses_vas()
1520 if (t->thread.tidr) in set_thread_tidr()
1523 t->thread.tidr = (u16)task_pid_nr(t); in set_thread_tidr()
1524 mtspr(SPRN_TIDR, t->thread.tidr); in set_thread_tidr()
1579 p->thread.ksp_vsid = sp_vsid; in setup_ksp_vsid()
1618 p->thread.regs = NULL; /* no user register state */ in copy_thread_tls()
1628 p->thread.regs = childregs; in copy_thread_tls()
1656 p->thread.ksp = sp; in copy_thread_tls()
1658 p->thread.ksp_limit = (unsigned long)end_of_stack(p); in copy_thread_tls()
1661 p->thread.ptrace_bps[0] = NULL; in copy_thread_tls()
1664 p->thread.fp_save_area = NULL; in copy_thread_tls()
1666 p->thread.vr_save_area = NULL; in copy_thread_tls()
1673 p->thread.dscr_inherit = current->thread.dscr_inherit; in copy_thread_tls()
1674 p->thread.dscr = mfspr(SPRN_DSCR); in copy_thread_tls()
1679 p->thread.tidr = 0; in copy_thread_tls()
1705 if (!current->thread.regs) { in start_thread()
1707 current->thread.regs = regs - 1; in start_thread()
1787 current->thread.used_vsr = 0; in start_thread()
1789 current->thread.load_slb = 0; in start_thread()
1790 current->thread.load_fp = 0; in start_thread()
1791 memset(&current->thread.fp_state, 0, sizeof(current->thread.fp_state)); in start_thread()
1792 current->thread.fp_save_area = NULL; in start_thread()
1794 memset(&current->thread.vr_state, 0, sizeof(current->thread.vr_state)); in start_thread()
1795 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */ in start_thread()
1796 current->thread.vr_save_area = NULL; in start_thread()
1797 current->thread.vrsave = 0; in start_thread()
1798 current->thread.used_vr = 0; in start_thread()
1799 current->thread.load_vec = 0; in start_thread()
1802 memset(current->thread.evr, 0, sizeof(current->thread.evr)); in start_thread()
1803 current->thread.acc = 0; in start_thread()
1804 current->thread.spefscr = 0; in start_thread()
1805 current->thread.used_spe = 0; in start_thread()
1808 current->thread.tm_tfhar = 0; in start_thread()
1809 current->thread.tm_texasr = 0; in start_thread()
1810 current->thread.tm_tfiar = 0; in start_thread()
1811 current->thread.load_tm = 0; in start_thread()
1814 thread_pkey_regs_init(&current->thread); in start_thread()
1823 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
1844 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
1845 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
1863 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
1866 | tsk->thread.fpexc_mode; in set_fpexc_mode()
1874 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) in get_fpexc_mode()
1889 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
1890 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
1897 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
1903 struct pt_regs *regs = tsk->thread.regs; in set_endian()
1924 struct pt_regs *regs = tsk->thread.regs; in get_endian()
1947 tsk->thread.align_ctl = val; in set_unalign_ctl()
1953 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
1997 sp = p->thread.ksp; in __get_wchan()
2052 sp = tsk->thread.ksp; in show_stack()