aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/fpu.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-01-18 09:56:22 +1100
committerJames Morris <jmorris@namei.org>2010-01-18 09:56:22 +1100
commit2457552d1e6f3183cd93f81c49a8da5fe8bb0e42 (patch)
tree7ca46caa910012d75617700e4083b3657053cb31 /arch/sh/include/asm/fpu.h
parentselinux: change the handling of unknown classes (diff)
parentpage allocator: update NR_FREE_PAGES only when necessary (diff)
downloadlinux-dev-2457552d1e6f3183cd93f81c49a8da5fe8bb0e42.tar.xz
linux-dev-2457552d1e6f3183cd93f81c49a8da5fe8bb0e42.zip
Merge branch 'master' into next
Diffstat (limited to 'arch/sh/include/asm/fpu.h')
-rw-r--r--arch/sh/include/asm/fpu.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/sh/include/asm/fpu.h b/arch/sh/include/asm/fpu.h
index 1d3aee04b5cc..fb6bbb9b1cc8 100644
--- a/arch/sh/include/asm/fpu.h
+++ b/arch/sh/include/asm/fpu.h
@@ -18,16 +18,15 @@ static inline void grab_fpu(struct pt_regs *regs)
struct task_struct;
-extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
+extern void save_fpu(struct task_struct *__tsk);
+void fpu_state_restore(struct pt_regs *regs);
#else
+#define save_fpu(tsk) do { } while (0)
#define release_fpu(regs) do { } while (0)
#define grab_fpu(regs) do { } while (0)
+#define fpu_state_restore(regs) do { } while (0)
-static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
-{
- clear_tsk_thread_flag(tsk, TIF_USEDFPU);
-}
#endif
struct user_regset;
@@ -39,19 +38,28 @@ extern int fpregs_get(struct task_struct *target,
unsigned int pos, unsigned int count,
void *kbuf, void __user *ubuf);
+static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+ if (task_thread_info(tsk)->status & TS_USEDFPU) {
+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
+ save_fpu(tsk);
+ release_fpu(regs);
+ } else
+ tsk->fpu_counter = 0;
+}
+
static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
{
preempt_disable();
- if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
- save_fpu(tsk, regs);
+ __unlazy_fpu(tsk, regs);
preempt_enable();
}
static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
{
preempt_disable();
- if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
- clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+ if (task_thread_info(tsk)->status & TS_USEDFPU) {
+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
release_fpu(regs);
}
preempt_enable();