summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org')
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c1
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go44
-rw-r--r--vendor/golang.org/x/sys/cpu/endian_big.go11
-rw-r--r--vendor/golang.org/x/sys/cpu/endian_little.go11
-rw-r--r--vendor/golang.org/x/sys/cpu/parse.go43
-rw-r--r--vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go54
-rw-r--r--vendor/golang.org/x/sys/unix/gccgo.go4
-rw-r--r--vendor/golang.org/x/sys/unix/gccgo_c.c4
-rw-r--r--vendor/golang.org/x/sys/unix/ioctl.go4
-rw-r--r--vendor/golang.org/x/sys/unix/mkall.sh4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_dragonfly.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_386.go9
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go9
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go9
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go9
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go9
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_hurd.go22
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_hurd_386.go29
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go51
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_netbsd.go15
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_solaris.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_unix.go57
-rw-r--r--vendor/golang.org/x/sys/unix/timestruct.go2
-rw-r--r--vendor/golang.org/x/sys/unix/xattr_bsd.go9
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux.go30
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_386.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go356
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go189
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go348
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go160
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go95
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go10
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s137
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s137
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s137
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s137
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go812
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s669
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s6
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go14
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s137
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go13
-rw-r--r--vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go51
-rw-r--r--vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go17
-rw-r--r--vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go51
-rw-r--r--vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go3
-rw-r--r--vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux.go217
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go84
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go84
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go84
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go84
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go97
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go33
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go9
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go9
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go9
-rw-r--r--vendor/golang.org/x/sys/windows/syscall_windows.go14
92 files changed, 3616 insertions, 1234 deletions
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
index a4605e6d1..6cc73109f 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (386 || amd64 || amd64p32) && gccgo
// +build 386 amd64 amd64p32
// +build gccgo
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
index 79a38a0b9..a968b80fa 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
@@ -4,6 +4,11 @@
package cpu
+import (
+ "strings"
+ "syscall"
+)
+
// HWCAP/HWCAP2 bits. These are exposed by Linux.
const (
hwcap_FP = 1 << 0
@@ -32,10 +37,45 @@ const (
hwcap_ASIMDFHM = 1 << 23
)
+// linuxKernelCanEmulateCPUID reports whether we're running
+// on Linux 4.11+. Ideally we'd like to ask the question about
+// whether the current kernel contains
+// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=77c97b4ee21290f5f083173d957843b615abbff2
+// but the version number will have to do.
+func linuxKernelCanEmulateCPUID() bool {
+ var un syscall.Utsname
+ syscall.Uname(&un)
+ var sb strings.Builder
+ for _, b := range un.Release[:] {
+ if b == 0 {
+ break
+ }
+ sb.WriteByte(byte(b))
+ }
+ major, minor, _, ok := parseRelease(sb.String())
+ return ok && (major > 4 || major == 4 && minor >= 11)
+}
+
func doinit() {
if err := readHWCAP(); err != nil {
- // failed to read /proc/self/auxv, try reading registers directly
- readARM64Registers()
+ // We failed to read /proc/self/auxv. This can happen if the binary has
+ // been given extra capabilities(7) with /bin/setcap.
+ //
+ // When this happens, we have two options. If the Linux kernel is new
+ // enough (4.11+), we can read the arm64 registers directly which'll
+ // trap into the kernel and then return back to userspace.
+ //
+ // But on older kernels, such as Linux 4.4.180 as used on many Synology
+ // devices, calling readARM64Registers (specifically getisar0) will
+ // cause a SIGILL and we'll die. So for older kernels, parse /proc/cpuinfo
+ // instead.
+ //
+ // See golang/go#57336.
+ if linuxKernelCanEmulateCPUID() {
+ readARM64Registers()
+ } else {
+ readLinuxProcCPUInfo()
+ }
return
}
diff --git a/vendor/golang.org/x/sys/cpu/endian_big.go b/vendor/golang.org/x/sys/cpu/endian_big.go
new file mode 100644
index 000000000..93ce03a34
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/endian_big.go
@@ -0,0 +1,11 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
+// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
+
+package cpu
+
+// IsBigEndian records whether the GOARCH's byte order is big endian.
+const IsBigEndian = true
diff --git a/vendor/golang.org/x/sys/cpu/endian_little.go b/vendor/golang.org/x/sys/cpu/endian_little.go
new file mode 100644
index 000000000..fe545966b
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/endian_little.go
@@ -0,0 +1,11 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
+// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
+
+package cpu
+
+// IsBigEndian records whether the GOARCH's byte order is big endian.
+const IsBigEndian = false
diff --git a/vendor/golang.org/x/sys/cpu/parse.go b/vendor/golang.org/x/sys/cpu/parse.go
new file mode 100644
index 000000000..762b63d68
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/parse.go
@@ -0,0 +1,43 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+import "strconv"
+
+// parseRelease parses a dot-separated version number. It follows the semver
+// syntax, but allows the minor and patch versions to be elided.
+//
+// This is a copy of the Go runtime's parseRelease from
+// https://golang.org/cl/209597.
+func parseRelease(rel string) (major, minor, patch int, ok bool) {
+ // Strip anything after a dash or plus.
+ for i := 0; i < len(rel); i++ {
+ if rel[i] == '-' || rel[i] == '+' {
+ rel = rel[:i]
+ break
+ }
+ }
+
+ next := func() (int, bool) {
+ for i := 0; i < len(rel); i++ {
+ if rel[i] == '.' {
+ ver, err := strconv.Atoi(rel[:i])
+ rel = rel[i+1:]
+ return ver, err == nil
+ }
+ }
+ ver, err := strconv.Atoi(rel)
+ rel = ""
+ return ver, err == nil
+ }
+ if major, ok = next(); !ok || rel == "" {
+ return
+ }
+ if minor, ok = next(); !ok || rel == "" {
+ return
+ }
+ patch, ok = next()
+ return
+}
diff --git a/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go
new file mode 100644
index 000000000..d87bd6b3e
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go
@@ -0,0 +1,54 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build linux && arm64
+// +build linux,arm64
+
+package cpu
+
+import (
+ "errors"
+ "io"
+ "os"
+ "strings"
+)
+
+func readLinuxProcCPUInfo() error {
+ f, err := os.Open("/proc/cpuinfo")
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+
+ var buf [1 << 10]byte // enough for first CPU
+ n, err := io.ReadFull(f, buf[:])
+ if err != nil && err != io.ErrUnexpectedEOF {
+ return err
+ }
+ in := string(buf[:n])
+ const features = "\nFeatures : "
+ i := strings.Index(in, features)
+ if i == -1 {
+ return errors.New("no CPU features found")
+ }
+ in = in[i+len(features):]
+ if i := strings.Index(in, "\n"); i != -1 {
+ in = in[:i]
+ }
+ m := map[string]*bool{}
+
+ initOptions() // need it early here; it's harmless to call twice
+ for _, o := range options {
+ m[o.Name] = o.Feature
+ }
+ // The EVTSTRM field has alias "evstrm" in Go, but Linux calls it "evtstrm".
+ m["evtstrm"] = &ARM64.HasEVTSTRM
+
+ for _, f := range strings.Fields(in) {
+ if p, ok := m[f]; ok {
+ *p = true
+ }
+ }
+ return nil
+}
diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go
index 0dee23222..b06f52d74 100644
--- a/vendor/golang.org/x/sys/unix/gccgo.go
+++ b/vendor/golang.org/x/sys/unix/gccgo.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gccgo && !aix
-// +build gccgo,!aix
+//go:build gccgo && !aix && !hurd
+// +build gccgo,!aix,!hurd
package unix
diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c
index 2cb1fefac..f98a1c542 100644
--- a/vendor/golang.org/x/sys/unix/gccgo_c.c
+++ b/vendor/golang.org/x/sys/unix/gccgo_c.c
@@ -2,8 +2,8 @@
// Use of this source code is governed