diff options
Diffstat (limited to 'include/asm-sh/fpu.h')
-rw-r--r-- | include/asm-sh/fpu.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/include/asm-sh/fpu.h b/include/asm-sh/fpu.h index f8429880a270..f89abf5920d8 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 |
@@ -28,18 +27,23 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); | |||
28 | 27 | ||
29 | extern int do_fpu_inst(unsigned short, struct pt_regs *); | 28 | extern int do_fpu_inst(unsigned short, struct pt_regs *); |
30 | 29 | ||
31 | #define unlazy_fpu(tsk, regs) do { \ | 30 | static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs) |
32 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ | 31 | { |
33 | save_fpu(tsk, regs); \ | 32 | preempt_disable(); |
34 | } \ | 33 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) |
35 | } while (0) | 34 | save_fpu(tsk, regs); |
36 | 35 | preempt_enable(); | |
37 | #define clear_fpu(tsk, regs) do { \ | 36 | } |
38 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ | 37 | |
39 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); \ | 38 | static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs) |
40 | release_fpu(regs); \ | 39 | { |
41 | } \ | 40 | preempt_disable(); |
42 | } while (0) | 41 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { |
42 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
43 | release_fpu(regs); | ||
44 | } | ||
45 | preempt_enable(); | ||
46 | } | ||
43 | 47 | ||
44 | #endif /* __ASSEMBLY__ */ | 48 | #endif /* __ASSEMBLY__ */ |
45 | 49 | ||