1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Called by C code generated by cmd/cgo.
8 // func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
9 // Saves C callee-saved registers and calls cgocallback with three arguments.
10 // fn is the PC of a func(a unsafe.Pointer) function.
11 TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
13 * Push arguments for fn (X10, X11, X13), along with all callee-save
14 * registers. Note that at procedure entry the first argument is at
18 MOV X10, (8*1)(X2) // fn unsafe.Pointer
19 MOV X11, (8*2)(X2) // a unsafe.Pointer
20 MOV X13, (8*3)(X2) // ctxt uintptr
47 // Initialize Go ABI environment
48 CALL runtimeĀ·load_g(SB)
49 CALL runtimeĀ·cgocallback(SB)