Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/os_linux_mips64x.go

Documentation: runtime

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

View as plain text