summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips64/processor.h8
-rw-r--r--include/asm-mips64/system.h17
2 files changed, 25 insertions, 0 deletions
diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h
index 0532dbf0c..1932672e7 100644
--- a/include/asm-mips64/processor.h
+++ b/include/asm-mips64/processor.h
@@ -87,6 +87,14 @@ extern int EISA_bus;
/* Lazy FPU handling on uni-processor */
extern struct task_struct *last_task_used_math;
+#ifndef CONFIG_SMP
+#define IS_FPU_OWNER() (last_task_used_math == current)
+#define CLEAR_FPU_OWNER() last_task_used_math = NULL;
+#else
+#define IS_FPU_OWNER() (current->flags & PF_USEDFPU)
+#define CLEAR_FPU_OWNER() current->flags &= ~PF_USEDFPU;
+#endif
+
/*
* User space process size: 1TB. This is hardcoded into a few places,
* so don't change it unless you know what you are doing. TASK_SIZE
diff --git a/include/asm-mips64/system.h b/include/asm-mips64/system.h
index 7f518a8b8..3592b3821 100644
--- a/include/asm-mips64/system.h
+++ b/include/asm-mips64/system.h
@@ -169,8 +169,25 @@ extern asmlinkage void *resume(void *last, void *next);
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
#define prepare_to_switch() do { } while(0)
+
+extern asmlinkage void lazy_fpu_switch(void *, void *);
+extern asmlinkage void init_fpu(void);
+extern asmlinkage void save_fp(void *);
+
+#ifdef CONFIG_SMP
+#define SWITCH_DO_LAZY_FPU \
+ if (prev->flags & PF_USEDFPU) { \
+ lazy_fpu_switch(prev, 0); \
+ set_cp0_status(ST0_CU1, ~ST0_CU1); \
+ prev->flags &= ~PF_USEDFPU; \
+ }
+#else /* CONFIG_SMP */
+#define SWITCH_DO_LAZY_FPU do { } while(0)
+#endif /* CONFIG_SMP */
+
#define switch_to(prev,next,last) \
do { \
+ SWITCH_DO_LAZY_FPU; \
(last) = resume(prev, next); \
} while(0)