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

     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.
     4  
     5  //go:build arm64
     6  
     7  package atomic
     8  
     9  import (
    10  	"internal/cpu"
    11  	"unsafe"
    12  )
    13  
    14  const (
    15  	offsetARM64HasATOMICS = unsafe.Offsetof(cpu.ARM64.HasATOMICS)
    16  )
    17  
    18  //go:noescape
    19  func Xadd(ptr *uint32, delta int32) uint32
    20  
    21  //go:noescape
    22  func Xadd64(ptr *uint64, delta int64) uint64
    23  
    24  //go:noescape
    25  func Xadduintptr(ptr *uintptr, delta uintptr) uintptr
    26  
    27  //go:noescape
    28  func Xchg8(ptr *uint8, new uint8) uint8
    29  
    30  //go:noescape
    31  func Xchg(ptr *uint32, new uint32) uint32
    32  
    33  //go:noescape
    34  func Xchg64(ptr *uint64, new uint64) uint64
    35  
    36  //go:noescape
    37  func Xchguintptr(ptr *uintptr, new uintptr) uintptr
    38  
    39  //go:noescape
    40  func Load(ptr *uint32) uint32
    41  
    42  //go:noescape
    43  func Load8(ptr *uint8) uint8
    44  
    45  //go:noescape
    46  func Load64(ptr *uint64) uint64
    47  
    48  // NO go:noescape annotation; *ptr escapes if result escapes (#31525)
    49  func Loadp(ptr unsafe.Pointer) unsafe.Pointer
    50  
    51  //go:noescape
    52  func LoadAcq(addr *uint32) uint32
    53  
    54  //go:noescape
    55  func LoadAcq64(ptr *uint64) uint64
    56  
    57  //go:noescape
    58  func LoadAcquintptr(ptr *uintptr) uintptr
    59  
    60  //go:noescape
    61  func Or8(ptr *uint8, val uint8)
    62  
    63  //go:noescape
    64  func And8(ptr *uint8, val uint8)
    65  
    66  //go:noescape
    67  func And(ptr *uint32, val uint32)
    68  
    69  //go:noescape
    70  func Or(ptr *uint32, val uint32)
    71  
    72  //go:noescape
    73  func And32(ptr *uint32, val uint32) uint32
    74  
    75  //go:noescape
    76  func Or32(ptr *uint32, val uint32) uint32
    77  
    78  //go:noescape
    79  func And64(ptr *uint64, val uint64) uint64
    80  
    81  //go:noescape
    82  func Or64(ptr *uint64, val uint64) uint64
    83  
    84  //go:noescape
    85  func Anduintptr(ptr *uintptr, val uintptr) uintptr
    86  
    87  //go:noescape
    88  func Oruintptr(ptr *uintptr, val uintptr) uintptr
    89  
    90  //go:noescape
    91  func Cas64(ptr *uint64, old, new uint64) bool
    92  
    93  //go:noescape
    94  func CasRel(ptr *uint32, old, new uint32) bool
    95  
    96  //go:noescape
    97  func Store(ptr *uint32, val uint32)
    98  
    99  //go:noescape
   100  func Store8(ptr *uint8, val uint8)
   101  
   102  //go:noescape
   103  func Store64(ptr *uint64, val uint64)
   104  
   105  // NO go:noescape annotation; see atomic_pointer.go.
   106  func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
   107  
   108  //go:noescape
   109  func StoreRel(ptr *uint32, val uint32)
   110  
   111  //go:noescape
   112  func StoreRel64(ptr *uint64, val uint64)
   113  
   114  //go:noescape
   115  func StoreReluintptr(ptr *uintptr, val uintptr)
   116  

View as plain text