blob: a895083f1bcb833db23595df63d4e102900e2c6f [file] [log] [blame]
Colin Cross7bb052a2015-02-03 12:59:37 -08001// 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/*
8 * void crosscall2(void (*fn)(void*, int32), void*, int32)
9 * Save registers and call fn with two arguments.
10 */
11TEXT crosscall2(SB),NOSPLIT,$0
12 PUSHL BP
13 MOVL SP, BP
14 PUSHL BX
15 PUSHL SI
16 PUSHL DI
17
18 SUBL $8, SP
19 MOVL 16(BP), AX
20 MOVL AX, 4(SP)
21 MOVL 12(BP), AX
22 MOVL AX, 0(SP)
23 MOVL 8(BP), AX
24 CALL AX
25 ADDL $8, SP
26
27 POPL DI
28 POPL SI
29 POPL BX
30 POPL BP
31 RET