Commit 4e2b4d7f authored by Clément Chigot's avatar Clément Chigot Committed by Ian Lance Taylor

runtime: move libcall to stack for syscall package on aix/ppc64

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: default avatarIan Lance Taylor <iant@golang.org>
parent a5032bc8
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment