These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / mips / include / asm / fpu.h
index 084780b..9cbf383 100644 (file)
@@ -74,7 +74,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
                goto fr_common;
 
        case FPU_64BIT:
-#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS32_R6) \
+#if !(defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) \
       || defined(CONFIG_64BIT))
                /* we only have a 32-bit FPU */
                return SIGFPE;
@@ -164,25 +164,30 @@ static inline int own_fpu(int restore)
        return ret;
 }
 
-static inline void lose_fpu(int save)
+static inline void lose_fpu_inatomic(int save, struct task_struct *tsk)
 {
-       preempt_disable();
        if (is_msa_enabled()) {
                if (save) {
-                       save_msa(current);
-                       current->thread.fpu.fcr31 =
+                       save_msa(tsk);
+                       tsk->thread.fpu.fcr31 =
                                        read_32bit_cp1_register(CP1_STATUS);
                }
                disable_msa();
-               clear_thread_flag(TIF_USEDMSA);
+               clear_tsk_thread_flag(tsk, TIF_USEDMSA);
                __disable_fpu();
        } else if (is_fpu_owner()) {
                if (save)
-                       _save_fp(current);
+                       _save_fp(tsk);
                __disable_fpu();
        }
-       KSTK_STATUS(current) &= ~ST0_CU1;
-       clear_thread_flag(TIF_USEDFPU);
+       KSTK_STATUS(tsk) &= ~ST0_CU1;
+       clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+}
+
+static inline void lose_fpu(int save)
+{
+       preempt_disable();
+       lose_fpu_inatomic(save, current);
        preempt_enable();
 }