aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/include/asm/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/include/asm/system.h')
-rw-r--r--arch/mn10300/include/asm/system.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mn10300/include/asm/system.h b/arch/mn10300/include/asm/system.h
index 9f7c7e17c01e..3c272a1a1015 100644
--- a/arch/mn10300/include/asm/system.h
+++ b/arch/mn10300/include/asm/system.h
@@ -19,6 +19,21 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/irqflags.h> 20#include <linux/irqflags.h>
21 21
22#if !defined(CONFIG_LAZY_SAVE_FPU)
23struct fpu_state_struct;
24extern asmlinkage void fpu_save(struct fpu_state_struct *);
25#define switch_fpu(prev, next) \
26 do { \
27 if ((prev)->thread.fpu_flags & THREAD_HAS_FPU) { \
28 (prev)->thread.fpu_flags &= ~THREAD_HAS_FPU; \
29 (prev)->thread.uregs->epsw &= ~EPSW_FE; \
30 fpu_save(&(prev)->thread.fpu_state); \
31 } \
32 } while (0)
33#else
34#define switch_fpu(prev, next) do {} while (0)
35#endif
36
22struct task_struct; 37struct task_struct;
23struct thread_struct; 38struct thread_struct;
24 39
@@ -30,6 +45,7 @@ struct task_struct *__switch_to(struct thread_struct *prev,
30/* context switching is now performed out-of-line in switch_to.S */ 45/* context switching is now performed out-of-line in switch_to.S */
31#define switch_to(prev, next, last) \ 46#define switch_to(prev, next, last) \
32do { \ 47do { \
48 switch_fpu(prev, next); \
33 current->thread.wchan = (u_long) __builtin_return_address(0); \ 49 current->thread.wchan = (u_long) __builtin_return_address(0); \
34 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \ 50 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
35 mb(); \ 51 mb(); \