diff options
| author | Russ Cox <rsc@golang.org> | 2011-02-25 14:29:55 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-02-25 14:29:55 -0500 |
| commit | 9ad9742157f8668c26879dce12bde94e3ad075ab (patch) | |
| tree | 54a57005fa02e36e524a9ad63ea843642fcadeec /src/pkg/runtime/linux | |
| parent | 12b7875bf2c534c7ec1659a733ec2d82a3f85076 (diff) | |
| download | go-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.s | 18 |
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) + |
