OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 * Apple still insists on underscore prefixes for C function names. | 6 * Apple still insists on underscore prefixes for C function names. |
7 */ | 7 */ |
8 #if defined(__APPLE__) || defined(__MINGW32__) | 8 #if defined(__APPLE__) || defined(__MINGW32__) |
9 #define EXT(s) _##s | 9 #define EXT(s) _##s |
10 #else | 10 #else |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 movl 8(%ebp), %eax /* fn */ | 29 movl 8(%ebp), %eax /* fn */ |
30 call *%eax | 30 call *%eax |
31 | 31 |
32 popl %edi | 32 popl %edi |
33 popl %esi | 33 popl %esi |
34 popl %ebx | 34 popl %ebx |
35 popl %ebp | 35 popl %ebp |
36 ret | 36 ret |
37 | 37 |
| 38 /* |
| 39 * void crosscall2(void (*fn)(void*, int32), void*, int32) |
| 40 * |
| 41 * Save registers and call fn with two arguments. |
| 42 */ |
| 43 .globl EXT(crosscall2) |
| 44 EXT(crosscall2): |
| 45 pushl %ebp |
| 46 movl %esp, %ebp |
| 47 pushl %ebx |
| 48 pushl %esi |
| 49 pushl %edi |
| 50 |
| 51 pushl 16(%ebp) |
| 52 pushl 12(%ebp) |
| 53 mov 8(%ebp), %eax |
| 54 call *%eax |
| 55 addl $8,%esp |
| 56 |
| 57 popl %edi |
| 58 popl %esi |
| 59 popl %ebx |
| 60 popl %ebp |
| 61 ret |
OLD | NEW |