Lines Matching refs:thread
97 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required()
98 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
100 tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr; in check_if_tm_restore_required()
112 return msr_tm_active(tsk->thread.regs->msr) && in tm_active_with_fp()
113 (tsk->thread.ckpt_regs.msr & MSR_FP); in tm_active_with_fp()
118 return msr_tm_active(tsk->thread.regs->msr) && in tm_active_with_altivec()
119 (tsk->thread.ckpt_regs.msr & MSR_VEC); in tm_active_with_altivec()
182 msr = tsk->thread.regs->msr; in __giveup_fpu()
188 tsk->thread.regs->msr = msr; in __giveup_fpu()
207 if (tsk->thread.regs) { in flush_fp_to_thread()
217 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
241 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { in enable_kernel_fp()
250 if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) in enable_kernel_fp()
259 if (tsk->thread.load_fp || tm_active_with_fp(tsk)) { in restore_fp()
260 load_fp_state(¤t->thread.fp_state); in restore_fp()
261 current->thread.load_fp++; in restore_fp()
278 msr = tsk->thread.regs->msr; in __giveup_altivec()
284 tsk->thread.regs->msr = msr; in __giveup_altivec()
305 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { in enable_kernel_altivec()
314 if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) in enable_kernel_altivec()
327 if (tsk->thread.regs) { in flush_altivec_to_thread()
329 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
341 (tsk->thread.load_vec || tm_active_with_altivec(tsk))) { in restore_altivec()
342 load_vr_state(&tsk->thread.vr_state); in restore_altivec()
343 tsk->thread.used_vr = 1; in restore_altivec()
344 tsk->thread.load_vec++; in restore_altivec()
358 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
390 if (current->thread.regs && in enable_kernel_vsx()
391 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) { in enable_kernel_vsx()
400 if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) in enable_kernel_vsx()
409 if (tsk->thread.regs) { in flush_vsx_to_thread()
411 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
423 tsk->thread.used_vsr = 1; in restore_vsx()
450 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { in enable_kernel_spe()
459 if (tsk->thread.regs) { in flush_spe_to_thread()
461 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
463 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
499 if (!tsk->thread.regs) in giveup_all()
502 usermsr = tsk->thread.regs->msr; in giveup_all()
534 !current->thread.load_fp && !loadvec(current->thread)) in restore_math()
545 msr |= MSR_FP | current->thread.fpexc_mode; in restore_math()
564 if (!tsk->thread.regs) in save_all()
567 usermsr = tsk->thread.regs->msr; in save_all()
586 thread_pkey_regs_save(&tsk->thread); in save_all()
591 if (tsk->thread.regs) { in flush_all_to_thread()
597 if (tsk->thread.regs->msr & MSR_SPE) in flush_all_to_thread()
598 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_all_to_thread()
610 current->thread.trap_nr = TRAP_HWBKPT; in do_send_trap()
625 current->thread.trap_nr = TRAP_HWBKPT; in do_break()
652 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
654 thread->debug.iac1 = thread->debug.iac2 = 0; in set_debug_reg_defaults()
656 thread->debug.iac3 = thread->debug.iac4 = 0; in set_debug_reg_defaults()
658 thread->debug.dac1 = thread->debug.dac2 = 0; in set_debug_reg_defaults()
660 thread->debug.dvc1 = thread->debug.dvc2 = 0; in set_debug_reg_defaults()
662 thread->debug.dbcr0 = 0; in set_debug_reg_defaults()
667 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | in set_debug_reg_defaults()
673 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US; in set_debug_reg_defaults()
675 thread->debug.dbcr1 = 0; in set_debug_reg_defaults()
713 if ((current->thread.debug.dbcr0 & DBCR0_IDM) in switch_booke_debug_regs()
727 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
729 thread->hw_brk.address = 0; in set_debug_reg_defaults()
730 thread->hw_brk.type = 0; in set_debug_reg_defaults()
732 set_breakpoint(&thread->hw_brk); in set_debug_reg_defaults()
867 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
890 giveup_all(container_of(thr, struct task_struct, thread)); in tm_reclaim_thread()
917 tm_reclaim_thread(¤t->thread, cause); in tm_reclaim_current()
932 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
962 extern void __tm_recheckpoint(struct thread_struct *thread);
964 void tm_recheckpoint(struct thread_struct *thread) in tm_recheckpoint() argument
968 if (!(thread->regs->msr & MSR_TM)) in tm_recheckpoint()
981 tm_restore_sprs(thread); in tm_recheckpoint()
983 __tm_recheckpoint(thread); in tm_recheckpoint()
1004 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ in tm_recheckpoint_new_task()
1005 tm_restore_sprs(&new->thread); in tm_recheckpoint_new_task()
1010 new->pid, new->thread.regs->msr); in tm_recheckpoint_new_task()
1012 tm_recheckpoint(&new->thread); in tm_recheckpoint_new_task()
1019 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX); in tm_recheckpoint_new_task()
1034 prev->thread.load_tm++; in __switch_to_tm()
1036 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0) in __switch_to_tm()
1037 prev->thread.regs->msr &= ~MSR_TM; in __switch_to_tm()
1072 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; in restore_tm_state()
1077 current->thread.load_fp = 1; in restore_tm_state()
1080 current->thread.load_vec = 1; in restore_tm_state()
1177 new_thread = &new->thread; in __switch_to()
1178 old_thread = ¤t->thread; in __switch_to()
1193 switch_booke_debug_regs(&new->thread.debug); in __switch_to()
1200 if (unlikely(!hw_brk_match(this_cpu_ptr(¤t_brk), &new->thread.hw_brk))) in __switch_to()
1201 __set_breakpoint(&new->thread.hw_brk); in __switch_to()
1209 save_sprs(&prev->thread); in __switch_to()
1243 if (current_thread_info()->task->thread.regs) { in __switch_to()
1244 restore_math(current_thread_info()->task->thread.regs); in __switch_to()
1254 if (current_thread_info()->task->thread.used_vas) in __switch_to()
1491 set_debug_reg_defaults(¤t->thread); in flush_thread()
1501 current->thread.used_vas = 1; in set_thread_uses_vas()
1558 if (t->thread.tidr) in set_thread_tidr()
1561 t->thread.tidr = (u16)task_pid_nr(t); in set_thread_tidr()
1562 mtspr(SPRN_TIDR, t->thread.tidr); in set_thread_tidr()
1617 p->thread.ksp_vsid = sp_vsid; in setup_ksp_vsid()
1655 p->thread.regs = NULL; /* no user register state */ in copy_thread()
1665 p->thread.regs = childregs; in copy_thread()
1693 p->thread.ksp = sp; in copy_thread()
1695 p->thread.ksp_limit = (unsigned long)task_stack_page(p) + in copy_thread()
1699 p->thread.ptrace_bps[0] = NULL; in copy_thread()
1702 p->thread.fp_save_area = NULL; in copy_thread()
1704 p->thread.vr_save_area = NULL; in copy_thread()
1711 p->thread.dscr_inherit = current->thread.dscr_inherit; in copy_thread()
1712 p->thread.dscr = mfspr(SPRN_DSCR); in copy_thread()
1715 p->thread.ppr = INIT_PPR; in copy_thread()
1717 p->thread.tidr = 0; in copy_thread()
1736 if (!current->thread.regs) { in start_thread()
1738 current->thread.regs = regs - 1; in start_thread()
1818 current->thread.used_vsr = 0; in start_thread()
1820 current->thread.load_fp = 0; in start_thread()
1821 memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); in start_thread()
1822 current->thread.fp_save_area = NULL; in start_thread()
1824 memset(¤t->thread.vr_state, 0, sizeof(current->thread.vr_state)); in start_thread()
1825 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */ in start_thread()
1826 current->thread.vr_save_area = NULL; in start_thread()
1827 current->thread.vrsave = 0; in start_thread()
1828 current->thread.used_vr = 0; in start_thread()
1829 current->thread.load_vec = 0; in start_thread()
1832 memset(current->thread.evr, 0, sizeof(current->thread.evr)); in start_thread()
1833 current->thread.acc = 0; in start_thread()
1834 current->thread.spefscr = 0; in start_thread()
1835 current->thread.used_spe = 0; in start_thread()
1838 current->thread.tm_tfhar = 0; in start_thread()
1839 current->thread.tm_texasr = 0; in start_thread()
1840 current->thread.tm_tfiar = 0; in start_thread()
1841 current->thread.load_tm = 0; in start_thread()
1844 thread_pkey_regs_init(¤t->thread); in start_thread()
1853 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
1874 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
1875 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
1893 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
1896 | tsk->thread.fpexc_mode; in set_fpexc_mode()
1904 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) in get_fpexc_mode()
1919 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
1920 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
1927 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
1933 struct pt_regs *regs = tsk->thread.regs; in set_endian()
1954 struct pt_regs *regs = tsk->thread.regs; in get_endian()
1977 tsk->thread.align_ctl = val; in set_unalign_ctl()
1983 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
2032 sp = p->thread.ksp; in get_wchan()
2070 sp = tsk->thread.ksp; in show_stack()