Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / mips / kernel / r4k_switch.S
index 0b1b54a..d5c8b82 100644 (file)
@@ -10,7 +10,6 @@
  * Copyright (C) 2000 MIPS Technologies, Inc.
  *    written by Carsten Langgaard, carstenl@mips.com
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/fpregdef.h>
@@ -75,8 +74,8 @@
        and     t0, t0, t1
        LONG_S  t0, ST_OFF(t3)
 
-       fpu_save_double a0 t1 t0 t2             # c0_status passed in t1
-                                               # clobbers t0 and t2
+       fpu_save_double a0 t0 t1                # c0_status passed in t0
+                                               # clobbers t1
 1:
 
        /*
@@ -94,7 +93,7 @@
        ori     t1, t2, TCSTATUS_IXMT
        mtc0    t1, CP0_TCSTATUS
        andi    t2, t2, TCSTATUS_IXMT
-       ehb
+       _ehb
        DMT     8                               # dmt   t0
        move    t1,ra
        jal     mips_ihb
        or      a2, t1
        mtc0    a2, CP0_STATUS
 #ifdef CONFIG_MIPS_MT_SMTC
-       ehb
+       _ehb
        andi    t0, t0, VPECONTROL_TE
        beqz    t0, 1f
        emt
        xori    t1, t1, TCSTATUS_IXMT
        or      t1, t1, t2
        mtc0    t1, CP0_TCSTATUS
-       ehb
+       _ehb
 #endif /* CONFIG_MIPS_MT_SMTC */
        move    v0, a0
        jr      ra
  */
 LEAF(_save_fp)
 #ifdef CONFIG_64BIT
-       mfc0    t1, CP0_STATUS
+       mfc0    t0, CP0_STATUS
 #endif
-       fpu_save_double a0 t1 t0 t2             # clobbers t1
+       fpu_save_double a0 t0 t1                # clobbers t1
        jr      ra
        END(_save_fp)
 
@@ -139,7 +138,10 @@ LEAF(_save_fp)
  * Restore a thread's fp context.
  */
 LEAF(_restore_fp)
-       fpu_restore_double a0, t1               # clobbers t1
+#ifdef CONFIG_64BIT
+       mfc0    t0, CP0_STATUS
+#endif
+       fpu_restore_double a0 t0 t1             # clobbers t1
        jr      ra
        END(_restore_fp)