summaryrefslogtreecommitdiff
path: root/arch/sparc/lib/atomic_32.S
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-13 15:08:24 +0530
committerSrikant Patnaik2015-01-13 15:08:24 +0530
commit97327692361306d1e6259021bc425e32832fdb50 (patch)
treefe9088f3248ec61e24f404f21b9793cb644b7f01 /arch/sparc/lib/atomic_32.S
parent2d05a8f663478a44e088d122e0d62109bbc801d0 (diff)
parenta3a8b90b61e21be3dde9101c4e86c881e0f06210 (diff)
downloadFOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.gz
FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.bz2
FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.zip
dirty fix to merging
Diffstat (limited to 'arch/sparc/lib/atomic_32.S')
-rw-r--r--arch/sparc/lib/atomic_32.S44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/sparc/lib/atomic_32.S b/arch/sparc/lib/atomic_32.S
new file mode 100644
index 00000000..eb6c7359
--- /dev/null
+++ b/arch/sparc/lib/atomic_32.S
@@ -0,0 +1,44 @@
+/* atomic.S: Move this stuff here for better ICACHE hit rates.
+ *
+ * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
+ */
+
+#include <asm/ptrace.h>
+#include <asm/psr.h>
+
+ .text
+ .align 4
+
+ .globl __atomic_begin
+__atomic_begin:
+
+#ifndef CONFIG_SMP
+ .globl ___xchg32_sun4c
+___xchg32_sun4c:
+ rd %psr, %g3
+ andcc %g3, PSR_PIL, %g0
+ bne 1f
+ nop
+ wr %g3, PSR_PIL, %psr
+ nop; nop; nop
+1:
+ andcc %g3, PSR_PIL, %g0
+ ld [%g1], %g7
+ bne 1f
+ st %g2, [%g1]
+ wr %g3, 0x0, %psr
+ nop; nop; nop
+1:
+ mov %g7, %g2
+ jmpl %o7 + 8, %g0
+ mov %g4, %o7
+
+ .globl ___xchg32_sun4md
+___xchg32_sun4md:
+ swap [%g1], %g2
+ jmpl %o7 + 8, %g0
+ mov %g4, %o7
+#endif
+
+ .globl __atomic_end
+__atomic_end: