patch-2.3.99-pre9 linux/arch/mips64/kernel/r4k_switch.S

Next file: linux/arch/mips64/kernel/r4k_tlb_debug.c
Previous file: linux/arch/mips64/kernel/r4k_genex.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_switch.S linux/arch/mips64/kernel/r4k_switch.S
@@ -9,6 +9,7 @@
  * Copyright (C) 1994, 1995, 1996, by Andreas Busse
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
+#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
 #include <asm/cachectl.h>
@@ -43,8 +44,14 @@
 	 */
 	move	$28, a1
 	cpu_restore_nonscratch $28
+#ifndef CONFIG_SMP
 	daddiu	t0, $28, KERNEL_STACK_SIZE-32
 	sd	t0, kernelsp
+#else
+	mtc0	a1, CP0_WATCHLO
+	dsrl32	a1, a1, 0
+	mtc0	a1, CP0_WATCHHI
+#endif
 	mfc0	t1, CP0_STATUS		/* Do we really need this? */
 	li	a3, 0xff00
 	and	t1, a3
@@ -73,7 +80,7 @@
 	beqz	a0, 2f				# Save floating point state
 	 nor	t3, zero, t3
 
-	lw	t1, ST_OFF(a0)			# last thread looses fpu
+	ld	t1, ST_OFF(a0)			# last thread looses fpu
 	and	t1, t3
 	sd	t1, ST_OFF(a0)
 	sll	t2, t1, 5
@@ -84,6 +91,8 @@
 	fpu_save_16even a0 t1			# clobbers t1
 2:
 
+	beqz	a1, 3f
+
 	sll	t0, t0, 5			# load new fp state
 	bgez	t0, 1f
 	 ldc1	$f0, (THREAD_FPU + 0x00)($28)
@@ -91,6 +100,7 @@
 1:
 	.set	reorder
 	fpu_restore_16even $28, t0		# clobbers t0
+3:
 	jr	ra
 	END(lazy_fpu_switch)
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)