#include <asm_defs.h>
call_stub:
lea 4(%esp), %eax
push %eax
call 1f
1:
pop %eax
subl $(1b - call_stub), %eax
push %eax
movl (call_stub_callback_address - call_stub)(%eax), %eax
call *%eax
lea 8(%esp), %esp
jmp *%eax
.align 4
call_stub_callback_address:
.long 0
call_stub_end:
FUNCTION(arch_call_stub_size):
movl $(call_stub_end - call_stub), %eax
ret
FUNCTION_END(arch_call_stub_size)
FUNCTION(arch_init_call_stub):
push %ebp
movl %esp, %ebp
push %edi
movl 8(%ebp), %edi
movl $(call_stub_end - call_stub), %eax
push %eax
movl $call_stub, %eax
push %eax
push %edi
call memcpy
lea 12(%esp), %esp
movl 12(%ebp), %eax
movl %eax, (call_stub_callback_address - call_stub)(%edi)
pop %edi
movl %ebp, %esp
pop %ebp
ret
FUNCTION_END(arch_init_call_stub)