github.com/twelsh-aw/go/src@v0.0.0-20230516233729-a56fe86a7c81/runtime/os_linux_mips64x.go (about)

     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 linux && (mips64 || mips64le)
     6  
     7  package runtime
     8  
     9  import "internal/cpu"
    10  
    11  func archauxv(tag, val uintptr) {
    12  	switch tag {
    13  	case _AT_HWCAP:
    14  		cpu.HWCap = uint(val)
    15  	}
    16  }
    17  
    18  func osArchInit() {}
    19  
    20  //go:nosplit
    21  func cputicks() int64 {
    22  	// Currently cputicks() is used in blocking profiler and to seed fastrand().
    23  	// nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
    24  	return nanotime()
    25  }
    26  
    27  const (
    28  	_SS_DISABLE  = 2
    29  	_NSIG        = 129
    30  	_SIG_BLOCK   = 1
    31  	_SIG_UNBLOCK = 2
    32  	_SIG_SETMASK = 3
    33  )
    34  
    35  type sigset [2]uint64
    36  
    37  var sigset_all = sigset{^uint64(0), ^uint64(0)}
    38  
    39  //go:nosplit
    40  //go:nowritebarrierrec
    41  func sigaddset(mask *sigset, i int) {
    42  	(*mask)[(i-1)/64] |= 1 << ((uint32(i) - 1) & 63)
    43  }
    44  
    45  func sigdelset(mask *sigset, i int) {
    46  	(*mask)[(i-1)/64] &^= 1 << ((uint32(i) - 1) & 63)
    47  }
    48  
    49  //go:nosplit
    50  func sigfillset(mask *[2]uint64) {
    51  	(*mask)[0], (*mask)[1] = ^uint64(0), ^uint64(0)
    52  }