1 // Copyright 2015 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 TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
14 * We still need to save all callee save register as before, and then
15 * push 3 args for fn (R0, R1, R3), skipping R2.
16 * Also note that at procedure entry in gc world, 8(RSP) will be the
20 STP (R0, R1), (8*1)(RSP)
25 STP (R29, R30), (8*22)(RSP)
28 // Initialize Go ABI environment
29 BL runtimeĀ·load_g(SB)
30 BL runtimeĀ·cgocallback(SB)
32 RESTORE_R19_TO_R28(8*4)
33 RESTORE_F8_TO_F15(8*14)
34 LDP (8*22)(RSP), (R29, R30)