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
),%edx ; \
59 #define STUB_ARG2(name) \
63 movl SECOND_ARG
(%esp
),%edx ; \
65 movl SECOND_ARG
(%esp
),%edx ; \
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 STUB0
(AROS_SLIB_ENTRY
(Forbid
,Exec
,22),AROS_CSYMNAME
(_Exec_22_Forbid
))
99 STUB0
(AROS_SLIB_ENTRY
(Permit
,Exec
,23),AROS_CSYMNAME
(_Exec_23_Permit
))
100 STUB0
(AROS_SLIB_ENTRY
(Disable
,Exec
,20),AROS_CSYMNAME
(_Exec_20_Disable
))
101 STUB0
(AROS_SLIB_ENTRY
(Enable
,Exec
,21),AROS_CSYMNAME
(_Exec_21_Enable
))
103 STUB1
(AROS_SLIB_ENTRY
(ObtainSemaphore
,Exec
,94),AROS_CSYMNAME
(_Exec_94_ObtainSemaphore
))
104 STUB1
(AROS_SLIB_ENTRY
(ReleaseSemaphore
,Exec
,95),AROS_CSYMNAME
(_Exec_95_ReleaseSemaphore
))
105 STUB1
(AROS_SLIB_ENTRY
(ObtainSemaphoreShared
,Exec
,113),AROS_CSYMNAME
(_Exec_113_ObtainSemaphoreShared
))