aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-02-19 11:56:01 -0800
committerRobert Griesemer <gri@golang.org>2021-02-19 11:56:04 -0800
commit7cdfa4969a5a13cd4b81daa2acad7574a14dfb2e (patch)
tree3a41635aa3c11fb75f6b25599804a1dc38736812 /src/syscall
parent6521c7b3786a69bc6ad3840ef2e3ba2088ad1cae (diff)
parent06b86e98031aacdd6f0499799cc4f50200ecfd18 (diff)
downloadgo-7cdfa4969a5a13cd4b81daa2acad7574a14dfb2e.tar.xz
[dev.typeparams] all: merge master (06b86e9) into dev.typeparams
Merge List: + 2021-02-19 06b86e9803 cmd/compile: fix check to avoid creating new closure function when typechecking inline body + 2021-02-19 9322eec8a2 codereview.cfg: add codereview.cfg for master branch + 2021-02-19 02e5a8fdfc runtime: ignore SPWRITE in syscall functions + 2021-02-19 fa18f224c3 runtime/pprof: disable TestMorestack on macOS under race detector + 2021-02-19 01eb70e3dd os: fix hex exit code print on 32-bit windows + 2021-02-19 49add6ad90 runtime: fix spurious stack overflow detection + 2021-02-19 fce2a94d84 cmd/compile: fix buglet in inlined info abstract function dwarf-gen + 2021-02-19 7764ee5614 runtime: fix invalid nil g check for for mips64x + 2021-02-19 87f425da14 cmd/go/internal/mvs: split Reqs into narrower per-function interfaces + 2021-02-19 4da0188c6c cmd/go/internal/modget: split resolveCandidates into two methods + 2021-02-19 5f2e24efb3 cmd/internal/diff: skip over Cygwin warning in diff output + 2021-02-19 ee7038f6a5 net: disable Windows netsh tests when netsh won't run + 2021-02-19 40765ffa95 os/exec: disable failing LookPathTest on windows/arm64 + 2021-02-19 b445d6ea34 runtime/pprof: expect tests to pass on macOS + 2021-02-19 b110a43628 runtime: delete gosave (dead code) + 2021-02-19 474d5f4f4d math: remove most 387 implementations + 2021-02-19 c7c6c113be runtime: convert windows/arm64 assembly + 2021-02-19 3527caa7d6 runtime: initial windows/arm64 implementation files + 2021-02-19 427bd7599d runtime: generate windows/arm64 callback asm + 2021-02-19 f6c4b4bf96 syscall: add windows/arm64 support + 2021-02-19 ac024a0c7b cmd/vendor: get golang.org/x/sys@beda7e5e158 + 2021-02-19 a3b97e7628 test: disable nilptr on windows/arm64 + 2021-02-19 985d087782 cmd/link: add windows/arm64 support + 2021-02-19 95a44d2409 cmd/internal/objfile: recognize Windows ARM64 executables + 2021-02-19 0ca0551f02 debug/pe: recognize arm64 executables + 2021-02-19 0c633125f2 cmd/dist: add windows/arm64 support + 2021-02-19 bb6efb9609 build: set GOPATH consistently in run.bash, run.bat, run.rc + 2021-02-19 a1222b7535 cmd/link: add debug print in deadcode + 2021-02-19 1c659f2525 cmd/link: clean up windows PE generation + 2021-02-19 b6379f190b syscall: clean up windows a bit + 2021-02-19 09e059afb1 runtime: enable framepointer on all arm64 + 2021-02-19 b19e7b518e runtime: clean up windows a bit + 2021-02-19 5421c37a1d runtime: fix windows/arm externalthreadhandler + 2021-02-19 91cc484ea9 runtime: fix time on windows/arm under WINE + 2021-02-19 38672d3dcf runtime: crash earlier on windows for runtime.abort + 2021-02-19 a1e9148e3d runtime: print hex numbers with hex prefixes in traceback debug + 2021-02-19 75e273fc2c runtime: fix windows/arm CONTEXT_CONTROL + 2021-02-19 76ab626bfc runtime: factor common code out of defs_windows_*.go + 2021-02-19 ece954d8b8 runtime: find g in Windows profiler using SP + 2021-02-19 a54f7fc0fd runtime: do not treat asmcgocall as a topofstack on g0 + 2021-02-19 776ee4079a runtime: do not treat morestack as a topofstack + 2021-02-19 5ecd9e34df runtime: do not treat mcall as a topofstack + 2021-02-19 54da3ab385 runtime: use TOPFRAME to identify top-of-frame functions + 2021-02-19 fbe74dbf42 runtime: use FuncInfo SPWRITE flag to identify untraceable profile samples + 2021-02-19 4dd77bdc91 cmd/asm, cmd/link, runtime: introduce FuncInfo flag bits + 2021-02-19 aa0388f2ed runtime: remove unnecessary writes to gp.sched.g + 2021-02-19 6fe8981620 cmd/internal/obj/riscv: fix JMP name<>(SB) + 2021-02-19 01f05d8ff1 runtime: unify asmcgocall and systemstack traceback setup + 2021-02-19 229695a283 runtime: clean up funcID assignment + 2021-02-19 c80da0a33a runtime: handle nil gp in cpuprof + 2021-02-19 a78879ac67 runtime: move sys.DefaultGoroot to runtime.defaultGOROOT + 2021-02-19 8ac23a1f15 runtime: document, clean up internal/sys + 2021-02-19 678568a5cf runtime: delete windows setlasterror (unused) + 2021-02-19 0d94f989d1 runtime: clean up system calls during cgo callback init + 2021-02-19 e7ee3c1fa8 os: report Windows exit status in hex Change-Id: Ib27e232dabac0604b588f27749bd8ad45a281fe3
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/syscall_windows.go27
-rw-r--r--src/syscall/syscall_windows_386.go5
-rw-r--r--src/syscall/syscall_windows_amd64.go5
-rw-r--r--src/syscall/types_windows_arm64.go22
-rw-r--r--src/syscall/zerrors_windows_386.go5
-rw-r--r--src/syscall/zerrors_windows_amd64.go5
-rw-r--r--src/syscall/zsysnum_windows_386.go3
-rw-r--r--src/syscall/zsysnum_windows_amd64.go3
8 files changed, 37 insertions, 38 deletions
diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go
index ba69133d81..4a576486d1 100644
--- a/src/syscall/syscall_windows.go
+++ b/src/syscall/syscall_windows.go
@@ -414,19 +414,22 @@ const ptrSize = unsafe.Sizeof(uintptr(0))
// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542(v=vs.85).aspx
func setFilePointerEx(handle Handle, distToMove int64, newFilePointer *int64, whence uint32) error {
var e1 Errno
- switch runtime.GOARCH {
- default:
- panic("unsupported architecture")
- case "amd64":
+ if unsafe.Sizeof(uintptr(0)) == 8 {
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 4, uintptr(handle), uintptr(distToMove), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0, 0)
- case "386":
- // distToMove is a LARGE_INTEGER:
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx
- _, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
- case "arm":
- // distToMove must be 8-byte aligned per ARM calling convention
- // https://msdn.microsoft.com/en-us/library/dn736986.aspx#Anchor_7
- _, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 6, uintptr(handle), 0, uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence))
+ } else {
+ // Different 32-bit systems disgaree about whether distToMove starts 8-byte aligned.
+ switch runtime.GOARCH {
+ default:
+ panic("unsupported 32-bit architecture")
+ case "386":
+ // distToMove is a LARGE_INTEGER:
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx
+ _, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
+ case "arm":
+ // distToMove must be 8-byte aligned per ARM calling convention
+ // https://msdn.microsoft.com/en-us/library/dn736986.aspx#Anchor_7
+ _, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 6, uintptr(handle), 0, uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence))
+ }
}
if e1 != 0 {
return errnoErr(e1)
diff --git a/src/syscall/syscall_windows_386.go b/src/syscall/syscall_windows_386.go
deleted file mode 100644
index e82b540b4b..0000000000
--- a/src/syscall/syscall_windows_386.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2009 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 syscall
diff --git a/src/syscall/syscall_windows_amd64.go b/src/syscall/syscall_windows_amd64.go
deleted file mode 100644
index e82b540b4b..0000000000
--- a/src/syscall/syscall_windows_amd64.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2009 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 syscall
diff --git a/src/syscall/types_windows_arm64.go b/src/syscall/types_windows_arm64.go
new file mode 100644
index 0000000000..7d45ddbc0b
--- /dev/null
+++ b/src/syscall/types_windows_arm64.go
@@ -0,0 +1,22 @@
+// Copyright 2011 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 syscall
+
+type WSAData struct {
+ Version uint16
+ HighVersion uint16
+ MaxSockets uint16
+ MaxUdpDg uint16
+ VendorInfo *byte
+ Description [WSADESCRIPTION_LEN + 1]byte
+ SystemStatus [WSASYS_STATUS_LEN + 1]byte
+}
+
+type Servent struct {
+ Name *byte
+ Aliases **byte
+ Proto *byte
+ Port uint16
+}
diff --git a/src/syscall/zerrors_windows_386.go b/src/syscall/zerrors_windows_386.go
deleted file mode 100644
index 8bc5b6b194..0000000000
--- a/src/syscall/zerrors_windows_386.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2011 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 syscall
diff --git a/src/syscall/zerrors_windows_amd64.go b/src/syscall/zerrors_windows_amd64.go
deleted file mode 100644
index 8bc5b6b194..0000000000
--- a/src/syscall/zerrors_windows_amd64.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2011 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 syscall
diff --git a/src/syscall/zsysnum_windows_386.go b/src/syscall/zsysnum_windows_386.go
deleted file mode 100644
index 36bf065d1f..0000000000
--- a/src/syscall/zsysnum_windows_386.go
+++ /dev/null
@@ -1,3 +0,0 @@
-// nothing to see here
-
-package syscall
diff --git a/src/syscall/zsysnum_windows_amd64.go b/src/syscall/zsysnum_windows_amd64.go
deleted file mode 100644
index 36bf065d1f..0000000000
--- a/src/syscall/zsysnum_windows_amd64.go
+++ /dev/null
@@ -1,3 +0,0 @@
-// nothing to see here
-
-package syscall