Browse Source

add forgotten x/sys vendor files

tags/v2.2.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
69b4d93079

+ 34
- 0
vendor/golang.org/x/sys/cpu/cpu_aix.go View File

@@ -0,0 +1,34 @@
1
+// Copyright 2019 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
+// +build aix
6
+
7
+package cpu
8
+
9
+const cacheLineSize = 128
10
+
11
+const (
12
+	// getsystemcfg constants
13
+	_SC_IMPL     = 2
14
+	_IMPL_POWER8 = 0x10000
15
+	_IMPL_POWER9 = 0x20000
16
+)
17
+
18
+func init() {
19
+	impl := getsystemcfg(_SC_IMPL)
20
+	if impl&_IMPL_POWER8 != 0 {
21
+		PPC64.IsPOWER8 = true
22
+	}
23
+	if impl&_IMPL_POWER9 != 0 {
24
+		PPC64.IsPOWER9 = true
25
+	}
26
+
27
+	Initialized = true
28
+}
29
+
30
+func getsystemcfg(label int) (n uint64) {
31
+	r0, _ := callgetsystemcfg(label)
32
+	n = uint64(r0)
33
+	return
34
+}

+ 144
- 0
vendor/golang.org/x/sys/cpu/cpu_arm64.go View File

@@ -0,0 +1,144 @@
1
+// Copyright 2019 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
+package cpu
6
+
7
+import "runtime"
8
+
9
+const cacheLineSize = 64
10
+
11
+func init() {
12
+	switch runtime.GOOS {
13
+	case "android", "darwin", "netbsd":
14
+		// Android and iOS don't seem to allow reading these registers.
15
+		//
16
+		// NetBSD:
17
+		// ID_AA64ISAR0_EL1 is a privileged register and cannot be read from EL0.
18
+		// It can be read via sysctl(3). Example for future implementers:
19
+		// https://nxr.netbsd.org/xref/src/usr.sbin/cpuctl/arch/aarch64.c
20
+		//
21
+		// Fake the minimal features expected by
22
+		// TestARM64minimalFeatures.
23
+		ARM64.HasASIMD = true
24
+		ARM64.HasFP = true
25
+	case "linux":
26
+		doinit()
27
+	default:
28
+		readARM64Registers()
29
+	}
30
+}
31
+
32
+func readARM64Registers() {
33
+	Initialized = true
34
+
35
+	// ID_AA64ISAR0_EL1
36
+	isar0 := getisar0()
37
+
38
+	switch extractBits(isar0, 4, 7) {
39
+	case 1:
40
+		ARM64.HasAES = true
41
+	case 2:
42
+		ARM64.HasAES = true
43
+		ARM64.HasPMULL = true
44
+	}
45
+
46
+	switch extractBits(isar0, 8, 11) {
47
+	case 1:
48
+		ARM64.HasSHA1 = true
49
+	}
50
+
51
+	switch extractBits(isar0, 12, 15) {
52
+	case 1:
53
+		ARM64.HasSHA2 = true
54
+	case 2:
55
+		ARM64.HasSHA2 = true
56
+		ARM64.HasSHA512 = true
57
+	}
58
+
59
+	switch extractBits(isar0, 16, 19) {
60
+	case 1:
61
+		ARM64.HasCRC32 = true
62
+	}
63
+
64
+	switch extractBits(isar0, 20, 23) {
65
+	case 2:
66
+		ARM64.HasATOMICS = true
67
+	}
68
+
69
+	switch extractBits(isar0, 28, 31) {
70
+	case 1:
71
+		ARM64.HasASIMDRDM = true
72
+	}
73
+
74
+	switch extractBits(isar0, 32, 35) {
75
+	case 1:
76
+		ARM64.HasSHA3 = true
77
+	}
78
+
79
+	switch extractBits(isar0, 36, 39) {
80
+	case 1:
81
+		ARM64.HasSM3 = true
82
+	}
83
+
84
+	switch extractBits(isar0, 40, 43) {
85
+	case 1:
86
+		ARM64.HasSM4 = true
87
+	}
88
+
89
+	switch extractBits(isar0, 44, 47) {
90
+	case 1:
91
+		ARM64.HasASIMDDP = true
92
+	}
93
+
94
+	// ID_AA64ISAR1_EL1
95
+	isar1 := getisar1()
96
+
97
+	switch extractBits(isar1, 0, 3) {
98
+	case 1:
99
+		ARM64.HasDCPOP = true
100
+	}
101
+
102
+	switch extractBits(isar1, 12, 15) {
103
+	case 1:
104
+		ARM64.HasJSCVT = true
105
+	}
106
+
107
+	switch extractBits(isar1, 16, 19) {
108
+	case 1:
109
+		ARM64.HasFCMA = true
110
+	}
111
+
112
+	switch extractBits(isar1, 20, 23) {
113
+	case 1:
114
+		ARM64.HasLRCPC = true
115
+	}
116
+
117
+	// ID_AA64PFR0_EL1
118
+	pfr0 := getpfr0()
119
+
120
+	switch extractBits(pfr0, 16, 19) {
121
+	case 0:
122
+		ARM64.HasFP = true
123
+	case 1:
124
+		ARM64.HasFP = true
125
+		ARM64.HasFPHP = true
126
+	}
127
+
128
+	switch extractBits(pfr0, 20, 23) {
129
+	case 0:
130
+		ARM64.HasASIMD = true
131
+	case 1:
132
+		ARM64.HasASIMD = true
133
+		ARM64.HasASIMDHP = true
134
+	}
135
+
136
+	switch extractBits(pfr0, 32, 35) {
137
+	case 1:
138
+		ARM64.HasSVE = true
139
+	}
140
+}
141
+
142
+func extractBits(data uint64, start, end uint) uint {
143
+	return (uint)(data>>start) & ((1 << (end - start + 1)) - 1)
144
+}

