Lines Matching refs:tsk

85 static void check_if_tm_restore_required(struct task_struct *tsk)
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);
103 static inline void check_if_tm_restore_required(struct task_struct *tsk) { }
153 static void __giveup_fpu(struct task_struct *tsk)
157 save_fpu(tsk);
158 msr = tsk->thread.regs->msr;
162 regs_set_return_msr(tsk->thread.regs, msr);
165 void giveup_fpu(struct task_struct *tsk)
167 check_if_tm_restore_required(tsk);
170 __giveup_fpu(tsk);
177 * the thread_struct is up to date for task tsk.
179 void flush_fp_to_thread(struct task_struct *tsk)
181 if (tsk->thread.regs) {
191 if (tsk->thread.regs->msr & MSR_FP) {
199 BUG_ON(tsk != current);
200 giveup_fpu(tsk);
232 static inline void __giveup_fpu(struct task_struct *tsk) { }
236 static void __giveup_altivec(struct task_struct *tsk)
240 save_altivec(tsk);
241 msr = tsk->thread.regs->msr;
245 regs_set_return_msr(tsk->thread.regs, msr);
248 void giveup_altivec(struct task_struct *tsk)
250 check_if_tm_restore_required(tsk);
253 __giveup_altivec(tsk);
285 * the thread_struct is up to date for task tsk.
287 void flush_altivec_to_thread(struct task_struct *tsk)
289 if (tsk->thread.regs) {
291 if (tsk->thread.regs->msr & MSR_VEC) {
292 BUG_ON(tsk != current);
293 giveup_altivec(tsk);
302 static void __giveup_vsx(struct task_struct *tsk)
304 unsigned long msr = tsk->thread.regs->msr;
314 __giveup_fpu(tsk);
316 __giveup_altivec(tsk);
319 static void giveup_vsx(struct task_struct *tsk)
321 check_if_tm_restore_required(tsk);
324 __giveup_vsx(tsk);
354 void flush_vsx_to_thread(struct task_struct *tsk)
356 if (tsk->thread.regs) {
358 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) {
359 BUG_ON(tsk != current);
360 giveup_vsx(tsk);
369 void giveup_spe(struct task_struct *tsk)
371 check_if_tm_restore_required(tsk);
374 __giveup_spe(tsk);
392 void flush_spe_to_thread(struct task_struct *tsk)
394 if (tsk->thread.regs) {
396 if (tsk->thread.regs->msr & MSR_SPE) {
397 BUG_ON(tsk != current);
398 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
399 giveup_spe(tsk);
423 void giveup_all(struct task_struct *tsk)
427 if (!tsk->thread.regs)
430 check_if_tm_restore_required(tsk);
432 usermsr = tsk->thread.regs->msr;
442 __giveup_fpu(tsk);
444 __giveup_altivec(tsk);
446 __giveup_spe(tsk);
565 static void save_all(struct task_struct *tsk)
569 if (!tsk->thread.regs)
572 usermsr = tsk->thread.regs->msr;
582 save_fpu(tsk);
585 save_altivec(tsk);
588 __giveup_spe(tsk);
593 void flush_all_to_thread(struct task_struct *tsk)
595 if (tsk->thread.regs) {
597 BUG_ON(tsk != current);
599 if (tsk->thread.regs->msr & MSR_SPE)
600 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
602 save_all(tsk);
928 static inline bool tm_enabled(struct task_struct *tsk)
930 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM);
983 static inline void tm_reclaim_task(struct task_struct *tsk)
995 struct thread_struct *thr = &tsk->thread;
1007 tsk->pid, thr->regs->nip,
1014 tsk->pid);
2010 int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
2012 struct pt_regs *regs = tsk->thread.regs;
2033 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR);
2034 tsk->thread.fpexc_mode = val &
2050 tsk->thread.fpexc_mode = __pack_fe01(val);
2053 | tsk->thread.fpexc_mode);
2058 int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
2062 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) {
2077 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR);
2078 val = tsk->thread.fpexc_mode;
2083 val = __unpack_fe01(tsk->thread.fpexc_mode);
2088 int set_endian(struct task_struct *tsk, unsigned int val)
2090 struct pt_regs *regs = tsk->thread.regs;
2109 int get_endian(struct task_struct *tsk, unsigned long adr)
2111 struct pt_regs *regs = tsk->thread.regs;
2132 int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
2134 tsk->thread.align_ctl = val;
2138 int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
2140 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
2261 static bool empty_user_regs(struct pt_regs *regs, struct task_struct *tsk)
2270 stack_page = (unsigned long)task_stack_page(tsk);
2279 void __no_sanitize_address show_stack(struct task_struct *tsk,
2289 if (tsk == NULL)
2290 tsk = current;
2292 if (!try_get_task_stack(tsk))
2297 if (tsk == current)
2300 sp = tsk->thread.ksp;
2306 if (!validate_sp(sp, tsk))
2333 if (validate_sp_size(sp, tsk, STACK_SWITCH_FRAME_SIZE)
2344 if (!empty_user_regs(regs, tsk)) {
2355 put_task_stack(tsk);