提交 e31849fb 编写于 作者: P Patrick Walton

rt: Fix assembler for C calls to work more like a regular function call

上级 6dece91e
.text
// upcall_call_c_stack(void (*fn)(), void *new_esp)
//
// Note that we could use |enter| and |leave| but the manuals tell me they're
// slower.
.globl _upcall_call_c_stack
_upcall_call_c_stack:
movl %esp,%ecx // grab esp
movl 8(%esp),%eax // save fn
pushl %ebp
movl %esp,%ebp // save esp
movl 8(%esp),%eax // eax = callee
movl 12(%esp),%esp // switch stack
pushl %ecx // save esp on stack
calll *%eax
popl %esp // restore esp
movl %ebp,%esp // would like to use "leave" but it's slower
popl %ebp
ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册