+ 31
- 0
vendor/golang.org/x/sys/cpu/cpu_arm64.s View File

@@ -0,0 +1,31 @@
1
+// Copyright 2019 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
+// +build !gccgo
6
+
7
+#include "textflag.h"
8
+
9
+// func getisar0() uint64
10
+TEXT ·getisar0(SB),NOSPLIT,$0-8
11
+	// get Instruction Set Attributes 0 into x0
12
+	// mrs x0, ID_AA64ISAR0_EL1 = d5380600
13
+	WORD	$0xd5380600
14
+	MOVD	R0, ret+0(FP)
15
+	RET
16
+
17
+// func getisar1() uint64
18
+TEXT ·getisar1(SB),NOSPLIT,$0-8
19
+	// get Instruction Set Attributes 1 into x0
20
+	// mrs x0, ID_AA64ISAR1_EL1 = d5380620
21
+	WORD	$0xd5380620
22
+	MOVD	R0, ret+0(FP)
23
+	RET
24
+
25
+// func getpfr0() uint64
26
+TEXT ·getpfr0(SB),NOSPLIT,$0-8
27
+	// get Processor Feature Register 0 into x0
28
+	// mrs x0, ID_AA64PFR0_EL1 = d5380400
29
+	WORD	$0xd5380400
30
+	MOVD	R0, ret+0(FP)
31
+	RET

+ 11
- 0
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go View File

@@ -0,0 +1,11 @@
1
+// Copyright 2019 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
+// +build !gccgo
6
+
7
+package cpu
8
+
9
+func getisar0() uint64
10
+func getisar1() uint64
11
+func getpfr0() uint64

+ 11
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go View File

@@ -0,0 +1,11 @@
1
+// Copyright 2019 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
+// +build gccgo
6
+
7
+package cpu
8
+
9
+func getisar0() uint64 { return 0 }
10
+func getisar1() uint64 { return 0 }
11
+func getpfr0() uint64  { return 0 }

+ 43
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c View File

@@ -0,0 +1,43 @@
1
+// Copyright 2018 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
+// +build 386 amd64 amd64p32
6
+// +build gccgo
7
+
8
+#include <cpuid.h>
9
+#include <stdint.h>
10
+
11
+// Need to wrap __get_cpuid_count because it's declared as static.
12
+int
13
+gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf,
14
+                   uint32_t *eax, uint32_t *ebx,
15
+                   uint32_t *ecx, uint32_t *edx)
16
+{
17
+	return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
18
+}
19
+
20
+// xgetbv reads the contents of an XCR (Extended Control Register)
21
+// specified in the ECX register into registers EDX:EAX.
22
+// Currently, the only supported value for XCR is 0.
23
+//
24
+// TODO: Replace with a better alternative:
25
+//
26
+//     #include <xsaveintrin.h>
27
+//
28
+//     #pragma GCC target("xsave")
29
+//
30
+//     void gccgoXgetbv(uint32_t *eax, uint32_t *edx) {
31
+//       unsigned long long x = _xgetbv(0);
32
+//       *eax = x & 0xffffffff;
33
+//       *edx = (x >> 32) & 0xffffffff;
34
+//     }
35
+//
36
+// Note that _xgetbv is defined starting with GCC 8.
37
+void
38
+gccgoXgetbv(uint32_t *eax, uint32_t *edx)
39
+{
40
+	__asm("  xorl %%ecx, %%ecx\n"
41
+	      "  xgetbv"
42
+	    : "=a"(*eax), "=d"(*edx));
43
+}

