Lines Matching refs:thread
91 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required()
92 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
94 regs_set_return_msr(&tsk->thread.ckpt_regs, in check_if_tm_restore_required()
95 tsk->thread.regs->msr); in check_if_tm_restore_required()
156 msr = tsk->thread.regs->msr; in __giveup_fpu()
160 regs_set_return_msr(tsk->thread.regs, msr); in __giveup_fpu()
179 if (tsk->thread.regs) { in flush_fp_to_thread()
189 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
213 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { in enable_kernel_fp()
223 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_fp()
239 msr = tsk->thread.regs->msr; in __giveup_altivec()
243 regs_set_return_msr(tsk->thread.regs, msr); in __giveup_altivec()
264 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { in enable_kernel_altivec()
274 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_altivec()
287 if (tsk->thread.regs) { in flush_altivec_to_thread()
289 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
302 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
334 if (current->thread.regs && in enable_kernel_vsx()
335 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) { in enable_kernel_vsx()
345 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_vsx()
354 if (tsk->thread.regs) { in flush_vsx_to_thread()
356 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
383 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { in enable_kernel_spe()
392 if (tsk->thread.regs) { in flush_spe_to_thread()
394 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
396 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
425 if (!tsk->thread.regs) in giveup_all()
430 usermsr = tsk->thread.regs->msr; in giveup_all()
454 if (current->thread.load_fp) { in should_restore_fp()
455 current->thread.load_fp++; in should_restore_fp()
463 load_fp_state(¤t->thread.fp_state); in do_restore_fp()
473 if (cpu_has_feature(CPU_FTR_ALTIVEC) && (current->thread.load_vec)) { in should_restore_altivec()
474 current->thread.load_vec++; in should_restore_altivec()
482 load_vr_state(¤t->thread.vr_state); in do_restore_altivec()
483 current->thread.used_vr = 1; in do_restore_altivec()
499 current->thread.used_vsr = 1; in do_restore_vsx()
547 fpexc_mode = current->thread.fpexc_mode; in restore_math()
567 if (!tsk->thread.regs) in save_all()
570 usermsr = tsk->thread.regs->msr; in save_all()
593 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()
611 current->thread.trap_nr = TRAP_HWBKPT; in do_send_trap()
638 current->thread.hw_brk[0] = null_brk; in do_break_handler()
639 current->thread.hw_brk[0].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
647 info = ¤t->thread.hw_brk[i]; in do_break_handler()
653 current->thread.hw_brk[i] = null_brk; in do_break_handler()
654 current->thread.hw_brk[i].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
661 current->thread.trap_nr = TRAP_HWBKPT; in DEFINE_INTERRUPT_HANDLER()
690 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
692 thread->debug.iac1 = thread->debug.iac2 = 0; in set_debug_reg_defaults()
694 thread->debug.iac3 = thread->debug.iac4 = 0; in set_debug_reg_defaults()
696 thread->debug.dac1 = thread->debug.dac2 = 0; in set_debug_reg_defaults()
698 thread->debug.dvc1 = thread->debug.dvc2 = 0; in set_debug_reg_defaults()
700 thread->debug.dbcr0 = 0; in set_debug_reg_defaults()
705 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | in set_debug_reg_defaults()
711 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US; in set_debug_reg_defaults()
713 thread->debug.dbcr1 = 0; in set_debug_reg_defaults()
751 if ((current->thread.debug.dbcr0 & DBCR0_IDM) in switch_booke_debug_regs()
765 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
771 thread->hw_brk[i] = null_brk; in set_debug_reg_defaults()
773 set_breakpoint(i, &thread->hw_brk[i]); in set_debug_reg_defaults()
796 &new->thread.hw_brk[i]))) in switch_hw_breakpoint()
799 __set_breakpoint(i, &new->thread.hw_brk[i]); in switch_hw_breakpoint()
928 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
951 giveup_all(container_of(thr, struct task_struct, thread)); in tm_reclaim_thread()
978 tm_reclaim_thread(¤t->thread, cause); in tm_reclaim_current()
993 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
1023 extern void __tm_recheckpoint(struct thread_struct *thread);
1025 void tm_recheckpoint(struct thread_struct *thread) in tm_recheckpoint() argument
1029 if (!(thread->regs->msr & MSR_TM)) in tm_recheckpoint()
1042 tm_restore_sprs(thread); in tm_recheckpoint()
1044 __tm_recheckpoint(thread); in tm_recheckpoint()
1065 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ in tm_recheckpoint_new_task()
1066 tm_restore_sprs(&new->thread); in tm_recheckpoint_new_task()
1071 new->pid, new->thread.regs->msr); in tm_recheckpoint_new_task()
1073 tm_recheckpoint(&new->thread); in tm_recheckpoint_new_task()
1080 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX); in tm_recheckpoint_new_task()
1095 prev->thread.load_tm++; in __switch_to_tm()
1097 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0) in __switch_to_tm()
1098 prev->thread.regs->msr &= ~MSR_TM; in __switch_to_tm()
1133 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; in restore_tm_state()
1138 current->thread.load_fp = 1; in restore_tm_state()
1141 current->thread.load_vec = 1; in restore_tm_state()
1197 if (!current->thread.regs) in kvmppc_save_user_regs()
1200 usermsr = current->thread.regs->msr; in kvmppc_save_user_regs()
1210 current->thread.tm_tfhar = mfspr(SPRN_TFHAR); in kvmppc_save_user_regs()
1211 current->thread.tm_tfiar = mfspr(SPRN_TFIAR); in kvmppc_save_user_regs()
1212 current->thread.tm_texasr = mfspr(SPRN_TEXASR); in kvmppc_save_user_regs()
1213 current->thread.regs->msr &= ~MSR_TM; in kvmppc_save_user_regs()
1221 save_sprs(¤t->thread); in kvmppc_save_current_sprs()
1288 new_thread = &new->thread; in __switch_to()
1289 old_thread = ¤t->thread; in __switch_to()
1317 switch_booke_debug_regs(&new->thread.debug); in __switch_to()
1332 save_sprs(&prev->thread); in __switch_to()
1391 if (current->thread.regs) in __switch_to()
1392 restore_math(current->thread.regs); in __switch_to()
1618 set_debug_reg_defaults(¤t->thread); in flush_thread()
1633 if (!current->thread.regs) { in arch_setup_new_exec()
1635 current->thread.regs = regs - 1; in arch_setup_new_exec()
1639 current->thread.regs->amr = default_amr; in arch_setup_new_exec()
1640 current->thread.regs->iamr = default_iamr; in arch_setup_new_exec()
1645 current->thread.dexcr = current->thread.dexcr_onexec; in arch_setup_new_exec()
1646 mtspr(SPRN_DEXCR, current->thread.dexcr); in arch_setup_new_exec()
1693 if (t->thread.tidr) in set_thread_tidr()
1696 t->thread.tidr = (u16)task_pid_nr(t); in set_thread_tidr()
1697 mtspr(SPRN_TIDR, t->thread.tidr); in set_thread_tidr()
1747 p->thread.ksp_vsid = sp_vsid; in setup_ksp_vsid()
1781 p->thread.regs = NULL; /* no user register state */ in copy_thread()
1835 p->thread.regs = childregs; in copy_thread()
1860 p->thread.ksp = sp; in copy_thread()
1864 p->thread.ptrace_bps[i] = NULL; in copy_thread()
1868 p->thread.fp_save_area = NULL; in copy_thread()
1871 p->thread.vr_save_area = NULL; in copy_thread()
1874 p->thread.kuap = KUAP_NONE; in copy_thread()
1877 p->thread.pid = MMU_NO_CONTEXT; in copy_thread()
1884 p->thread.dscr_inherit = current->thread.dscr_inherit; in copy_thread()
1885 p->thread.dscr = mfspr(SPRN_DSCR); in copy_thread()
1888 p->thread.tidr = 0; in copy_thread()
1892 p->thread.hashkeyr = current->thread.hashkeyr; in copy_thread()
1895 p->thread.dexcr = mfspr(SPRN_DEXCR); in copy_thread()
1985 current->thread.used_vsr = 0; in start_thread()
1987 current->thread.load_slb = 0; in start_thread()
1988 current->thread.load_fp = 0; in start_thread()
1990 memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); in start_thread()
1991 current->thread.fp_save_area = NULL; in start_thread()
1994 memset(¤t->thread.vr_state, 0, sizeof(current->thread.vr_state)); in start_thread()
1995 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */ in start_thread()
1996 current->thread.vr_save_area = NULL; in start_thread()
1997 current->thread.vrsave = 0; in start_thread()
1998 current->thread.used_vr = 0; in start_thread()
1999 current->thread.load_vec = 0; in start_thread()
2002 memset(current->thread.evr, 0, sizeof(current->thread.evr)); in start_thread()
2003 current->thread.acc = 0; in start_thread()
2004 current->thread.spefscr = 0; in start_thread()
2005 current->thread.used_spe = 0; in start_thread()
2008 current->thread.tm_tfhar = 0; in start_thread()
2009 current->thread.tm_texasr = 0; in start_thread()
2010 current->thread.tm_tfiar = 0; in start_thread()
2011 current->thread.load_tm = 0; in start_thread()
2015 current->thread.hashkeyr = get_random_long(); in start_thread()
2016 mtspr(SPRN_HASHKEYR, current->thread.hashkeyr); in start_thread()
2027 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
2048 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
2049 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
2065 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
2068 | tsk->thread.fpexc_mode); in set_fpexc_mode()
2077 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) { in get_fpexc_mode()
2092 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
2093 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
2098 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
2105 struct pt_regs *regs = tsk->thread.regs; in set_endian()
2126 struct pt_regs *regs = tsk->thread.regs; in get_endian()
2149 tsk->thread.align_ctl = val; in set_unalign_ctl()
2155 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
2261 sp = p->thread.ksp; in ___get_wchan()
2331 sp = tsk->thread.ksp; in show_stack()