5 #include <linux/preempt.h>
6 #include <asm/ptrace.h>
9 static inline void release_fpu(struct pt_regs *regs)
14 static inline void grab_fpu(struct pt_regs *regs)
21 extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
22 void fpu_state_restore(struct pt_regs *regs);
25 #define release_fpu(regs) do { } while (0)
26 #define grab_fpu(regs) do { } while (0)
28 static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
30 clear_tsk_thread_flag(tsk, TIF_USEDFPU);
36 extern int do_fpu_inst(unsigned short, struct pt_regs *);
38 extern int fpregs_get(struct task_struct *target,
39 const struct user_regset *regset,
40 unsigned int pos, unsigned int count,
41 void *kbuf, void __user *ubuf);
43 static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
46 if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
53 static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
56 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
57 clear_tsk_thread_flag(tsk, TIF_USEDFPU);
63 static inline int init_fpu(struct task_struct *tsk)
65 if (tsk_used_math(tsk)) {
66 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
67 unlazy_fpu(tsk, task_pt_regs(tsk));
71 set_stopped_child_used_math(tsk);
75 #endif /* __ASSEMBLY__ */
77 #endif /* __ASM_SH_FPU_H */