1// Copyright 2015 The Go Authors. All rights reserved.2// Use of this source code is governed by a BSD-style3// license that can be found in the LICENSE file.45//go:build !linux67#include "textflag.h"89// TODO(minux): this is only valid for ARMv6+10// func armcas(ptr *int32, old int32, new int32) bool11// Atomically:12// if *ptr == old {13// *ptr = new14// return true15// } else {16// return false17// }18TEXT ·Cas(SB),NOSPLIT,$019 JMP ·armcas(SB)2021// Non-linux OSes support only single processor machines before ARMv7.22// So we don't need memory barriers if goarm < 7. And we fail loud at23// startup (runtime.checkgoarm) if it is a multi-processor but goarm < 7.2425TEXT ·Load(SB),NOSPLIT|NOFRAME,$0-826 MOVW addr+0(FP), R027 MOVW (R0), R12829 MOVB runtime·goarm(SB), R1130 CMP $7, R1131 BLT 2(PC)32 DMB MB_ISH3334 MOVW R1, ret+4(FP)35 RET3637TEXT ·Store(SB),NOSPLIT,$0-838 MOVW addr+0(FP), R139 MOVW v+4(FP), R24041 MOVB runtime·goarm(SB), R842 CMP $7, R843 BLT 2(PC)44 DMB MB_ISH4546 MOVW R2, (R1)4748 CMP $7, R849 BLT 2(PC)50 DMB MB_ISH51 RET5253TEXT ·Load8(SB),NOSPLIT|NOFRAME,$0-554 MOVW addr+0(FP), R055 MOVB (R0), R15657 MOVB runtime·goarm(SB), R1158 CMP $7, R1159 BLT 2(PC)60 DMB MB_ISH6162 MOVB R1, ret+4(FP)63 RET6465TEXT ·Store8(SB),NOSPLIT,$0-566 MOVW addr+0(FP), R167 MOVB v+4(FP), R26869 MOVB runtime·goarm(SB), R870 CMP $7, R871 BLT 2(PC)72 DMB MB_ISH7374 MOVB R2, (R1)7576 CMP $7, R877 BLT 2(PC)78 DMB MB_ISH79 RET
Findings
✓ No findings reported for this file.