tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / api / amiga_raf.h
blob911e9c6b72a2bb79ce322cbc860ebf01f73016bf
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
23 #ifndef AMIGA_RAF_H
24 #define AMIGA_RAF_H
27 * RAF1...RAF7 gives consistent way to make function take arguments in
28 * registers. currently __GNUC__ and __SASC supported.
31 #if __SASC
33 #define RAF1(funname, type1, arg1, reg1) \
34 __asm funname(register __##reg1 type1 arg1) \
37 #define RAF2(funname,type1, arg1, reg1,type2, arg2, reg2) \
38 __asm funname(register __##reg1 type1 arg1, \
39 register __##reg2 type2 arg2) \
42 #define RAF3(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3)\
43 __asm funname(register __##reg1 type1 arg1, \
44 register __##reg2 type2 arg2, \
45 register __##reg3 type3 arg3) \
48 #define RAF4(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4) \
49 __asm funname(register __##reg1 type1 arg1, \
50 register __##reg2 type2 arg2, \
51 register __##reg3 type3 arg3, \
52 register __##reg4 type4 arg4) \
55 #define RAF5(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5) \
56 __asm funname(register __##reg1 type1 arg1, \
57 register __##reg2 type2 arg2, \
58 register __##reg3 type3 arg3, \
59 register __##reg4 type4 arg4, \
60 register __##reg5 type5 arg5) \
63 #define RAF6(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5, type6, arg6, reg6) \
64 __asm funname(register __##reg1 type1 arg1, \
65 register __##reg2 type2 arg2, \
66 register __##reg3 type3 arg3, \
67 register __##reg4 type4 arg4, \
68 register __##reg5 type5 arg5, \
69 register __##reg6 type6 arg6) \
72 #define RAF7(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5, type6, arg6, reg6, type7, arg7, reg7) \
73 __asm funname(register __##reg1 type1 arg1, \
74 register __##reg2 type2 arg2, \
75 register __##reg3 type3 arg3, \
76 register __##reg4 type4 arg4, \
77 register __##reg5 type5 arg5, \
78 register __##reg6 type6 arg6, \
79 register __##reg7 type7 arg7) \
82 #elif __GNUC__
84 #define RAF1(funname,type1, arg1, reg1) \
85 funname(VOID) \
86 { \
87 register type1 reg1 __asm(#reg1); \
88 type1 arg1 = reg1;
90 #define RAF2(funname, type1, arg1, reg1, type2, arg2, reg2) \
91 funname(VOID) \
92 { \
93 register type1 reg1 __asm(#reg1); \
94 type1 arg1 = reg1; \
95 register type2 reg2 __asm(#reg2); \
96 type2 arg2 = reg2;
98 #if 0
99 #define RAF2(funname, type1, arg1, reg1, type2, arg2, reg2) \
100 funname(type1 arg1 __asm(#reg1), type2 arg2 __asm(#reg2)) \
102 #endif
104 #define RAF3(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3)\
105 funname(VOID) \
107 register type1 reg1 __asm(#reg1); \
108 type1 arg1 = reg1; \
109 register type2 reg2 __asm(#reg2); \
110 type2 arg2 = reg2; \
111 register type3 reg3 __asm(#reg3); \
112 type3 arg3 = reg3;
114 #define RAF4(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4) \
115 funname(VOID) \
117 register type1 reg1 __asm(#reg1); \
118 type1 arg1 = reg1; \
119 register type2 reg2 __asm(#reg2); \
120 type2 arg2 = reg2; \
121 register type3 reg3 __asm(#reg3); \
122 type3 arg3 = reg3; \
123 register type4 reg4 __asm(#reg4); \
124 type4 arg4 = reg4;
126 #define RAF5(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5) \
127 funname(VOID) \
129 register type1 reg1 __asm(#reg1); \
130 type1 arg1 = reg1; \
131 register type2 reg2 __asm(#reg2); \
132 type2 arg2 = reg2; \
133 register type3 reg3 __asm(#reg3); \
134 type3 arg3 = reg3; \
135 register type4 reg4 __asm(#reg4); \
136 type4 arg4 = reg4; \
137 register type5 reg5 __asm(#reg5); \
138 type5 arg5 = reg5;
141 #define RAF6(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5, type6, arg6, reg6) \
142 funname(VOID) \
144 register type1 reg1 __asm(#reg1); \
145 type1 arg1 = reg1; \
146 register type2 reg2 __asm(#reg2); \
147 type2 arg2 = reg2; \
148 register type3 reg3 __asm(#reg3); \
149 type3 arg3 = reg3; \
150 register type4 reg4 __asm(#reg4); \
151 type4 arg4 = reg4; \
152 register type5 reg5 __asm(#reg5); \
153 type5 arg5 = reg5; \
154 register type6 reg6 __asm(#reg6); \
155 type6 arg6 = reg6;
157 #define RAF7(funname, type1, arg1, reg1, type2, arg2, reg2, type3, arg3, reg3, type4, arg4, reg4, type5, arg5, reg5, type6, arg6, reg6, type7, arg7, reg7) \
158 funname(VOID) \
160 register type1 reg1 __asm(#reg1); \
161 type1 arg1 = reg1; \
162 register type2 reg2 __asm(#reg2); \
163 type2 arg2 = reg2; \
164 register type3 reg3 __asm(#reg3); \
165 type3 arg3 = reg3; \
166 register type4 reg4 __asm(#reg4); \
167 type4 arg4 = reg4; \
168 register type5 reg5 __asm(#reg5); \
169 type5 arg5 = reg5; \
170 register type6 reg6 __asm(#reg6); \
171 type6 arg6 = reg6; \
172 register type7 reg7 __asm(#reg7); \
173 type7 arg7 = reg7;
175 #endif /* __SASC | __GNUC__ */
177 #endif /* !defined(AMIGA_RAF_H) */