diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-05-11 20:59:13 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-05-11 20:59:13 +0000 |
commit | e3b4abcb9607063735ea134eca6fad62f8147f20 (patch) | |
tree | 3cb2e5fa1795bfc2b2df6b0e72ce4b39e44f4ae0 /include/asm-mips64/system.h | |
parent | aed9bea016318b0f4cd8b3ac9aae9cb0f78526ef (diff) |
SMP FPU management: similar to what sparc does, no lazy fpu context
switching in SMP mode, use PF_USEDFPU to determine whether a program
used the fpu in the last time quantum and so needs the fpu context
to be saved during context switch.
Diffstat (limited to 'include/asm-mips64/system.h')
-rw-r--r-- | include/asm-mips64/system.h | 17 |
1 files changed, 17 insertions, 0 deletions
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) |