+ 26
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go View File

@@ -0,0 +1,26 @@
1
+// Copyright 2018 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
+// +build 386 amd64 amd64p32
6
+// +build gccgo
7
+
8
+package cpu
9
+
10
+//extern gccgoGetCpuidCount
11
+func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32)
12
+
13
+func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) {
14
+	var a, b, c, d uint32
15
+	gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d)
16
+	return a, b, c, d
17
+}
18
+
19
+//extern gccgoXgetbv
20
+func gccgoXgetbv(eax, edx *uint32)
21
+
22
+func xgetbv() (eax, edx uint32) {
23
+	var a, d uint32
24
+	gccgoXgetbv(&a, &d)
25
+	return a, d
26
+}

+ 22
- 0
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go View File

@@ -0,0 +1,22 @@
1
+// Copyright 2020 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
+// +build mips64 mips64le
6
+
7
+package cpu
8
+
9
+// HWCAP bits. These are exposed by the Linux kernel 5.4.
10
+const (
11
+	// CPU features
12
+	hwcap_MIPS_MSA = 1 << 1
13
+)
14
+
15
+func doinit() {
16
+	// HWCAP feature bits
17
+	MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA)
18
+}
19
+
20
+func isSet(hwc uint, value uint) bool {
21
+	return hwc&value != 0
22
+}

+ 56
- 0
vendor/golang.org/x/sys/cpu/hwcap_linux.go View File

@@ -0,0 +1,56 @@
1
+// Copyright 2019 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
+package cpu
6
+
7
+import (
8
+	"io/ioutil"
9
+)
10
+
11
+const (
12
+	_AT_HWCAP  = 16
13
+	_AT_HWCAP2 = 26
14
+
15
+	procAuxv = "/proc/self/auxv"
16
+
17
+	uintSize = int(32 << (^uint(0) >> 63))
18
+)
19
+
20
+// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2
21
+// These are initialized in cpu_$GOARCH.go
22
+// and should not be changed after they are initialized.
23
+var hwCap uint
24
+var hwCap2 uint
25
+
26
+func readHWCAP() error {
27
+	buf, err := ioutil.ReadFile(procAuxv)
28
+	if err != nil {
29
+		// e.g. on android /proc/self/auxv is not accessible, so silently
30
+		// ignore the error and leave Initialized = false. On some
31
+		// architectures (e.g. arm64) doinit() implements a fallback
32
+		// readout and will set Initialized = true again.
33
+		return err
34
+	}
35
+	bo := hostByteOrder()
36
+	for len(buf) >= 2*(uintSize/8) {
37
+		var tag, val uint
38
+		switch uintSize {
39
+		case 32:
40
+			tag = uint(bo.Uint32(buf[0:]))
41
+			val = uint(bo.Uint32(buf[4:]))
42
+			buf = buf[8:]
43
+		case 64:
44
+			tag = uint(bo.Uint64(buf[0:]))
45
+			val = uint(bo.Uint64(buf[8:]))
46
+			buf = buf[16:]
47
+		}
48
+		switch tag {
49
+		case _AT_HWCAP:
50
+			hwCap = val
51
+		case _AT_HWCAP2:
52
+			hwCap2 = val
53
+		}
54
+	}
55
+	return nil
56
+}

+ 27
- 0
vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go View File

@@ -0,0 +1,27 @@
1
+// Copyright 2020 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
+// Recreate a getsystemcfg syscall handler instead of
6
+// using the one provided by x/sys/unix to avoid having
7
+// the dependency between them. (See golang.org/issue/32102)
8
+// Morever, this file will be used during the building of
9
+// gccgo's libgo and thus must not used a CGo method.
10
+
11
+// +build aix
12
+// +build gccgo
13
+
14
+package cpu
15
+
16
+import (
17
+	"syscall"
18
+)
19
+
20
+//extern getsystemcfg
21
+func gccgoGetsystemcfg(label uint32) (r uint64)
22
+
23
+func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) {
24
+	r1 = uintptr(gccgoGetsystemcfg(uint32(label)))
25
+	e1 = syscall.GetErrno()
26
+	return
27
+}

