patch-2.1.97 linux/arch/sparc/lib/atomic.S

Next file: linux/arch/sparc/lib/blockops.S
Previous file: linux/arch/sparc/lib/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.96/linux/arch/sparc/lib/atomic.S linux/arch/sparc/lib/atomic.S
@@ -10,8 +10,9 @@
 	.text
 	.align	4
 
-	.globl	___xchg32
-___xchg32:
+#ifndef __SMP__
+	.globl	___xchg32_sun4c
+___xchg32_sun4c:
 	rd	%psr, %g3
 	andcc	%g3, PSR_PIL, %g0
 	bne	1f
@@ -27,8 +28,15 @@
 	nop; nop; nop
 1:
 	mov	%g7, %g2
-	jmpl	%o7, %g0		/* Note, not + 0x8, see call in system.h */
+	jmpl	%o7 + 8, %g0
 	 mov	%g4, %o7
+
+	.globl	___xchg32_sun4md
+___xchg32_sun4md:
+	swap	[%g1], %g2
+	jmpl	%o7 + 8, %g0
+	 mov	%g4, %o7
+#endif
 
 	/* Read asm-sparc/atomic.h carefully to understand how this works for SMP.
 	 * Really, some things here for SMP are overly clever, go read the header.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov