1 // Copyright 2009 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.
8 // Called by C code generated by cmd/cgo.
9 // func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
10 // Saves C callee-saved registers and calls cgocallback with three arguments.
11 // fn is the PC of a func(a unsafe.Pointer) function.
12 // This signature is known to SWIG, so we can't change it.
13 TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0-0
14 PUSH_REGS_HOST_TO_ABI0()
16 // Make room for arguments to cgocallback.
19 MOVQ DI, 0x0(SP) /* fn */
20 MOVQ SI, 0x8(SP) /* arg */
22 MOVQ CX, 0x10(SP) /* ctxt */
24 MOVQ CX, 0x0(SP) /* fn */
25 MOVQ DX, 0x8(SP) /* arg */
27 MOVQ R9, 0x10(SP) /* ctxt */
30 CALL runtime·cgocallback(SB)
33 POP_REGS_HOST_TO_ABI0()