Skip to content

Commit 96adb3c

Browse files
committed
---
yaml --- r: 6650 b: refs/heads/master c: 5cd0858 h: refs/heads/master v: v3
1 parent ecd52b9 commit 96adb3c

File tree

3 files changed

+58
-17
lines changed

3 files changed

+58
-17
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4699b6865f9e25b638553e5852858d183476035a
2+
refs/heads/master: 5cd08586f6007325b50b697ce2ae175810637b0f

trunk/src/rt/arch/i386/ccall.S

+30-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,33 @@ _asm_call_on_stack:
77
.globl asm_call_on_stack
88
asm_call_on_stack:
99
#endif
10-
pushl %ebp
11-
movl %esp,%ebp // save esp
12-
movl 16(%ebp),%esp // load new esp
13-
subl $12,%esp // maintain 16-byte alignment
14-
pushl 8(%ebp) // push ptr to argument block
15-
calll *12(%ebp)
16-
movl %ebp,%esp // would like to use "leave" but it's slower
17-
popl %ebp
18-
ret
10+
11+
#if defined(__linux__) || defined(__APPLE__)
12+
.cfi_startproc
13+
#endif
14+
15+
pushl %ebp
16+
17+
#if defined(__linux__) || defined(__APPLE__)
18+
.cfi_def_cfa_offset 8
19+
.cfi_offset %ebp, -8
20+
#endif
21+
22+
movl %esp,%ebp // save esp
23+
24+
#if defined(__linux__) || defined(__APPLE__)
25+
.cfi_def_cfa_register %ebp
26+
#endif
27+
28+
movl 16(%ebp),%esp // load new esp
29+
subl $12,%esp // maintain 16-byte alignment
30+
pushl 8(%ebp) // push ptr to argument block
31+
calll *12(%ebp)
32+
movl %ebp,%esp // would like to use "leave" but it's slower
33+
popl %ebp
34+
35+
ret
36+
37+
#if defined(__linux__) || defined(__APPLE__)
38+
.cfi_endproc
39+
#endif

trunk/src/rt/arch/x86_64/ccall.S

+27-7
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,30 @@ _asm_call_on_stack:
1313
.globl asm_call_on_stack
1414
asm_call_on_stack:
1515
#endif
16-
push %rbp
17-
mov %rsp,%rbp // save rsp
18-
mov ARG2,%rsp // switch stack
19-
call *ARG1 // invoke target address
20-
mov %rbp,%rsp
21-
pop %rbp
22-
ret
16+
17+
#if defined(__linux__) || defined(__APPLE__)
18+
.cfi_startproc
19+
#endif
20+
21+
push %rbp
22+
#if defined(__linux__) || defined(__APPLE__)
23+
.cfi_def_cfa_offset 16
24+
.cfi_offset %rbp, -16
25+
#endif
26+
27+
mov %rsp,%rbp // save rsp
28+
29+
#if defined(__linux__) || defined(__APPLE__)
30+
.cfi_def_cfa_register %rbp
31+
#endif
32+
33+
mov ARG2,%rsp // switch stack
34+
call *ARG1 // invoke target address
35+
mov %rbp,%rsp
36+
pop %rbp
37+
38+
ret
39+
40+
#if defined(__linux__) || defined(__APPLE__)
41+
.cfi_endproc
42+
#endif

0 commit comments

Comments
 (0)