+ 30
- 0
vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go View File

@@ -0,0 +1,30 @@
1
+// Copyright 2020 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
+// Package unsafeheader contains header declarations for the Go runtime's
6
+// slice and string implementations.
7
+//
8
+// This package allows x/sys to use types equivalent to
9
+// reflect.SliceHeader and reflect.StringHeader without introducing
10
+// a dependency on the (relatively heavy) "reflect" package.
11
+package unsafeheader
12
+
13
+import (
14
+	"unsafe"
15
+)
16
+
17
+// Slice is the runtime representation of a slice.
18
+// It cannot be used safely or portably and its representation may change in a later release.
19
+type Slice struct {
20
+	Data unsafe.Pointer
21
+	Len  int
22
+	Cap  int
23
+}
24
+
25
+// String is the runtime representation of a string.
26
+// It cannot be used safely or portably and its representation may change in a later release.
27
+type String struct {
28
+	Data unsafe.Pointer
29
+	Len  int
30
+}

+ 17
- 0
vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go View File

@@ -0,0 +1,17 @@
1
+// Copyright 2020 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
+// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
6
+// them here for backwards compatibility.
7
+
8
+package unix
9
+
10
+const (
11
+	DLT_HHDLC            = 0x79
12
+	IPV6_MIN_MEMBERSHIPS = 0x1f
13
+	IP_MAX_SOURCE_FILTER = 0x400
14
+	IP_MIN_MEMBERSHIPS   = 0x1f
15
+	RT_CACHING_CONTEXT   = 0x1
16
+	RT_NORTREF           = 0x2
17
+)

+ 57
- 0
vendor/golang.org/x/sys/unix/syscall_illumos.go View File

@@ -0,0 +1,57 @@
1
+// Copyright 2009 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
+// illumos system calls not present on Solaris.
6
+
7
+// +build amd64,illumos
8
+
9
+package unix
10
+
11
+import "unsafe"
12
+
13
+func bytes2iovec(bs [][]byte) []Iovec {
14
+	iovecs := make([]Iovec, len(bs))
15
+	for i, b := range bs {
16
+		iovecs[i].SetLen(len(b))
17
+		if len(b) > 0 {
18
+			// somehow Iovec.Base on illumos is (*int8), not (*byte)
19
+			iovecs[i].Base = (*int8)(unsafe.Pointer(&b[0]))
20
+		} else {
21
+			iovecs[i].Base = (*int8)(unsafe.Pointer(&_zero))
22
+		}
23
+	}
24
+	return iovecs
25
+}
26
+
27
+//sys   readv(fd int, iovs []Iovec) (n int, err error)
28
+
29
+func Readv(fd int, iovs [][]byte) (n int, err error) {
30
+	iovecs := bytes2iovec(iovs)
31
+	n, err = readv(fd, iovecs)
32
+	return n, err
33
+}
34
+
35
+//sys   preadv(fd int, iovs []Iovec, off int64) (n int, err error)
36
+
37
+func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) {
38
+	iovecs := bytes2iovec(iovs)
39
+	n, err = preadv(fd, iovecs, off)
40
+	return n, err
41
+}
42
+
43
+//sys   writev(fd int, iovs []Iovec) (n int, err error)
44
+
45
+func Writev(fd int, iovs [][]byte) (n int, err error) {
46
+	iovecs := bytes2iovec(iovs)
47
+	n, err = writev(fd, iovecs)
48
+	return n, err
49
+}
50
+
51
+//sys   pwritev(fd int, iovs []Iovec, off int64) (n int, err error)
52
+
53
+func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) {
54
+	iovecs := bytes2iovec(iovs)
55
+	n, err = pwritev(fd, iovecs, off)
56
+	return n, err
57
+}

+ 2471
- 0
vendor/golang.org/x/sys/unix/zerrors_linux.go
File diff suppressed because it is too large
View File


+ 41
- 0
vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go View File

