1 // Copyright 2016 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
12 // Start with standard C stack frame layout and linkage.
14 // Save R6-R15 in the register save area of the calling function.
17 // Allocate 96 bytes on the stack.
20 // Save F8-F15 in our stack frame.
30 // Initialize Go ABI environment.
31 BL runtimeĀ·load_g(SB)
33 MOVD R2, 8(R15) // fn unsafe.Pointer
34 MOVD R3, 16(R15) // a unsafe.Pointer
36 MOVD R5, 24(R15) // ctxt uintptr
37 BL runtimeĀ·cgocallback(SB)
48 // De-allocate stack frame.