aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/fpu.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-09-21 06:04:55 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-09-21 06:04:55 -0400
commite7ab3cd251926d57ee11d7d320e8fb42c882ad22 (patch)
tree29dce1711413e010d30fb62c43cbe517a9de95bc /arch/sh/include/asm/fpu.h
parent4b4cf7595a8bce9b4dd64c241a8cb7336ecb9489 (diff)
sh: Add FPU registers to regset interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
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 */