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 Linux sigset type on big-endian 64-bit machines.
6
7//go:build linux && (ppc64 || s390x)
8
9package runtime
10
11const (
12	_SS_DISABLE  = 2
13	_NSIG        = 65
14	_SIG_BLOCK   = 0
15	_SIG_UNBLOCK = 1
16	_SIG_SETMASK = 2
17)
18
19type sigset uint64
20
21var sigset_all = sigset(^uint64(0))
22
23//go:nosplit
24//go:nowritebarrierrec
25func sigaddset(mask *sigset, i int) {
26	if i > 64 {
27		throw("unexpected signal greater than 64")
28	}
29	*mask |= 1 << (uint(i) - 1)
30}
31
32func sigdelset(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//go:nosplit
40func sigfillset(mask *uint64) {
41	*mask = ^uint64(0)
42}
43