Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Delta Between Two Patch Sets: src/libcgo/386.S

Issue 834045: code review 834045: Library support for cgo export. (Closed)
Left Patch Set: code review 834045: Library support for cgo export. Created 13 years, 12 months ago
Right Patch Set: code review 834045: Library support for cgo export. Created 13 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/runtime/386/asm.s » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 #ifdef __APPLE__ 8 #if defined(__APPLE__) || defined(__MINGW32__)
9 #define EXT(s) _##s 9 #define EXT(s) _##s
10 #else 10 #else
11 #define EXT(s) s 11 #define EXT(s) s
12 #endif 12 #endif
13 13
14 /* 14 /*
15 * void crosscall_386(void (*fn)(void)) 15 * void crosscall_386(void (*fn)(void))
16 * 16 *
17 * Calling into the 8c tool chain, where all registers are caller save. 17 * Calling into the 8c tool chain, where all registers are caller save.
18 * Called from standard x86 ABI, where %ebp, %ebx, %esi, 18 * Called from standard x86 ABI, where %ebp, %ebx, %esi,
(...skipping 10 matching lines...) Expand all
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 /* 38 /*
39 * void crosscall2(void (*fn)(void *, int32), void*, int32) 39 * void crosscall2(void (*fn)(void*, int32), void*, int32)
rsc1 2010/04/02 06:31:25 s/void */void*/
40 * 40 *
41 * Save registers and call fn with two arguments. 41 * Save registers and call fn with two arguments.
42 */ 42 */
43 .globl EXT(crosscall2) 43 .globl EXT(crosscall2)
44 EXT(crosscall2): 44 EXT(crosscall2):
45 pushl %ebp 45 pushl %ebp
46 movl %esp, %ebp 46 movl %esp, %ebp
47 pushl %ebx 47 pushl %ebx
48 pushl %esi 48 pushl %esi
49 pushl %edi 49 pushl %edi
50 50
51 pushl 16(%ebp) 51 pushl 16(%ebp)
52 pushl 12(%ebp) 52 pushl 12(%ebp)
53 mov 8(%ebp), %eax 53 mov 8(%ebp), %eax
54 call *%eax 54 call *%eax
55 addl $8,%esp 55 addl $8,%esp
56 56
57 popl %edi 57 popl %edi
58 popl %esi 58 popl %esi
59 popl %ebx 59 popl %ebx
60 popl %ebp 60 popl %ebp
61 ret 61 ret
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b