github.com/go-darwin/sys@v0.0.0-20220510002607-68fd01f054ca/crosscall2.go (about) 1 // Copyright 2021 The Go Darwin Authors 2 // SPDX-License-Identifier: BSD-3-Clause 3 4 //go:build amd64 && gc 5 // +build amd64,gc 6 7 package sys 8 9 import ( 10 "unsafe" 11 ) 12 13 //go:noescape 14 //go:nosplit 15 func _crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr) 16 17 // CrossCall2 called by C code generated by cmd/cgo. 18 // 19 // Saves C callee-saved registers and calls cgocallback with three arguments. 20 // fn is the PC of a func(a unsafe.Pointer) function. 21 // 22 //go:nosplit 23 func CrossCall2(fn, a unsafe.Pointer, n int32, ctxt uintptr) { 24 _crosscall2(fn, a, n, ctxt) 25 }