Commit 883530c0 authored by Russ Cox's avatar Russ Cox

sync/atomic: fix new swap on arm linux

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12920043
parent 72636eb5
......@@ -37,7 +37,7 @@ func addUint64(val *uint64, delta uint64) (new uint64) {
func swapUint64(addr *uint64, new uint64) (old uint64) {
for {
old := *addr
old = *addr
if CompareAndSwapUint64(addr, old, new) {
break
}
......
......@@ -88,9 +88,10 @@ TEXT ·SwapUint32(SB),NOSPLIT,$0-12
MOVW new+4(FP), R1
swaploop1:
MOVW 0(R2), R0
MOVW R0, R4 // cas smashes R0
BL cas<>(SB)
BCC swaploop1
MOVW R0, old+8(FP)
MOVW R4, old+8(FP)
RET
TEXT ·SwapUintptr(SB),NOSPLIT,$0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment