aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/fpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/fpu.h')
-rw-r--r--include/asm-sh/fpu.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/include/asm-sh/fpu.h b/include/asm-sh/fpu.h
index f8429880a270..91462fea1507 100644
--- a/include/asm-sh/fpu.h
+++ b/include/asm-sh/fpu.h
@@ -1,9 +1,8 @@
1#ifndef __ASM_SH_FPU_H 1#ifndef __ASM_SH_FPU_H
2#define __ASM_SH_FPU_H 2#define __ASM_SH_FPU_H
3 3
4#define SR_FD 0x00008000
5
6#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/preempt.h>
7#include <asm/ptrace.h> 6#include <asm/ptrace.h>
8 7
9#ifdef CONFIG_SH_FPU 8#ifdef CONFIG_SH_FPU
@@ -21,25 +20,35 @@ struct task_struct;
21 20
22extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); 21extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
23#else 22#else
23
24#define release_fpu(regs) do { } while (0) 24#define release_fpu(regs) do { } while (0)
25#define grab_fpu(regs) do { } while (0) 25#define grab_fpu(regs) do { } while (0)
26#define save_fpu(tsk, regs) do { } while (0) 26
27static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
28{
29 clear_tsk_thread_flag(tsk, TIF_USEDFPU);
30}
27#endif 31#endif
28 32
29extern int do_fpu_inst(unsigned short, struct pt_regs *); 33extern int do_fpu_inst(unsigned short, struct pt_regs *);
30 34
31#define unlazy_fpu(tsk, regs) do { \ 35static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
32 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ 36{
33 save_fpu(tsk, regs); \ 37 preempt_disable();
34 } \ 38 if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
35} while (0) 39 save_fpu(tsk, regs);
36 40 preempt_enable();
37#define clear_fpu(tsk, regs) do { \ 41}
38 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ 42
39 clear_tsk_thread_flag(tsk, TIF_USEDFPU); \ 43static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
40 release_fpu(regs); \ 44{
41 } \ 45 preempt_disable();
42} while (0) 46 if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
47 clear_tsk_thread_flag(tsk, TIF_USEDFPU);
48 release_fpu(regs);
49 }
50 preempt_enable();
51}
43 52
44#endif /* __ASSEMBLY__ */ 53#endif /* __ASSEMBLY__ */
45 54