@@ -0,0 +1,41 @@
1
+// Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT.
2
+
3
+// +build linux
4
+// +build arm arm64
5
+
6
+package unix
7
+
8
+import "unsafe"
9
+
10
+// PtraceRegsArm is the registers used by arm binaries.
11
+type PtraceRegsArm struct {
12
+	Uregs [18]uint32
13
+}
14
+
15
+// PtraceGetRegsArm fetches the registers used by arm binaries.
16
+func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
17
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
18
+}
19
+
20
+// PtraceSetRegsArm sets the registers used by arm binaries.
21
+func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
22
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
23
+}
24
+
25
+// PtraceRegsArm64 is the registers used by arm64 binaries.
26
+type PtraceRegsArm64 struct {
27
+	Regs   [31]uint64
28
+	Sp     uint64
29
+	Pc     uint64
30
+	Pstate uint64
31
+}
32
+
33
+// PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
34
+func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
35
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
36
+}
37
+
38
+// PtraceSetRegsArm64 sets the registers used by arm64 binaries.
39
+func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
40
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
41
+}

+ 17
- 0
vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go View File

@@ -0,0 +1,17 @@
1
+// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
2
+
3
+package unix
4
+
5
+import "unsafe"
6
+
7
+// PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
8
+func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
9
+	iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
10
+	return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
11
+}
12
+
13
+// PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
14
+func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
15
+	iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
16
+	return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
17
+}

+ 50
- 0
vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go View File

@@ -0,0 +1,50 @@
1
+// Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT.
2
+
3
+// +build linux
4
+// +build mips mips64
5
+
6
+package unix
7
+
8
+import "unsafe"
9
+
10
+// PtraceRegsMips is the registers used by mips binaries.
11
+type PtraceRegsMips struct {
12
+	Regs     [32]uint64
13
+	Lo       uint64
14
+	Hi       uint64
15
+	Epc      uint64
16
+	Badvaddr uint64
17
+	Status   uint64
18
+	Cause    uint64
19
+}
20
+
21
+// PtraceGetRegsMips fetches the registers used by mips binaries.
22
+func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
23
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
24
+}
25
+
26
+// PtraceSetRegsMips sets the registers used by mips binaries.
27
+func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
28
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
29
+}
30
+
31
+// PtraceRegsMips64 is the registers used by mips64 binaries.
32
+type PtraceRegsMips64 struct {
33
+	Regs     [32]uint64
34
+	Lo       uint64
35
+	Hi       uint64
36
+	Epc      uint64
37
+	Badvaddr uint64
38
+	Status   uint64
39
+	Cause    uint64
40
+}
41
+
42
+// PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
43
+func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
44
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
45
+}
46
+
47
+// PtraceSetRegsMips64 sets the registers used by mips64 binaries.
48
+func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
49
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
50
+}

+ 50
- 0
vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go View File

@@ -0,0 +1,50 @@
1
+// Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT.
2
+
3
+// +build linux
4
+// +build mipsle mips64le
5
+
6
+package unix
7
+
8
+import "unsafe"
9
+
10
+// PtraceRegsMipsle is the registers used by mipsle binaries.
11
+type PtraceRegsMipsle struct {
12
+	Regs     [32]uint64
13
+	Lo       uint64
14
+	Hi       uint64
15
+	Epc      uint64
16
+	Badvaddr uint64
17
+	Status   uint64
18
+	Cause    uint64
19
+}
20
+
21
+// PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
22
+func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
23
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
24
+}
25
+
26
+// PtraceSetRegsMipsle sets the registers used by mipsle binaries.
27
+func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
28
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
29
+}
30
+
31
+// PtraceRegsMips64le is the registers used by mips64le binaries.
32
+type PtraceRegsMips64le struct {
33
+	Regs     [32]uint64
34
+	Lo       uint64
35
+	Hi       uint64
36
+	Epc      uint64
37
+	Badvaddr uint64
38
+	Status   uint64
39
+	Cause    uint64
40
+}
41
+
42
+// PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
43
+func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
44
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
45
+}
46
+
47
+// PtraceSetRegsMips64le sets the registers used by mips64le binaries.
48
+func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
49
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
50
+}

+ 80
- 0
vendor/golang.org/x/sys/unix/zptrace_x86_linux.go View File

