diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
commit | f15cbe6f1a4b4d9df59142fc8e4abb973302cf44 (patch) | |
tree | 774d7b11abaaf33561ab8268bf51ddd9ceb79025 /arch/sh/include/asm/fpu.h | |
parent | 25326277d8d1393d1c66240e6255aca780f9e3eb (diff) |
sh: migrate to arch/sh/include/
This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac.
Most of the moving about was done with Sam's directions at:
http://marc.info/?l=linux-sh&m=121724823706062&w=2
with subsequent hacking and fixups entirely my fault.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
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.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/sh/include/asm/fpu.h b/arch/sh/include/asm/fpu.h new file mode 100644 index 000000000000..91462fea1507 --- /dev/null +++ b/arch/sh/include/asm/fpu.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef __ASM_SH_FPU_H | ||
2 | #define __ASM_SH_FPU_H | ||
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | #include <linux/preempt.h> | ||
6 | #include <asm/ptrace.h> | ||
7 | |||
8 | #ifdef CONFIG_SH_FPU | ||
9 | static inline void release_fpu(struct pt_regs *regs) | ||
10 | { | ||
11 | regs->sr |= SR_FD; | ||
12 | } | ||
13 | |||
14 | static inline void grab_fpu(struct pt_regs *regs) | ||
15 | { | ||
16 | regs->sr &= ~SR_FD; | ||
17 | } | ||
18 | |||
19 | struct task_struct; | ||
20 | |||
21 | extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); | ||
22 | #else | ||
23 | |||
24 | #define release_fpu(regs) do { } while (0) | ||
25 | #define grab_fpu(regs) do { } while (0) | ||
26 | |||
27 | static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs) | ||
28 | { | ||
29 | clear_tsk_thread_flag(tsk, TIF_USEDFPU); | ||
30 | } | ||
31 | #endif | ||
32 | |||
33 | extern int do_fpu_inst(unsigned short, struct pt_regs *); | ||
34 | |||
35 | static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs) | ||
36 | { | ||
37 | preempt_disable(); | ||
38 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) | ||
39 | save_fpu(tsk, regs); | ||
40 | preempt_enable(); | ||
41 | } | ||
42 | |||
43 | static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs) | ||
44 | { | ||
45 | preempt_disable(); | ||
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 | } | ||
52 | |||
53 | #endif /* __ASSEMBLY__ */ | ||
54 | |||
55 | #endif /* __ASM_SH_FPU_H */ | ||