Lines Matching full:thread
90 * If we are saving the current thread's registers, and the in check_if_tm_restore_required()
91 * thread is in a transactional state, set the TIF_RESTORE_TM in check_if_tm_restore_required()
95 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required()
96 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
98 tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr; in check_if_tm_restore_required()
159 msr = tsk->thread.regs->msr; in __giveup_fpu()
163 tsk->thread.regs->msr = msr; in __giveup_fpu()
182 if (tsk->thread.regs) { in flush_fp_to_thread()
192 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
216 if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) { in enable_kernel_fp()
219 * If a thread has already been reclaimed then the in enable_kernel_fp()
226 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_fp()
242 msr = tsk->thread.regs->msr; in __giveup_altivec()
246 tsk->thread.regs->msr = msr; in __giveup_altivec()
267 if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) { in enable_kernel_altivec()
270 * If a thread has already been reclaimed then the in enable_kernel_altivec()
277 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_altivec()
290 if (tsk->thread.regs) { in flush_altivec_to_thread()
292 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
305 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
337 if (current->thread.regs && in enable_kernel_vsx()
338 (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) { in enable_kernel_vsx()
341 * If a thread has already been reclaimed then the in enable_kernel_vsx()
348 MSR_TM_ACTIVE(current->thread.regs->msr)) in enable_kernel_vsx()
357 if (tsk->thread.regs) { in flush_vsx_to_thread()
359 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
386 if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) { in enable_kernel_spe()
395 if (tsk->thread.regs) { in flush_spe_to_thread()
397 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
399 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
428 if (!tsk->thread.regs) in giveup_all()
433 usermsr = tsk->thread.regs->msr; in giveup_all()
457 if (current->thread.load_fp) { in should_restore_fp()
458 current->thread.load_fp++; in should_restore_fp()
466 load_fp_state(¤t->thread.fp_state); in do_restore_fp()
476 if (cpu_has_feature(CPU_FTR_ALTIVEC) && (current->thread.load_vec)) { in should_restore_altivec()
477 current->thread.load_vec++; in should_restore_altivec()
485 load_vr_state(¤t->thread.vr_state); in do_restore_altivec()
486 current->thread.used_vr = 1; in do_restore_altivec()
502 current->thread.used_vsr = 1; in do_restore_vsx()
528 * are live for the user thread). in restore_math()
550 fpexc_mode = current->thread.fpexc_mode; in restore_math()
570 if (!tsk->thread.regs) in save_all()
573 usermsr = tsk->thread.regs->msr; in save_all()
592 thread_pkey_regs_save(&tsk->thread); in save_all()
597 if (tsk->thread.regs) { in flush_all_to_thread()
601 if (tsk->thread.regs->msr & MSR_SPE) in flush_all_to_thread()
602 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_all_to_thread()
615 current->thread.trap_nr = TRAP_HWBKPT; in do_send_trap()
642 current->thread.hw_brk[0] = null_brk; in do_break_handler()
643 current->thread.hw_brk[0].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
651 info = ¤t->thread.hw_brk[i]; in do_break_handler()
657 current->thread.hw_brk[i] = null_brk; in do_break_handler()
658 current->thread.hw_brk[i].flags |= HW_BRK_FLAG_DISABLED; in do_break_handler()
666 current->thread.trap_nr = TRAP_HWBKPT; in do_break()
695 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
697 thread->debug.iac1 = thread->debug.iac2 = 0; in set_debug_reg_defaults()
699 thread->debug.iac3 = thread->debug.iac4 = 0; in set_debug_reg_defaults()
701 thread->debug.dac1 = thread->debug.dac2 = 0; in set_debug_reg_defaults()
703 thread->debug.dvc1 = thread->debug.dvc2 = 0; in set_debug_reg_defaults()
705 thread->debug.dbcr0 = 0; in set_debug_reg_defaults()
710 thread->debug.dbcr1 = DBCR1_IAC1US | DBCR1_IAC2US | in set_debug_reg_defaults()
716 thread->debug.dbcr2 = DBCR2_DAC1US | DBCR2_DAC2US; in set_debug_reg_defaults()
718 thread->debug.dbcr1 = 0; in set_debug_reg_defaults()
750 * Unless neither the old or new thread are making use of the
752 * stored in the new thread.
756 if ((current->thread.debug.dbcr0 & DBCR0_IDM) in switch_booke_debug_regs()
770 static void set_debug_reg_defaults(struct thread_struct *thread) in set_debug_reg_defaults() argument
776 thread->hw_brk[i] = null_brk; in set_debug_reg_defaults()
778 set_breakpoint(i, &thread->hw_brk[i]); in set_debug_reg_defaults()
801 &new->thread.hw_brk[i]))) in switch_hw_breakpoint()
804 __set_breakpoint(i, &new->thread.hw_brk[i]); in switch_hw_breakpoint()
912 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
924 * we need to exit this thread which calls __switch_to() which in tm_reclaim_thread()
935 giveup_all(container_of(thr, struct task_struct, thread)); in tm_reclaim_thread()
962 tm_reclaim_thread(¤t->thread, cause); in tm_reclaim_current()
971 * oldtask->thread.ckpt_regs. We tm_reclaim(oldproc); this saves the in tm_reclaim_task()
977 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
1000 * This context-switches a thread's TM info SPRs. We do it here to in tm_reclaim_task()
1007 extern void __tm_recheckpoint(struct thread_struct *thread);
1009 void tm_recheckpoint(struct thread_struct *thread) in tm_recheckpoint() argument
1013 if (!(thread->regs->msr & MSR_TM)) in tm_recheckpoint()
1026 tm_restore_sprs(thread); in tm_recheckpoint()
1028 __tm_recheckpoint(thread); in tm_recheckpoint()
1038 /* Recheckpoint the registers of the thread we're about to switch to. in tm_recheckpoint_new_task()
1049 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ in tm_recheckpoint_new_task()
1050 tm_restore_sprs(&new->thread); in tm_recheckpoint_new_task()
1055 new->pid, new->thread.regs->msr); in tm_recheckpoint_new_task()
1057 tm_recheckpoint(&new->thread); in tm_recheckpoint_new_task()
1064 new->thread.regs->msr &= ~(MSR_FP | MSR_VEC | MSR_VSX); in tm_recheckpoint_new_task()
1079 prev->thread.load_tm++; in __switch_to_tm()
1081 if (!MSR_TM_ACTIVE(prev->thread.regs->msr) && prev->thread.load_tm == 0) in __switch_to_tm()
1082 prev->thread.regs->msr &= ~MSR_TM; in __switch_to_tm()
1117 msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; in restore_tm_state()
1122 current->thread.load_fp = 1; in restore_tm_state()
1125 current->thread.load_vec = 1; in restore_tm_state()
1217 new_thread = &new->thread; in __switch_to()
1218 old_thread = ¤t->thread; in __switch_to()
1233 switch_booke_debug_regs(&new->thread.debug); in __switch_to()
1248 save_sprs(&prev->thread); in __switch_to()
1282 if (current->thread.regs) { in __switch_to()
1283 restore_math(current->thread.regs); in __switch_to()
1526 set_debug_reg_defaults(¤t->thread); in flush_thread()
1541 * Assign a TIDR (thread ID) for task @t and set it in the thread
1549 * 1. The correct thread is running, the wrong thread is not
1550 * In this situation, the correct thread is woken and proceeds to pass it's
1554 * In this situation, neither thread will be woken. When scheduled, the waiting
1556 * by a condition check, which will pass for the correct thread and fail
1557 * for the wrong thread, or they will execute the condition check immediately.
1559 * 3. The wrong thread is running, the correct thread is not
1560 * The wrong thread will be woken, but will fail it's condition check and
1561 * re-execute wait. The correct thread, when scheduled, will execute either
1563 * when called the first time after the thread is scheduled, followed by it's
1567 * Both threads will be woken. The wrong thread will fail it's condition check
1568 * and execute another wait, while the correct thread will pass it's condition
1571 * @t: the task to set the thread ID for
1581 if (t->thread.tidr) in set_thread_tidr()
1584 t->thread.tidr = (u16)task_pid_nr(t); in set_thread_tidr()
1585 mtspr(SPRN_TIDR, t->thread.tidr); in set_thread_tidr()
1600 * copy the current task into the new thread.
1640 p->thread.ksp_vsid = sp_vsid; in setup_ksp_vsid()
1645 * Copy a thread..
1649 * Copy architecture-specific thread state
1672 /* kernel thread */ in copy_thread()
1683 p->thread.regs = NULL; /* no user register state */ in copy_thread()
1687 /* user thread */ in copy_thread()
1693 p->thread.regs = childregs; in copy_thread()
1724 p->thread.ksp = sp; in copy_thread()
1726 p->thread.ksp_limit = (unsigned long)end_of_stack(p); in copy_thread()
1730 p->thread.ptrace_bps[i] = NULL; in copy_thread()
1733 p->thread.fp_save_area = NULL; in copy_thread()
1735 p->thread.vr_save_area = NULL; in copy_thread()
1742 p->thread.dscr_inherit = current->thread.dscr_inherit; in copy_thread()
1743 p->thread.dscr = mfspr(SPRN_DSCR); in copy_thread()
1748 p->thread.tidr = 0; in copy_thread()
1757 * Set up a thread for executing a new program
1769 * If we exec out of a kernel thread then thread.regs will not be in start_thread()
1772 if (!current->thread.regs) { in start_thread()
1774 current->thread.regs = regs - 1; in start_thread()
1797 * ptrace to examine the thread immediately after exec. in start_thread()
1854 current->thread.used_vsr = 0; in start_thread()
1856 current->thread.load_slb = 0; in start_thread()
1857 current->thread.load_fp = 0; in start_thread()
1858 memset(¤t->thread.fp_state, 0, sizeof(current->thread.fp_state)); in start_thread()
1859 current->thread.fp_save_area = NULL; in start_thread()
1861 memset(¤t->thread.vr_state, 0, sizeof(current->thread.vr_state)); in start_thread()
1862 current->thread.vr_state.vscr.u[3] = 0x00010000; /* Java mode disabled */ in start_thread()
1863 current->thread.vr_save_area = NULL; in start_thread()
1864 current->thread.vrsave = 0; in start_thread()
1865 current->thread.used_vr = 0; in start_thread()
1866 current->thread.load_vec = 0; in start_thread()
1869 memset(current->thread.evr, 0, sizeof(current->thread.evr)); in start_thread()
1870 current->thread.acc = 0; in start_thread()
1871 current->thread.spefscr = 0; in start_thread()
1872 current->thread.used_spe = 0; in start_thread()
1875 current->thread.tm_tfhar = 0; in start_thread()
1876 current->thread.tm_texasr = 0; in start_thread()
1877 current->thread.tm_tfiar = 0; in start_thread()
1878 current->thread.load_tm = 0; in start_thread()
1881 thread_pkey_regs_init(¤t->thread); in start_thread()
1890 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
1911 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
1912 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
1928 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
1931 | tsk->thread.fpexc_mode; in set_fpexc_mode()
1939 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) { in get_fpexc_mode()
1954 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
1955 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
1960 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
1967 struct pt_regs *regs = tsk->thread.regs; in set_endian()
1988 struct pt_regs *regs = tsk->thread.regs; in get_endian()
2011 tsk->thread.align_ctl = val; in set_unalign_ctl()
2017 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
2090 sp = p->thread.ksp; in __get_wchan()
2144 sp = tsk->thread.ksp; in show_stack()