mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] runtime: use internal/abi.FuncPCABI0 and cgo_unsafe_args for Solaris syscall wrappers
Similar to CL 313230, for Solaris (and Illumos). Also mark functions that take address of one arg and pass to asmcgocall cgo_unsafe_args, as it effectively takes address of all args. Change-Id: I4281dd774719fb21ecba82e5ed94a609378a3df5 Reviewed-on: https://go-review.googlesource.com/c/go/+/321314 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
6bdfff112f
commit
a5cd89b8c3
3 changed files with 18 additions and 3 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package runtime
|
||||
|
||||
import (
|
||||
"internal/abi"
|
||||
"runtime/internal/sys"
|
||||
"unsafe"
|
||||
)
|
||||
|
|
@ -172,7 +173,7 @@ func newosproc(mp *m) {
|
|||
// Disable signals during create, so that the new thread starts
|
||||
// with signals disabled. It will enable them in minit.
|
||||
sigprocmask(_SIG_SETMASK, &sigset_all, &oset)
|
||||
ret = pthread_create(&tid, &attr, funcPC(tstart_sysvicall), unsafe.Pointer(mp))
|
||||
ret = pthread_create(&tid, &attr, abi.FuncPCABI0(tstart_sysvicall), unsafe.Pointer(mp))
|
||||
sigprocmask(_SIG_SETMASK, &oset, nil)
|
||||
if ret != 0 {
|
||||
print("runtime: failed to create new OS thread (have ", mcount(), " already; errno=", ret, ")\n")
|
||||
|
|
@ -215,7 +216,7 @@ func miniterrno()
|
|||
// Called to initialize a new m (including the bootstrap m).
|
||||
// Called on the new thread, cannot allocate memory.
|
||||
func minit() {
|
||||
asmcgocall(unsafe.Pointer(funcPC(miniterrno)), unsafe.Pointer(&libc____errno))
|
||||
asmcgocall(unsafe.Pointer(abi.FuncPCABI0(miniterrno)), unsafe.Pointer(&libc____errno))
|
||||
|
||||
minitSignals()
|
||||
|
||||
|
|
@ -242,7 +243,7 @@ func setsig(i uint32, fn uintptr) {
|
|||
sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART
|
||||
sa.sa_mask = sigset_all
|
||||
if fn == funcPC(sighandler) {
|
||||
fn = funcPC(sigtramp)
|
||||
fn = abi.FuncPCABI0(sigtramp)
|
||||
}
|
||||
*((*uintptr)(unsafe.Pointer(&sa._funcptr))) = fn
|
||||
sigaction(i, &sa, nil)
|
||||
|
|
@ -390,6 +391,7 @@ func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (un
|
|||
}
|
||||
|
||||
//go:nosplit
|
||||
//go:cgo_unsafe_args
|
||||
func doMmap(addr, n, prot, flags, fd, off uintptr) (uintptr, uintptr) {
|
||||
var libcall libcall
|
||||
libcall.fn = uintptr(unsafe.Pointer(&libc_mmap))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue