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);
22 void fpu_state_restore(struct pt_regs *regs);
25 #define save_fpu(tsk) do { } while (0)
26 #define release_fpu(regs) do { } while (0)
27 #define grab_fpu(regs) do { } while (0)
28 #define fpu_state_restore(regs) do { } while (0)
34 extern int do_fpu_inst(unsigned short, struct pt_regs *);
36 extern int fpregs_get(struct task_struct *target,
37 const struct user_regset *regset,
38 unsigned int pos, unsigned int count,
39 void *kbuf, void __user *ubuf);
41 static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
43 if (task_thread_info(tsk)->status & TS_USEDFPU) {
44 task_thread_info(tsk)->status &= ~TS_USEDFPU;
51 static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
54 __unlazy_fpu(tsk, regs);
58 static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
61 if (task_thread_info(tsk)->status & TS_USEDFPU) {
62 task_thread_info(tsk)->status &= ~TS_USEDFPU;
68 static inline int init_fpu(struct task_struct *tsk)
70 if (tsk_used_math(tsk)) {
71 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
72 unlazy_fpu(tsk, task_pt_regs(tsk));
76 set_stopped_child_used_math(tsk);
80 #endif /* __ASSEMBLY__ */
82 #endif /* __ASM_SH_FPU_H */