2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
10 // push a pointer to arguments and a pointer to ourselves on the stack
16 subl $(1b - call_stub), %eax
19 // call the wrapper function
20 movl (call_stub_callback_address - call_stub)(%eax), %eax
22 // returns a pointer to the actual function
28 call_stub_callback_address:
33 // size_t arch_call_stub_size();
34 FUNCTION(arch_call_stub_size):
35 movl $(call_stub_end - call_stub), %eax
37 FUNCTION_END(arch_call_stub_size)
41 // void arch_init_call_stub(void* stub,
42 // void* (*callback)(const void* stub, const void* args),
44 FUNCTION(arch_init_call_stub):
48 // stub address to %edi
53 movl $(call_stub_end - call_stub), %eax
61 // set the callback address in the stub
63 movl %eax, (call_stub_callback_address - call_stub)(%edi)
71 FUNCTION_END(arch_init_call_stub)