aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/syscall_windows.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2024-03-18 15:38:20 +0100
committerQuim Muntal <quimmuntal@gmail.com>2024-03-18 17:06:46 +0000
commitdda4b17ee4866a32a7d0b522f9a366cb6d687ce1 (patch)
treeac9d12202ef24b37c5b0daba7337ee58e3925264 /src/runtime/syscall_windows.go
parentaf0ebdd4c1ab7c58bcb131d51571ef6bc7250fed (diff)
downloadgo-dda4b17ee4866a32a7d0b522f9a366cb6d687ce1.tar.xz
runtime: remove nosplit directives from several Windows syscall helpers
Some of the Windows syscall helpers don't need to be nosplit. Removing this directive will allow to add instrumentation to these functions without having to worry about the stack size. Change-Id: I3885621f23733af48563803c704563474010b8d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/572415 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/syscall_windows.go')
-rw-r--r--src/runtime/syscall_windows.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/runtime/syscall_windows.go b/src/runtime/syscall_windows.go
index 7abaea11c8..0b08583563 100644
--- a/src/runtime/syscall_windows.go
+++ b/src/runtime/syscall_windows.go
@@ -414,10 +414,8 @@ func callbackWrap(a *callbackArgs) {
const _LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800
//go:linkname syscall_loadsystemlibrary syscall.loadsystemlibrary
-//go:nosplit
func syscall_loadsystemlibrary(filename *uint16) (handle, err uintptr) {
- fn := getLoadLibraryEx()
- handle, _, err = syscall_SyscallN(fn, uintptr(unsafe.Pointer(filename)), 0, _LOAD_LIBRARY_SEARCH_SYSTEM32)
+ handle, _, err = syscall_SyscallN(uintptr(unsafe.Pointer(_LoadLibraryExW)), uintptr(unsafe.Pointer(filename)), 0, _LOAD_LIBRARY_SEARCH_SYSTEM32)
KeepAlive(filename)
if handle != 0 {
err = 0
@@ -426,10 +424,8 @@ func syscall_loadsystemlibrary(filename *uint16) (handle, err uintptr) {
}
//go:linkname syscall_loadlibrary syscall.loadlibrary
-//go:nosplit
func syscall_loadlibrary(filename *uint16) (handle, err uintptr) {
- fn := getLoadLibrary()
- handle, _, err = syscall_SyscallN(fn, uintptr(unsafe.Pointer(filename)))
+ handle, _, err = syscall_SyscallN(uintptr(unsafe.Pointer(_LoadLibraryW)), uintptr(unsafe.Pointer(filename)))
KeepAlive(filename)
if handle != 0 {
err = 0
@@ -438,10 +434,8 @@ func syscall_loadlibrary(filename *uint16) (handle, err uintptr) {
}
//go:linkname syscall_getprocaddress syscall.getprocaddress
-//go:nosplit
func syscall_getprocaddress(handle uintptr, procname *byte) (outhandle, err uintptr) {
- fn := getGetProcAddress()
- outhandle, _, err = syscall_SyscallN(fn, handle, uintptr(unsafe.Pointer(procname)))
+ outhandle, _, err = syscall_SyscallN(uintptr(unsafe.Pointer(_GetProcAddress)), handle, uintptr(unsafe.Pointer(procname)))
KeepAlive(procname)
if outhandle != 0 {
err = 0