summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-05-04 01:04:51 +0200
committerOndřej Surý <ondrej@sury.org>2011-05-23 11:04:16 +0200
commit1f2ed67937cacb19b0b7e54ea3f5866ca34842a0 (patch)
tree80161968f6cf9bf5c82466f9b79515bd000378c3 /src/pkg/runtime/linux
parent7ebfc6938b38f928f913cee02c70cf464d420e29 (diff)
downloadgolang-1f2ed67937cacb19b0b7e54ea3f5866ca34842a0.tar.gz
Imported Upstream version 57
Diffstat (limited to 'src/pkg/runtime/linux')
-rw-r--r--src/pkg/runtime/linux/arm/sys.s15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/pkg/runtime/linux/arm/sys.s b/src/pkg/runtime/linux/arm/sys.s
index d866b0e22..2b5365bd8 100644
--- a/src/pkg/runtime/linux/arm/sys.s
+++ b/src/pkg/runtime/linux/arm/sys.s
@@ -258,11 +258,22 @@ TEXT cas<>(SB),7,$0
TEXT runtime·cas(SB),7,$0
MOVW valptr+0(FP), R2
MOVW old+4(FP), R0
+casagain:
MOVW new+8(FP), R1
BL cas<>(SB)
- MOVW $0, R0
- MOVW.CS $1, R0
+ BCC cascheck
+ MOVW $1, R0
RET
+cascheck:
+ // Kernel lies; double-check.
+ MOVW valptr+0(FP), R2
+ MOVW old+4(FP), R0
+ MOVW 0(R2), R3
+ CMP R0, R3
+ BEQ casagain
+ MOVW $0, R0
+ RET
+
TEXT runtime·casp(SB),7,$0
B runtime·cas(SB)