• Home
  • Raw
  • Download

Lines Matching refs:tsk

80 static void check_if_tm_restore_required(struct task_struct *tsk)  in check_if_tm_restore_required()  argument
88 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required()
89 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required()
91 tsk->thread.ckpt_regs.msr = tsk->thread.regs->msr; in check_if_tm_restore_required()
102 static inline void check_if_tm_restore_required(struct task_struct *tsk) { } in check_if_tm_restore_required() argument
153 void __giveup_fpu(struct task_struct *tsk) in __giveup_fpu() argument
157 save_fpu(tsk); in __giveup_fpu()
158 msr = tsk->thread.regs->msr; in __giveup_fpu()
164 tsk->thread.regs->msr = msr; in __giveup_fpu()
167 void giveup_fpu(struct task_struct *tsk) in giveup_fpu() argument
169 check_if_tm_restore_required(tsk); in giveup_fpu()
172 __giveup_fpu(tsk); in giveup_fpu()
181 void flush_fp_to_thread(struct task_struct *tsk) in flush_fp_to_thread() argument
183 if (tsk->thread.regs) { in flush_fp_to_thread()
193 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread()
201 BUG_ON(tsk != current); in flush_fp_to_thread()
202 giveup_fpu(tsk); in flush_fp_to_thread()
233 static int restore_fp(struct task_struct *tsk) in restore_fp() argument
235 if (tsk->thread.load_fp || msr_tm_active(tsk->thread.regs->msr)) { in restore_fp()
243 static int restore_fp(struct task_struct *tsk) { return 0; } in restore_fp() argument
249 static void __giveup_altivec(struct task_struct *tsk) in __giveup_altivec() argument
253 save_altivec(tsk); in __giveup_altivec()
254 msr = tsk->thread.regs->msr; in __giveup_altivec()
260 tsk->thread.regs->msr = msr; in __giveup_altivec()
263 void giveup_altivec(struct task_struct *tsk) in giveup_altivec() argument
265 check_if_tm_restore_required(tsk); in giveup_altivec()
268 __giveup_altivec(tsk); in giveup_altivec()
301 void flush_altivec_to_thread(struct task_struct *tsk) in flush_altivec_to_thread() argument
303 if (tsk->thread.regs) { in flush_altivec_to_thread()
305 if (tsk->thread.regs->msr & MSR_VEC) { in flush_altivec_to_thread()
306 BUG_ON(tsk != current); in flush_altivec_to_thread()
307 giveup_altivec(tsk); in flush_altivec_to_thread()
314 static int restore_altivec(struct task_struct *tsk) in restore_altivec() argument
317 (tsk->thread.load_vec || msr_tm_active(tsk->thread.regs->msr))) { in restore_altivec()
318 load_vr_state(&tsk->thread.vr_state); in restore_altivec()
319 tsk->thread.used_vr = 1; in restore_altivec()
320 tsk->thread.load_vec++; in restore_altivec()
328 static inline int restore_altivec(struct task_struct *tsk) { return 0; } in restore_altivec() argument
332 static void __giveup_vsx(struct task_struct *tsk) in __giveup_vsx() argument
334 unsigned long msr = tsk->thread.regs->msr; in __giveup_vsx()
344 __giveup_fpu(tsk); in __giveup_vsx()
346 __giveup_altivec(tsk); in __giveup_vsx()
349 static void giveup_vsx(struct task_struct *tsk) in giveup_vsx() argument
351 check_if_tm_restore_required(tsk); in giveup_vsx()
354 __giveup_vsx(tsk); in giveup_vsx()
383 void flush_vsx_to_thread(struct task_struct *tsk) in flush_vsx_to_thread() argument
385 if (tsk->thread.regs) { in flush_vsx_to_thread()
387 if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { in flush_vsx_to_thread()
388 BUG_ON(tsk != current); in flush_vsx_to_thread()
389 giveup_vsx(tsk); in flush_vsx_to_thread()
396 static int restore_vsx(struct task_struct *tsk) in restore_vsx() argument
399 tsk->thread.used_vsr = 1; in restore_vsx()
406 static inline int restore_vsx(struct task_struct *tsk) { return 0; } in restore_vsx() argument
410 void giveup_spe(struct task_struct *tsk) in giveup_spe() argument
412 check_if_tm_restore_required(tsk); in giveup_spe()
415 __giveup_spe(tsk); in giveup_spe()
433 void flush_spe_to_thread(struct task_struct *tsk) in flush_spe_to_thread() argument
435 if (tsk->thread.regs) { in flush_spe_to_thread()
437 if (tsk->thread.regs->msr & MSR_SPE) { in flush_spe_to_thread()
438 BUG_ON(tsk != current); in flush_spe_to_thread()
439 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_spe_to_thread()
440 giveup_spe(tsk); in flush_spe_to_thread()
471 void giveup_all(struct task_struct *tsk) in giveup_all() argument
475 if (!tsk->thread.regs) in giveup_all()
478 check_if_tm_restore_required(tsk); in giveup_all()
480 usermsr = tsk->thread.regs->msr; in giveup_all()
491 __giveup_fpu(tsk); in giveup_all()
495 __giveup_altivec(tsk); in giveup_all()
499 __giveup_spe(tsk); in giveup_all()
537 void save_all(struct task_struct *tsk) in save_all() argument
541 if (!tsk->thread.regs) in save_all()
544 usermsr = tsk->thread.regs->msr; in save_all()
554 save_fpu(tsk); in save_all()
557 save_altivec(tsk); in save_all()
560 __giveup_spe(tsk); in save_all()
565 void flush_all_to_thread(struct task_struct *tsk) in flush_all_to_thread() argument
567 if (tsk->thread.regs) { in flush_all_to_thread()
569 BUG_ON(tsk != current); in flush_all_to_thread()
571 if (tsk->thread.regs->msr & MSR_SPE) in flush_all_to_thread()
572 tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); in flush_all_to_thread()
574 save_all(tsk); in flush_all_to_thread()
830 static inline bool tm_enabled(struct task_struct *tsk) in tm_enabled() argument
832 return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM); in tm_enabled()
886 static inline void tm_reclaim_task(struct task_struct *tsk) in tm_reclaim_task() argument
898 struct thread_struct *thr = &tsk->thread; in tm_reclaim_task()
908 tsk->pid, thr->regs->nip, in tm_reclaim_task()
912 tm_reclaim_thread(thr, task_thread_info(tsk), TM_CAUSE_RESCHED); in tm_reclaim_task()
915 tsk->pid); in tm_reclaim_task()
1714 int set_fpexc_mode(struct task_struct *tsk, unsigned int val) in set_fpexc_mode() argument
1716 struct pt_regs *regs = tsk->thread.regs; in set_fpexc_mode()
1737 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in set_fpexc_mode()
1738 tsk->thread.fpexc_mode = val & in set_fpexc_mode()
1756 tsk->thread.fpexc_mode = __pack_fe01(val); in set_fpexc_mode()
1759 | tsk->thread.fpexc_mode; in set_fpexc_mode()
1763 int get_fpexc_mode(struct task_struct *tsk, unsigned long adr) in get_fpexc_mode() argument
1767 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) in get_fpexc_mode()
1782 tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); in get_fpexc_mode()
1783 val = tsk->thread.fpexc_mode; in get_fpexc_mode()
1790 val = __unpack_fe01(tsk->thread.fpexc_mode); in get_fpexc_mode()
1794 int set_endian(struct task_struct *tsk, unsigned int val) in set_endian() argument
1796 struct pt_regs *regs = tsk->thread.regs; in set_endian()
1815 int get_endian(struct task_struct *tsk, unsigned long adr) in get_endian() argument
1817 struct pt_regs *regs = tsk->thread.regs; in get_endian()
1838 int set_unalign_ctl(struct task_struct *tsk, unsigned int val) in set_unalign_ctl() argument
1840 tsk->thread.align_ctl = val; in set_unalign_ctl()
1844 int get_unalign_ctl(struct task_struct *tsk, unsigned long adr) in get_unalign_ctl() argument
1846 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr); in get_unalign_ctl()
1914 void show_stack(struct task_struct *tsk, unsigned long *stack) in show_stack() argument
1926 if (tsk == NULL) in show_stack()
1927 tsk = current; in show_stack()
1929 if (tsk == current) in show_stack()
1932 sp = tsk->thread.ksp; in show_stack()
1938 if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD)) in show_stack()
1963 if (validate_sp(sp, tsk, STACK_INT_FRAME_SIZE) in show_stack()