We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6dece91 commit e31849fCopy full SHA for e31849f
src/rt/arch/i386/ccall.S
@@ -1,14 +1,17 @@
1
.text
2
3
// upcall_call_c_stack(void (*fn)(), void *new_esp)
4
+//
5
+// Note that we could use |enter| and |leave| but the manuals tell me they're
6
+// slower.
7
.globl _upcall_call_c_stack
8
_upcall_call_c_stack:
- movl %esp,%ecx // grab esp
- movl 8(%esp),%eax // save fn
9
+ pushl %ebp
10
+ movl %esp,%ebp // save esp
11
+ movl 8(%esp),%eax // eax = callee
12
movl 12(%esp),%esp // switch stack
- pushl %ecx // save esp on stack
13
calll *%eax
- popl %esp // restore esp
14
+ movl %ebp,%esp // would like to use "leave" but it's slower
15
+ popl %ebp
16
ret
17
-
0 commit comments