dos.library: add special handling for ACTION_PARENT_FH on NIL: handler
[AROS.git] / compiler / purify / src / stubs.S
blob99464efa43d4d4622e9c24cac3d7e0004c7a0ff2
2 #define STUB0(name)                     \
3 .globl _##name                        ;  \
4         .type _##name,@function       ;  \
5 _##name:                              ;  \
6         pushl %eax                    ;  \
7         pushl %ebx                    ;  \
8         pushl %ecx                    ;  \
9         pushl %edx                    ;  \
10         pushl %edi                    ;  \
11         pushl %esi                    ;  \
12         call  name                    ;  \
13         popl  %esi                    ;  \
14         popl  %edi                    ;  \
15         popl  %edx                    ;  \
16         popl  %ecx                    ;  \
17         popl  %ebx                    ;  \
18         popl  %eax                    ;  \
19         ret
22 #define STUB2(name)                     \
23 .globl _##name                        ;  \
24         .type _##name,@function       ;  \
25 _##name:                              ;  \
26         pushl %ebp                    ;  \
27         movl  %esp,%ebp               ;  \
28         pushl %eax                    ;  \
29         pushl %ebx                    ;  \
30         pushl %ecx                    ;  \
31         pushl %edx                    ;  \
32         pushl %edi                    ;  \
33         pushl %esi                    ;  \
34         pushl 12(%ebp)                ;  \
35         pushl 8(%ebp)                 ;  \
36         call  name                    ;  \
37         addl  $8,%esp                 ;  \
38         popl  %esi                    ;  \
39         popl  %edi                    ;  \
40         popl  %edx                    ;  \
41         popl  %ecx                    ;  \
42         popl  %ebx                    ;  \
43         popl  %eax                    ;  \
44         movl  %ebp,%esp               ;  \
45         popl  %ebp                    ;  \
46         ret
48 #define STUB4(name)                     \
49 .globl _##name                        ;  \
50         .type _##name,@function       ;  \
51 _##name:                              ;  \
52         pushl %ebp                    ;  \
53         movl  %esp,%ebp               ;  \
54         pushl %eax                    ;  \
55         pushl %ebx                    ;  \
56         pushl %ecx                    ;  \
57         pushl %edx                    ;  \
58         pushl %edi                    ;  \
59         pushl %esi                    ;  \
60         pushl 20(%ebp)                ;  \
61         pushl 16(%ebp)                ;  \
62         pushl 12(%ebp)                ;  \
63         pushl 8(%ebp)                 ;  \
64         call  name                    ;  \
65         addl  $16,%esp                ;  \
66         popl  %esi                    ;  \
67         popl  %edi                    ;  \
68         popl  %edx                    ;  \
69         popl  %ecx                    ;  \
70         popl  %ebx                    ;  \
71         popl  %eax                    ;  \
72         movl  %ebp,%esp               ;  \
73         popl  %ebp                    ;  \
74         ret
76 STUB2(Purify_Push)
77 STUB2(Purify_Pop)
78 STUB2(Purify_Alloca)
79 STUB2(Purify_MoveSP)
80 STUB2(Purify_CheckRead)
81 STUB2(Purify_CheckWrite)
82 STUB2(Purify_InitStack)
83 STUB0(Purify_Init)
84 STUB0(Purify_Exit)
85 STUB0(Purify_LeaveFunction)
86 STUB4(Purify_EnterFunction)