...

Source file src/runtime/internal/atomic/atomic_amd64x.go

Documentation: runtime/internal/atomic

     1  // Copyright 2009 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.
     4  
     5  // +build amd64 amd64p32
     6  
     7  package atomic
     8  
     9  import "unsafe"
    10  
    11  //go:nosplit
    12  //go:noinline
    13  func Load(ptr *uint32) uint32 {
    14  	return *ptr
    15  }
    16  
    17  //go:nosplit
    18  //go:noinline
    19  func Loadp(ptr unsafe.Pointer) unsafe.Pointer {
    20  	return *(*unsafe.Pointer)(ptr)
    21  }
    22  
    23  //go:nosplit
    24  //go:noinline
    25  func Load64(ptr *uint64) uint64 {
    26  	return *ptr
    27  }
    28  
    29  //go:nosplit
    30  //go:noinline
    31  func LoadAcq(ptr *uint32) uint32 {
    32  	return *ptr
    33  }
    34  
    35  //go:noescape
    36  func Xadd(ptr *uint32, delta int32) uint32
    37  
    38  //go:noescape
    39  func Xadd64(ptr *uint64, delta int64) uint64
    40  
    41  //go:noescape
    42  func Xadduintptr(ptr *uintptr, delta uintptr) uintptr
    43  
    44  //go:noescape
    45  func Xchg(ptr *uint32, new uint32) uint32
    46  
    47  //go:noescape
    48  func Xchg64(ptr *uint64, new uint64) uint64
    49  
    50  //go:noescape
    51  func Xchguintptr(ptr *uintptr, new uintptr) uintptr
    52  
    53  //go:noescape
    54  func And8(ptr *uint8, val uint8)
    55  
    56  //go:noescape
    57  func Or8(ptr *uint8, val uint8)
    58  
    59  // NOTE: Do not add atomicxor8 (XOR is not idempotent).
    60  
    61  //go:noescape
    62  func Cas64(ptr *uint64, old, new uint64) bool
    63  
    64  //go:noescape
    65  func CasRel(ptr *uint32, old, new uint32) bool
    66  
    67  //go:noescape
    68  func Store(ptr *uint32, val uint32)
    69  
    70  //go:noescape
    71  func Store64(ptr *uint64, val uint64)
    72  
    73  //go:noescape
    74  func StoreRel(ptr *uint32, val uint32)
    75  
    76  // StorepNoWB performs *ptr = val atomically and without a write
    77  // barrier.
    78  //
    79  // NO go:noescape annotation; see atomic_pointer.go.
    80  func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
    81  

View as plain text