aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-02-25 14:29:55 -0500
committerRuss Cox <rsc@golang.org>2011-02-25 14:29:55 -0500
commit9ad9742157f8668c26879dce12bde94e3ad075ab (patch)
tree54a57005fa02e36e524a9ad63ea843642fcadeec /src/pkg/runtime/linux
parent12b7875bf2c534c7ec1659a733ec2d82a3f85076 (diff)
downloadgo-9ad9742157f8668c26879dce12bde94e3ad075ab.tar.xz
runtime: use kernel-supplied cas on linux/arm
Using the kernel-supplied compare-and-swap code on linux/arm means that runtime doesn't have to care whether this is GOARM=5 or GOARM=6 anymore. Fixes #1494. R=r, r2 CC=golang-dev https://golang.org/cl/4245043
Diffstat (limited to 'src/pkg/runtime/linux')
-rw-r--r--src/pkg/runtime/linux/arm/sys.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pkg/runtime/linux/arm/sys.s b/src/pkg/runtime/linux/arm/sys.s
index 6c222fc8aa..9daf9c2e4d 100644
--- a/src/pkg/runtime/linux/arm/sys.s
+++ b/src/pkg/runtime/linux/arm/sys.s
@@ -230,3 +230,21 @@ TEXT runtime·sigreturn(SB),7,$0
MOVW $SYS_rt_sigreturn, R7
SWI $0
RET
+
+// Use kernel version instead of native armcas in ../../arm.s.
+// See ../../../sync/atomic/asm_linux_arm.s for details.
+TEXT cas<>(SB),7,$0
+ MOVW $0xffff0fc0, PC
+
+TEXT runtime·cas(SB),7,$0
+ MOVW valptr+0(FP), R2
+ MOVW old+4(FP), R0
+ MOVW new+8(FP), R1
+ BL cas<>(SB)
+ MOVW $0, R0
+ MOVW.CS $1, R0
+ RET
+
+TEXT runtime·casp(SB),7,$0
+ B runtime·cas(SB)
+