1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 func Xadd(ptr *uint32, delta int32) uint32
15 func Xadd64(ptr *uint64, delta int64) uint64
18 func Xadduintptr(ptr *uintptr, delta uintptr) uintptr
21 func Xchg(ptr *uint32, new uint32) uint32
24 func Xchg64(ptr *uint64, new uint64) uint64
27 func Xchguintptr(ptr *uintptr, new uintptr) uintptr
30 func Load(ptr *uint32) uint32
33 func Load64(ptr *uint64) uint64
36 func Loadp(ptr unsafe.Pointer) unsafe.Pointer
39 func Or8(addr *uint8, v uint8) {
40 // TODO(dfc) implement this in asm.
41 // Align down to 4 bytes and use 32-bit CAS.
42 uaddr := uintptr(unsafe.Pointer(addr))
43 addr32 := (*uint32)(unsafe.Pointer(uaddr &^ 3))
44 word := uint32(v) << ((uaddr & 3) * 8) // little endian
47 if Cas(addr32, old, old|word) {
54 func And8(addr *uint8, v uint8) {
55 // TODO(dfc) implement this in asm.
56 // Align down to 4 bytes and use 32-bit CAS.
57 uaddr := uintptr(unsafe.Pointer(addr))
58 addr32 := (*uint32)(unsafe.Pointer(uaddr &^ 3))
59 word := uint32(v) << ((uaddr & 3) * 8) // little endian
60 mask := uint32(0xFF) << ((uaddr & 3) * 8) // little endian
64 if Cas(addr32, old, old&word) {
71 func Cas64(ptr *uint64, old, new uint64) bool
74 func Store(ptr *uint32, val uint32)
77 func Store64(ptr *uint64, val uint64)
79 // NO go:noescape annotation; see atomic_pointer.go.
80 func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)