diff options
author | Michael Matloob <matloob@golang.org> | 2015-11-02 14:09:24 -0500 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2015-11-10 17:38:04 +0000 |
commit | 67faca7d9c54b367aee5fdeef2d5dd609fcf99d0 (patch) | |
tree | 5c6e8b4e243286311bbc4743d6a8e86f16dda85f /src/runtime/sys_linux_arm.s | |
parent | d33360571f46b46724b908a5603520dce1e8a81c (diff) | |
download | go-67faca7d9c54b367aee5fdeef2d5dd609fcf99d0.tar.gz go-67faca7d9c54b367aee5fdeef2d5dd609fcf99d0.zip |
runtime: break atomics out into package runtime/internal/atomic
This change breaks out most of the atomics functions in the runtime
into package runtime/internal/atomic. It adds some basic support
in the toolchain for runtime packages, and also modifies linux/arm
atomics to remove the dependency on the runtime's mutex. The mutexes
have been replaced with spinlocks.
all trybots are happy!
In addition to the trybots, I've tested on the darwin/arm64 builder,
on the darwin/arm builder, and on a ppc64le machine.
Change-Id: I6698c8e3cf3834f55ce5824059f44d00dc8e3c2f
Reviewed-on: https://go-review.googlesource.com/14204
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_arm.s')
-rw-r--r-- | src/runtime/sys_linux_arm.s | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index 29eb8eb077..216781ef7a 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -390,35 +390,6 @@ TEXT runtime·usleep(SB),NOSPLIT,$12 SWI $0 RET -// Use kernel version instead of native armcas in asm_arm.s. -// See ../sync/atomic/asm_linux_arm.s for details. -TEXT cas<>(SB),NOSPLIT,$0 - MOVW $0xffff0fc0, R15 // R15 is hardware PC. - -TEXT runtime·cas(SB),NOSPLIT,$0 - MOVW ptr+0(FP), R2 - MOVW old+4(FP), R0 -loop: - MOVW new+8(FP), R1 - BL cas<>(SB) - BCC check - MOVW $1, R0 - MOVB R0, ret+12(FP) - RET -check: - // Kernel lies; double-check. - MOVW ptr+0(FP), R2 - MOVW old+4(FP), R0 - MOVW 0(R2), R3 - CMP R0, R3 - BEQ loop - MOVW $0, R0 - MOVB R0, ret+12(FP) - RET - -TEXT runtime·casp1(SB),NOSPLIT,$0 - B runtime·cas(SB) - // As for cas, memory barriers are complicated on ARM, but the kernel // provides a user helper. ARMv5 does not support SMP and has no // memory barrier instruction at all. ARMv6 added SMP support and has |