2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Stubs to call C functions while preserving all registers
8 #include "aros/i386/asm.h"
12 PUSH - Save all registers on the stack
13 POP - Restore all registers from the stack
15 STUB_ARG0(name) - Call a function preserving all registers
16 which gets no arguments
17 STUB_ARG1(name) - Call a function preserving all registers
18 which gets a single argument
19 STUB_ARG2(name) - Call a function preserving all registers
20 which gets two arguments
25 #define FIRST_ARG ((NUM_REGS+2)*4)
26 #define SECOND_ARG (FIRST_ARG+4)
38 #define STUB_ARG0(name) \
47 #define STUB_ARG1(name) \
51 movl FIRST_ARG
(%esp
),%eax ; \
59 #define STUB_ARG2(name) \
63 movl SECOND_ARG
(%esp
),%eax ; \
65 movl SECOND_ARG
(%esp
),%eax ; \
73 /* To save typing work */
74 #define STUB0(cname,name) \
80 #define STUB1(cname,name) \
87 #define STUB2(cname,name) \
96 /* Call functions and preserve registers */
98 STUB1
(AROS_SLIB_ENTRY
(Forbid
,Exec
),AROS_CSYMNAME
(_Exec_Forbid
))
99 STUB1
(AROS_SLIB_ENTRY
(Permit
,Exec
),AROS_CSYMNAME
(_Exec_Permit
))
100 STUB1
(AROS_SLIB_ENTRY
(Disable
,Exec
),AROS_CSYMNAME
(_Exec_Disable
))
101 STUB1
(AROS_SLIB_ENTRY
(Enable
,Exec
),AROS_CSYMNAME
(_Exec_Enable
))
103 STUB2
(AROS_SLIB_ENTRY
(ObtainSemaphore
,Exec
),AROS_CSYMNAME
(_Exec_ObtainSemaphore
))
104 STUB2
(AROS_SLIB_ENTRY
(ReleaseSemaphore
,Exec
),AROS_CSYMNAME
(_Exec_ReleaseSemaphore
))
105 STUB2
(AROS_SLIB_ENTRY
(ObtainSemaphoreShared
,Exec
),AROS_CSYMNAME
(_Exec_ObtainSemaphoreShared
))