@@ -0,0 +1,80 @@
1
+// Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT.
2
+
3
+// +build linux
4
+// +build 386 amd64
5
+
6
+package unix
7
+
8
+import "unsafe"
9
+
10
+// PtraceRegs386 is the registers used by 386 binaries.
11
+type PtraceRegs386 struct {
12
+	Ebx      int32
13
+	Ecx      int32
14
+	Edx      int32
15
+	Esi      int32
16
+	Edi      int32
17
+	Ebp      int32
18
+	Eax      int32
19
+	Xds      int32
20
+	Xes      int32
21
+	Xfs      int32
22
+	Xgs      int32
23
+	Orig_eax int32
24
+	Eip      int32
25
+	Xcs      int32
26
+	Eflags   int32
27
+	Esp      int32
28
+	Xss      int32
29
+}
30
+
31
+// PtraceGetRegs386 fetches the registers used by 386 binaries.
32
+func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
33
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
34
+}
35
+
36
+// PtraceSetRegs386 sets the registers used by 386 binaries.
37
+func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
38
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
39
+}
40
+
41
+// PtraceRegsAmd64 is the registers used by amd64 binaries.
42
+type PtraceRegsAmd64 struct {
43
+	R15      uint64
44
+	R14      uint64
45
+	R13      uint64
46
+	R12      uint64
47
+	Rbp      uint64
48
+	Rbx      uint64
49
+	R11      uint64
50
+	R10      uint64
51
+	R9       uint64
52
+	R8       uint64
53
+	Rax      uint64
54
+	Rcx      uint64
55
+	Rdx      uint64
56
+	Rsi      uint64
57
+	Rdi      uint64
58
+	Orig_rax uint64
59
+	Rip      uint64
60
+	Cs       uint64
61
+	Eflags   uint64
62
+	Rsp      uint64
63
+	Ss       uint64
64
+	Fs_base  uint64
65
+	Gs_base  uint64
66
+	Ds       uint64
67
+	Es       uint64
68
+	Fs       uint64
69
+	Gs       uint64
70
+}
71
+
72
+// PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
73
+func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
74
+	return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
75
+}
76
+
77
+// PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
78
+func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
79
+	return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
80
+}

+ 87
- 0
vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go View File

@@ -0,0 +1,87 @@
1
+// go run mksyscall_solaris.go -illumos -tags illumos,amd64 syscall_illumos.go
2
+// Code generated by the command above; see README.md. DO NOT EDIT.
3
+
4
+// +build illumos,amd64
5
+
6
+package unix
7
+
8
+import (
9
+	"unsafe"
10
+)
11
+
12
+//go:cgo_import_dynamic libc_readv readv "libc.so"
13
+//go:cgo_import_dynamic libc_preadv preadv "libc.so"
14
+//go:cgo_import_dynamic libc_writev writev "libc.so"
15
+//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
16
+
17
+//go:linkname procreadv libc_readv
18
+//go:linkname procpreadv libc_preadv
19
+//go:linkname procwritev libc_writev
20
+//go:linkname procpwritev libc_pwritev
21
+
22
+var (
23
+	procreadv,
24
+	procpreadv,
25
+	procwritev,
26
+	procpwritev syscallFunc
27
+)
28
+
29
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
30
+
31
+func readv(fd int, iovs []Iovec) (n int, err error) {
32
+	var _p0 *Iovec
33
+	if len(iovs) > 0 {
34
+		_p0 = &iovs[0]
35
+	}
36
+	r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procreadv)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
37
+	n = int(r0)
38
+	if e1 != 0 {
39
+		err = e1
40
+	}
41
+	return
42
+}
43
+
44
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
45
+
46
+func preadv(fd int, iovs []Iovec, off int64) (n int, err error) {
47
+	var _p0 *Iovec
48
+	if len(iovs) > 0 {
49
+		_p0 = &iovs[0]
50
+	}
51
+	r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpreadv)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
52
+	n = int(r0)
53
+	if e1 != 0 {
54
+		err = e1
55
+	}
56
+	return
57
+}
58
+
59
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
60
+
61
+func writev(fd int, iovs []Iovec) (n int, err error) {
62
+	var _p0 *Iovec
63
+	if len(iovs) > 0 {
64
+		_p0 = &iovs[0]
65
+	}
66
+	r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwritev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
67
+	n = int(r0)
68
+	if e1 != 0 {
69
+		err = e1
70
+	}
71
+	return
72
+}
73
+
74
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
75
+
76
+func pwritev(fd int, iovs []Iovec, off int64) (n int, err error) {
77
+	var _p0 *Iovec
78
+	if len(iovs) > 0 {
79
+		_p0 = &iovs[0]
80
+	}
81
+	r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwritev)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
82
+	n = int(r0)
83
+	if e1 != 0 {
84
+		err = e1
85
+	}
86
+	return
87
+}

+ 1856
- 0
vendor/golang.org/x/sys/unix/zsyscall_linux.go
File diff suppressed because it is too large
View File


+ 2345
- 0
vendor/golang.org/x/sys/unix/ztypes_linux.go
File diff suppressed because it is too large
View File


Loading…
Cancel
Save