...
Text file src/pkg/runtime/cgo/asm_386.s
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.
4
5 #include "textflag.h"
6
7 // Called by C code generated by cmd/cgo.
8 // func crosscall2(fn func(a unsafe.Pointer, n int32, ctxt uintptr), a unsafe.Pointer, n int32, ctxt uintptr)
9 // Saves C callee-saved registers and calls fn with three arguments.
10 TEXT crosscall2(SB),NOSPLIT,$28-16
11 MOVL BP, 24(SP)
12 MOVL BX, 20(SP)
13 MOVL SI, 16(SP)
14 MOVL DI, 12(SP)
15
16 MOVL ctxt+12(FP), AX
17 MOVL AX, 8(SP)
18 MOVL n+8(FP), AX
19 MOVL AX, 4(SP)
20 MOVL a+4(FP), AX
21 MOVL AX, 0(SP)
22 MOVL fn+0(FP), AX
23 CALL AX
24
25 MOVL 12(SP), DI
26 MOVL 16(SP), SI
27 MOVL 20(SP), BX
28 MOVL 24(SP), BP
29 RET
View as plain text