|
@@ -21,6 +21,7 @@
|
|
|
#include <asm/hazards.h>
|
|
|
#include <asm/processor.h>
|
|
|
#include <asm/current.h>
|
|
|
+#include <asm/msa.h>
|
|
|
|
|
|
#ifdef CONFIG_MIPS_MT_FPAFF
|
|
|
#include <asm/mips_mt.h>
|
|
@@ -141,13 +142,21 @@ static inline int own_fpu(int restore)
|
|
|
static inline void lose_fpu(int save)
|
|
|
{
|
|
|
preempt_disable();
|
|
|
- if (is_fpu_owner()) {
|
|
|
+ if (is_msa_enabled()) {
|
|
|
+ if (save) {
|
|
|
+ save_msa(current);
|
|
|
+ asm volatile("cfc1 %0, $31"
|
|
|
+ : "=r"(current->thread.fpu.fcr31));
|
|
|
+ }
|
|
|
+ disable_msa();
|
|
|
+ clear_thread_flag(TIF_USEDMSA);
|
|
|
+ } else if (is_fpu_owner()) {
|
|
|
if (save)
|
|
|
_save_fp(current);
|
|
|
- KSTK_STATUS(current) &= ~ST0_CU1;
|
|
|
- clear_thread_flag(TIF_USEDFPU);
|
|
|
__disable_fpu();
|
|
|
}
|
|
|
+ KSTK_STATUS(current) &= ~ST0_CU1;
|
|
|
+ clear_thread_flag(TIF_USEDFPU);
|
|
|
preempt_enable();
|
|
|
}
|
|
|
|