aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/fpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/include/asm/fpu.h')
-rw-r--r--arch/sh/include/asm/fpu.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/sh/include/asm/fpu.h b/arch/sh/include/asm/fpu.h
index 91462fea150..1d3aee04b5c 100644
--- a/arch/sh/include/asm/fpu.h
+++ b/arch/sh/include/asm/fpu.h
@@ -30,8 +30,15 @@ static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
30} 30}
31#endif 31#endif
32 32
33struct user_regset;
34
33extern int do_fpu_inst(unsigned short, struct pt_regs *); 35extern int do_fpu_inst(unsigned short, struct pt_regs *);
34 36
37extern int fpregs_get(struct task_struct *target,
38 const struct user_regset *regset,
39 unsigned int pos, unsigned int count,
40 void *kbuf, void __user *ubuf);
41
35static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs) 42static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
36{ 43{
37 preempt_disable(); 44 preempt_disable();
@@ -50,6 +57,18 @@ static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
50 preempt_enable(); 57 preempt_enable();
51} 58}
52 59
60static inline int init_fpu(struct task_struct *tsk)
61{
62 if (tsk_used_math(tsk)) {
63 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
64 unlazy_fpu(tsk, task_pt_regs(tsk));
65 return 0;
66 }
67
68 set_stopped_child_used_math(tsk);
69 return 0;
70}
71
53#endif /* __ASSEMBLY__ */ 72#endif /* __ASSEMBLY__ */
54 73
55#endif /* __ASM_SH_FPU_H */ 74#endif /* __ASM_SH_FPU_H */