Skip to content

Commit 33cb24d

Browse files
committed
---
yaml --- r: 6302 b: refs/heads/master c: 59e2a0a h: refs/heads/master v: v3
1 parent 2f8f04b commit 33cb24d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4fc34e23faddf02c2ed85ee97ae929b36a9aaa1b
2+
refs/heads/master: 59e2a0a9c1434db65afc6c94752de3cf2ab761a0

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

+16
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,19 @@ upcall_call_c_stack_float:
5656
pop %rbp
5757
ret
5858

59+
#if defined(__APPLE__) || defined(_WIN32)
60+
.globl _upcall_call_c_stack_shim
61+
_upcall_call_c_stack_shim:
62+
#else
63+
.globl upcall_call_c_stack_shim
64+
upcall_call_c_stack_shim
65+
#endif
66+
push %rbp
67+
mov %rsp,%rbp // save rsp
68+
mov ARG1,%rsp // switch stack
69+
mov ARG0,%r11 // Remember target address
70+
mov ARG1,ARG0 // setup the parameter shim expects
71+
call *%r11
72+
mov %rbp,%rsp
73+
pop %rbp
74+
ret

0 commit comments

Comments
 (0)