summaryrefslogtreecommitdiff
path: root/libgo/go/golang.org
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-09-10 20:41:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-09-10 20:41:04 +0000
commitefc864927f57fa1a4aa8d1f22e4071343f0b8cbb (patch)
tree459ff147fd2603203e17c2a17dca1291399fbb51 /libgo/go/golang.org
parent4d7bfeec428c5bfd005bb6028221c22e5a8abcdf (diff)
downloadgcc-efc864927f57fa1a4aa8d1f22e4071343f0b8cbb.tar.gz
libgo: Solaris and x/sys/cpu compatibility fixes
Restore Solaris compatibility fixes lost when internal/x/net/lif moved to golang.org/x/net/lif. Also fix the Makefile for x/net/lif and x/net/route. Change x/sys/cpu to get the cache line size from goarch.sh as the gofrontend version of internal/cpu does. Partially based on work by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194438 From-SVN: r275611
Diffstat (limited to 'libgo/go/golang.org')
-rw-r--r--libgo/go/golang.org/x/net/lif/syscall.go14
-rw-r--r--libgo/go/golang.org/x/net/lif/zsys_solaris.go (renamed from libgo/go/golang.org/x/net/lif/zsys_solaris_amd64.go)8
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_aix_ppc64.go2
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_arm.go9
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_linux_arm64.go2
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_linux_ppc64x.go2
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_linux_s390x.go2
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_mips64x.go11
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_mipsx.go11
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_other_arm64.go11
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_wasm.go15
-rw-r--r--libgo/go/golang.org/x/sys/cpu/cpu_x86.go2
12 files changed, 7 insertions, 82 deletions
diff --git a/libgo/go/golang.org/x/net/lif/syscall.go b/libgo/go/golang.org/x/net/lif/syscall.go
index aadab2e14ba..ea7541456bd 100644
--- a/libgo/go/golang.org/x/net/lif/syscall.go
+++ b/libgo/go/golang.org/x/net/lif/syscall.go
@@ -11,18 +11,12 @@ import (
"unsafe"
)
-//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
-
-//go:linkname procIoctl libc_ioctl
-
-var procIoctl uintptr
-
-func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno)
+//extern __go_ioctl_ptr
+func libc_ioctl(int32, int32, unsafe.Pointer) int32
func ioctl(s, ioc uintptr, arg unsafe.Pointer) error {
- _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procIoctl)), 3, s, ioc, uintptr(arg), 0, 0, 0)
- if errno != 0 {
- return error(errno)
+ if libc_ioctl(int32(s), int32(ioc), arg) < 0 {
+ return syscall.GetErrno()
}
return nil
}
diff --git a/libgo/go/golang.org/x/net/lif/zsys_solaris_amd64.go b/libgo/go/golang.org/x/net/lif/zsys_solaris.go
index b5e999bec3a..0d9ed2f821a 100644
--- a/libgo/go/golang.org/x/net/lif/zsys_solaris_amd64.go
+++ b/libgo/go/golang.org/x/net/lif/zsys_solaris.go
@@ -3,6 +3,8 @@
package lif
+import "unsafe"
+
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
@@ -67,7 +69,6 @@ const (
type lifnum struct {
Family uint16
- Pad_cgo_0 [2]byte
Flags int32
Count int32
}
@@ -81,16 +82,13 @@ type lifreq struct {
type lifconf struct {
Family uint16
- Pad_cgo_0 [2]byte
Flags int32
Len int32
- Pad_cgo_1 [4]byte
- Lifcu [8]byte
+ Lifcu [unsafe.Sizeof(unsafe.Pointer(nil))]byte
}
type lifIfinfoReq struct {
Maxhops uint8
- Pad_cgo_0 [3]byte
Reachtime uint32
Reachretrans uint32
Maxmtu uint32
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_aix_ppc64.go b/libgo/go/golang.org/x/sys/cpu/cpu_aix_ppc64.go
index be602722472..b0ede112d4e 100644
--- a/libgo/go/golang.org/x/sys/cpu/cpu_aix_ppc64.go
+++ b/libgo/go/golang.org/x/sys/cpu/cpu_aix_ppc64.go
@@ -6,8 +6,6 @@
package cpu
-const cacheLineSize = 128
-
const (
// getsystemcfg constants
_SC_IMPL = 2
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_arm.go b/libgo/go/golang.org/x/sys/cpu/cpu_arm.go
deleted file mode 100644
index 7f2348b7d4b..00000000000
--- a/libgo/go/golang.org/x/sys/cpu/cpu_arm.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2018 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
-
-const cacheLineSize = 32
-
-func doinit() {}
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_linux_arm64.go b/libgo/go/golang.org/x/sys/cpu/cpu_linux_arm64.go
index fa7fb1bd7b2..15a9b4a7cc7 100644
--- a/libgo/go/golang.org/x/sys/cpu/cpu_linux_arm64.go
+++ b/libgo/go/golang.org/x/sys/cpu/cpu_linux_arm64.go
@@ -4,8 +4,6 @@
package cpu
-const cacheLineSize = 64
-
// HWCAP/HWCAP2 bits. These are exposed by Linux.
const (
hwcap_FP = 1 << 0
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/libgo/go/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
index 6c8d975d40a..99f8a6399ef 100644
--- a/libgo/go/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
+++ b/libgo/go/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
@@ -7,8 +7,6 @@
package cpu
-const cacheLineSize = 128
-
// HWCAP/HWCAP2 bits. These are exposed by the kernel.
const (
// ISA Level
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_linux_s390x.go b/libgo/go/golang.org/x/sys/cpu/cpu_linux_s390x.go
index d579eaef404..b88d6b8f662 100644
--- a/libgo/go/golang.org/x/sys/cpu/cpu_linux_s390x.go
+++ b/libgo/go/golang.org/x/sys/cpu/cpu_linux_s390x.go
@@ -4,8 +4,6 @@
package cpu
-const cacheLineSize = 256
-
const (
// bit mask values from /usr/include/bits/hwcap.h
hwcap_ZARCH = 2
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_mips64x.go b/libgo/go/golang.org/x/sys/cpu/cpu_mips64x.go
deleted file mode 100644
index f55e0c82c73..00000000000
--- a/libgo/go/golang.org/x/sys/cpu/cpu_mips64x.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018 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.
-
-// +build mips64 mips64le
-
-package cpu
-
-const cacheLineSize = 32
-
-func doinit() {}
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_mipsx.go b/libgo/go/golang.org/x/sys/cpu/cpu_mipsx.go
deleted file mode 100644
index cda87b1a1b1..00000000000
--- a/libgo/go/golang.org/x/sys/cpu/cpu_mipsx.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018 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.
-
-// +build mips mipsle
-
-package cpu
-
-const cacheLineSize = 32
-
-func doinit() {}
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_other_arm64.go b/libgo/go/golang.org/x/sys/cpu/cpu_other_arm64.go
deleted file mode 100644
index dd1e76dc921..00000000000
--- a/libgo/go/golang.org/x/sys/cpu/cpu_other_arm64.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2019 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.
-
-// +build !linux,arm64
-
-package cpu
-
-const cacheLineSize = 64
-
-func doinit() {}
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_wasm.go b/libgo/go/golang.org/x/sys/cpu/cpu_wasm.go
deleted file mode 100644
index bd9bbda0c08..00000000000
--- a/libgo/go/golang.org/x/sys/cpu/cpu_wasm.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2019 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.
-
-// +build wasm
-
-package cpu
-
-// We're compiling the cpu package for an unknown (software-abstracted) CPU.
-// Make CacheLinePad an empty struct and hope that the usual struct alignment
-// rules are good enough.
-
-const cacheLineSize = 0
-
-func doinit() {}
diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_x86.go b/libgo/go/golang.org/x/sys/cpu/cpu_x86.go
index d70d317f5a4..6009379c7fa 100644
--- a/libgo/go/golang.org/x/sys/cpu/cpu_x86.go
+++ b/libgo/go/golang.org/x/sys/cpu/cpu_x86.go
@@ -6,8 +6,6 @@
package cpu
-const cacheLineSize = 64
-
func init() {
Initialized = true