Lines Matching defs:thread

88 	 * If we are saving the current thread's registers, and the
89 * thread is in a transactional state, set the TIF_RESTORE_TM
93 if (tsk == current && tsk->thread.regs &&
94 MSR_TM_ACTIVE(tsk->thread.regs->msr) &&
96 regs_set_return_msr(&tsk->thread.ckpt_regs,
97 tsk->thread.regs->msr);
158 msr = tsk->thread.regs->msr;
162 regs_set_return_msr(tsk->thread.regs, msr);
181 if (tsk->thread.regs) {
191 if (tsk->thread.regs->msr & MSR_FP) {
215 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) {
218 * If a thread has already been reclaimed then the
225 MSR_TM_ACTIVE(current->thread.regs->msr))
241 msr = tsk->thread.regs->msr;
245 regs_set_return_msr(tsk->thread.regs, msr);
266 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) {
269 * If a thread has already been reclaimed then the
276 MSR_TM_ACTIVE(current->thread.regs->msr))
289 if (tsk->thread.regs) {
291 if (tsk->thread.regs->msr & MSR_VEC) {
304 unsigned long msr = tsk->thread.regs->msr;
336 if (current->thread.regs &&
337 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) {
340 * If a thread has already been reclaimed then the
347 MSR_TM_ACTIVE(current->thread.regs->msr))
356 if (tsk->thread.regs) {
358 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) {
385 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) {
394 if (tsk->thread.regs) {
396 if (tsk->thread.regs->msr & MSR_SPE) {
398 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
427 if (!tsk->thread.regs)
432 usermsr = tsk->thread.regs->msr;
456 if (current->thread.load_fp) {
457 current->thread.load_fp++;
465 load_fp_state(&current->thread.fp_state);
475 if (cpu_has_feature(CPU_FTR_ALTIVEC) && (current->thread.load_vec)) {
476 current->thread.load_vec++;
484 load_vr_state(&current->thread.vr_state);
485 current->thread.used_vr = 1;
501 current->thread.used_vsr = 1;
527 * are live for the user thread).
549 fpexc_mode = current->thread.fpexc_mode;
569 if (!tsk->thread.regs)
572 usermsr = tsk->thread.regs->msr;
595 if (tsk->thread.regs) {
599 if (tsk->thread.regs->msr & MSR_SPE)
600 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
613 current->thread.trap_nr = TRAP_HWBKPT;
640 current->thread.hw_brk[0] = null_brk;
641 current->thread.hw_brk[0].flags |= HW_BRK_FLAG_DISABLED;
649 info = &current->thread.hw_brk[i];
655 current->thread.hw_brk[i] = null_brk;
656 current->thread.hw_brk[i].flags |= HW_BRK_FLAG_DISABLED;
663 current->thread.trap_nr = TRAP_HWBKPT;
692 static void set_debug_reg_defaults(struct thread_struct *thread)
694 thread->debug.iac1 = thread->debug.iac2 = 0;
696 thread->debug.iac3 = thread->debug.iac4 = 0;
698 thread->debug.dac1 = thread->debug.dac2 = 0;
700 thread->debug.dvc1 = thread->debug.dvc2 = 0;
702 thread->debug.dbcr0 = 0;
707 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US |
713 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US;
715 thread->debug.dbcr1 = 0;
747 * Unless neither the old or new thread are making use of the
749 * stored in the new thread.
753 if ((current->thread.debug.dbcr0 & DBCR0_IDM)
767 static void set_debug_reg_defaults(struct thread_struct *thread)
773 thread->hw_brk[i] = null_brk;
775 set_breakpoint(i, &thread->hw_brk[i]);
798 &new->thread.hw_brk[i])))
801 __set_breakpoint(i, &new->thread.hw_brk[i]);
930 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM);
942 * we need to exit this thread which calls __switch_to() which
953 giveup_all(container_of(thr, struct task_struct, thread));
980 tm_reclaim_thread(&current->thread, cause);
989 * oldtask->thread.ckpt_regs. We tm_reclaim(oldproc); this saves the
995 struct thread_struct *thr = &tsk->thread;
1018 * This context-switches a thread's TM info SPRs. We do it here to
1025 extern void __tm_recheckpoint(struct thread_struct *thread);
1027 void tm_recheckpoint(struct thread_struct *thread)
1031 if (!(thread->regs->msr & MSR_TM))
1044 tm_restore_sprs(thread);
1046 __tm_recheckpoint(thread);
1056 /* Recheckpoint the registers of the thread we're about to switch to.
1067 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){
1068 tm_restore_sprs(&new->thread);
1073 new->pid, new->thread.regs->msr);
1075 tm_recheckpoint(&new->thread);
1082 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX);
1097 prev->thread.load_tm++;
1099 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0)
1100 prev->thread.regs->msr &= ~MSR_TM;
1135 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr;
1140 current->thread.load_fp = 1;
1143 current->thread.load_vec = 1;
1199 if (!current->thread.regs)
1202 usermsr = current->thread.regs->msr;
1212 current->thread.tm_tfhar = mfspr(SPRN_TFHAR);
1213 current->thread.tm_tfiar = mfspr(SPRN_TFIAR);
1214 current->thread.tm_texasr = mfspr(SPRN_TEXASR);
1215 current->thread.regs->msr &= ~MSR_TM;
1223 save_sprs(&current->thread);
1290 new_thread = &new->thread;
1291 old_thread = &current->thread;
1319 switch_booke_debug_regs(&new->thread.debug);
1334 save_sprs(&prev->thread);
1393 if (current->thread.regs)
1394 restore_math(current->thread.regs);
1620 set_debug_reg_defaults(&current->thread);
1632 * If we exec out of a kernel thread then thread.regs will not be
1635 if (!current->thread.regs) {
1637 current->thread.regs = regs - 1;
1641 current->thread.regs->amr = default_amr;
1642 current->thread.regs->iamr = default_iamr;
1647 current->thread.dexcr = current->thread.dexcr_onexec;
1648 mtspr(SPRN_DEXCR, current->thread.dexcr);
1655 * Assign a TIDR (thread ID) for task @t and set it in the thread
1663 * 1. The correct thread is running, the wrong thread is not
1664 * In this situation, the correct thread is woken and proceeds to pass its
1668 * In this situation, neither thread will be woken. When scheduled, the waiting
1670 * by a condition check, which will pass for the correct thread and fail
1671 * for the wrong thread, or they will execute the condition check immediately.
1673 * 3. The wrong thread is running, the correct thread is not
1674 * The wrong thread will be woken, but will fail its condition check and
1675 * re-execute wait. The correct thread, when scheduled, will execute either
1677 * when called the first time after the thread is scheduled, followed by its
1681 * Both threads will be woken. The wrong thread will fail its condition check
1682 * and execute another wait, while the correct thread will pass its condition
1685 * @t: the task to set the thread ID for
1695 if (t->thread.tidr)
1698 t->thread.tidr = (u16)task_pid_nr(t);
1699 mtspr(SPRN_TIDR, t->thread.tidr);
1709 * copy the current task into the new thread.
1749 p->thread.ksp_vsid = sp_vsid;
1754 * Copy a thread..
1758 * Copy architecture-specific thread state
1776 /* kernel thread */
1783 p->thread.regs = NULL; /* no user register state */
1786 /* user thread */
1797 * A user space thread, but it first runs a kernel
1798 * thread, and then returns as though it had called
1837 p->thread.regs = childregs;
1862 p->thread.ksp = sp;
1866 p->thread.ptrace_bps[i] = NULL;
1870 p->thread.fp_save_area = NULL;
1873 p->thread.vr_save_area = NULL;
1876 p->thread.kuap = KUAP_NONE;
1879 p->thread.pid = MMU_NO_CONTEXT;
1886 p->thread.dscr_inherit = current->thread.dscr_inherit;
1887 p->thread.dscr = mfspr(SPRN_DSCR);
1890 p->thread.tidr = 0;
1894 p->thread.hashkeyr = current->thread.hashkeyr;
1897 p->thread.dexcr = mfspr(SPRN_DEXCR);
1905 * Set up a thread for executing a new program
1987 current->thread.used_vsr = 0;
1989 current->thread.load_slb = 0;
1990 current->thread.load_fp = 0;
1992 memset(&current->thread.fp_state, 0, sizeof(current->thread.fp_state));
1993 current->thread.fp_save_area = NULL;
1996 memset(&current->thread.vr_state, 0, sizeof(current->thread.vr_state));
1997 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */
1998 current->thread.vr_save_area = NULL;
1999 current->thread.vrsave = 0;
2000 current->thread.used_vr = 0;
2001 current->thread.load_vec = 0;
2004 memset(current->thread.evr, 0, sizeof(current->thread.evr));
2005 current->thread.acc = 0;
2006 current->thread.spefscr = 0;
2007 current->thread.used_spe = 0;
2010 current->thread.tm_tfhar = 0;
2011 current->thread.tm_texasr = 0;
2012 current->thread.tm_tfiar = 0;
2013 current->thread.load_tm = 0;
2017 current->thread.hashkeyr = get_random_long();
2018 mtspr(SPRN_HASHKEYR, current->thread.hashkeyr);
2029 struct pt_regs *regs = tsk->thread.regs;
2050 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR);
2051 tsk->thread.fpexc_mode = val &
2067 tsk->thread.fpexc_mode = __pack_fe01(val);
2070 | tsk->thread.fpexc_mode);
2079 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) {
2094 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR);
2095 val = tsk->thread.fpexc_mode;
2100 val = __unpack_fe01(tsk->thread.fpexc_mode);
2107 struct pt_regs *regs = tsk->thread.regs;
2128 struct pt_regs *regs = tsk->thread.regs;
2151 tsk->thread.align_ctl = val;
2157 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
2247 sp = p->thread.ksp;
2317 sp = tsk->thread.ksp;