]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: move libcall to stack for syscall package on aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Wed, 10 Apr 2019 14:29:57 +0000 (16:29 +0200)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 Apr 2019 23:46:21 +0000 (23:46 +0000)
Inside syscall_syscall6 function, libcall can directly be on the stack.
This is first function called with //go:nosplit, unlike runtime syscalls
which can be called during the sigtramp or by others //go:nosplit
functions.

Change-Id: Icc28def1a63e525850ec3bfb8184b995dfeaa736
Reviewed-on: https://go-review.googlesource.com/c/go/+/171338
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/syscall_aix.go

index 7f2bcbe9d95bb4625b52cc69c710fe82a188ac0c..1ed1dfa0bb9651700319e147866f5cfb7b18e868 100644 (file)
@@ -69,11 +69,13 @@ func syscall_RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
 }
 
 //go:nosplit
+//go:cgo_unsafe_args
 func syscall_syscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
-       c := getg().m.libcall
-       c.fn = uintptr(unsafe.Pointer(fn))
-       c.n = nargs
-       c.args = uintptr(noescape(unsafe.Pointer(&a1)))
+       c := libcall{
+               fn:   fn,
+               n:    nargs,
+               args: uintptr(unsafe.Pointer(&a1)),
+       }
 
        entersyscallblock()
        asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(&c))
@@ -82,11 +84,13 @@ func syscall_syscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err ui
 }
 
 //go:nosplit
+//go:cgo_unsafe_args
 func syscall_rawSyscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
-       c := getg().m.libcall
-       c.fn = uintptr(unsafe.Pointer(fn))
-       c.n = nargs
-       c.args = uintptr(noescape(unsafe.Pointer(&a1)))
+       c := libcall{
+               fn:   fn,
+               n:    nargs,
+               args: uintptr(unsafe.Pointer(&a1)),
+       }
 
        asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(&c))