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//go:build linux && (mips || mipsle)
6
7package runtime
8
9func archauxv(tag, val uintptr) {
10}
11
12func osArchInit() {}
13
14//go:nosplit
15func cputicks() int64 {
16	// nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
17	return nanotime()
18}
19
20const (
21	_SS_DISABLE  = 2
22	_NSIG        = 128 + 1
23	_SIG_BLOCK   = 1
24	_SIG_UNBLOCK = 2
25	_SIG_SETMASK = 3
26)
27
28type sigset [4]uint32
29
30var sigset_all = sigset{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)}
31
32//go:nosplit
33//go:nowritebarrierrec
34func sigaddset(mask *sigset, i int) {
35	(*mask)[(i-1)/32] |= 1 << ((uint32(i) - 1) & 31)
36}
37
38func sigdelset(mask *sigset, i int) {
39	(*mask)[(i-1)/32] &^= 1 << ((uint32(i) - 1) & 31)
40}
41
42//go:nosplit
43func sigfillset(mask *[4]uint32) {
44	(*mask)[0], (*mask)[1], (*mask)[2], (*mask)[3] = ^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)
45}
46