...
Run Format

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

Documentation: runtime/internal/atomic

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

View as plain text