github.com/riscv/riscv-go@v0.0.0-20200123204226-124ebd6fcc8e/src/runtime/os_linux_be64.go (about)

     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  // The standard GNU/Linux sigset type on big-endian 64-bit machines.
     6  
     7  // +build ppc64 s390x
     8  
     9  package runtime
    10  
    11  const (
    12  	_SS_DISABLE  = 2
    13  	_NSIG        = 65
    14  	_SI_USER     = 0
    15  	_SIG_BLOCK   = 0
    16  	_SIG_UNBLOCK = 1
    17  	_SIG_SETMASK = 2
    18  	_RLIMIT_AS   = 9
    19  )
    20  
    21  type sigset uint64
    22  
    23  type rlimit struct {
    24  	rlim_cur uintptr
    25  	rlim_max uintptr
    26  }
    27  
    28  var sigset_all = sigset(^uint64(0))
    29  
    30  //go:nosplit
    31  //go:nowritebarrierrec
    32  func sigaddset(mask *sigset, i int) {
    33  	if i > 64 {
    34  		throw("unexpected signal greater than 64")
    35  	}
    36  	*mask |= 1 << (uint(i) - 1)
    37  }
    38  
    39  func sigdelset(mask *sigset, i int) {
    40  	if i > 64 {
    41  		throw("unexpected signal greater than 64")
    42  	}
    43  	*mask &^= 1 << (uint(i) - 1)
    44  }
    45  
    46  func sigfillset(mask *uint64) {
    47  	*mask = ^uint64(0)
    48  }