config: fix build with external compiler by passing the sysroot where needed
[AROS.git] / arch / ppc-morphos / include / aros / cpu.h
blob3d9746996670182c246a6e8d74c5f895d2eb0adc
1 #ifndef AROS_MORPHOS_CPU_H
2 #define AROS_MORPHOS_CPU_H
3 /*
4 Copyright � 1995-2010, The AROS Development Team. All rights reserved.
5 $Id$
7 NOTE: This file must compile *without* any other header !
9 Desc: cpu.h include file for morphos arch
10 Lang: english
13 /* Information about size and alignment,
14 * the defines have to be numeric constants */
15 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
16 #define AROS_BIG_ENDIAN 1 /* Big or little endian */
17 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
18 #define AROS_SIZEOFPTR 4 /* Size of a PTR */
19 #define AROS_WORDALIGN 2 /* Alignment for WORD */
20 #define AROS_LONGALIGN 2 /* Alignment for LONG */
21 #define AROS_QUADALIGN 2 /* Alignment for QUAD */
22 #define AROS_PTRALIGN 2 /* Alignment for PTR */
23 #define AROS_IPTRALIGN 2 /* Alignment for IPTR */
24 #define AROS_DOUBLEALIGN 2 /* Alignment for double */
25 #define AROS_WORSTALIGN 8 /* Worst case alignment */
28 * PowerPC note:
29 * Some (or maybe even all) PowerPC machines expect the stack to be aligned on 16-byte boundary.
30 * This is the reason number one for AROS_WORSTALIGN=16. The second reason is, the 440 CPU will
31 * generate an alignment exception if floating point data *crosses* the 16-byte boundary.
34 #define AROS_32BIT_TYPE int
35 /* For ABI V1 this should be done in common cpu.h */
36 #define AROS_LARGEST_TYPE long long
38 /* Note that MorphOS ABI DOES have linear varargs as an option */
39 #define __stackparm __attribute__((varargs68k))
41 #define AROS_SLOWSTACKTAGS 1
42 #define AROS_SLOWSTACKMETHODS 1
43 #define AROS_SLOWSTACKHOOKS 1
44 #define AROS_SLOWSTACKFORMAT 1
46 /* types and limits for sig_atomic_t */
47 #define AROS_SIG_ATOMIC_T int
48 #define AROS_SIG_ATOMIC_MIN (-0x7fffffff-1)
49 #define AROS_SIG_ATOMIC_MAX 0x7fffffff
51 #if defined(__GNUC__) && !defined(__clang__)
52 register unsigned char* AROS_GET_SP __asm__("%sp");
53 #endif
56 An offset value sometimes added to
57 or subtracted from the stack limits.
60 #define SP_OFFSET 0x10
63 One entry in a libraries' jumptable. For assembler compatibility, the
64 field jmp should contain the code for an absolute jmp to a 32bit
65 address. There are also a couple of macros which you should use to
66 access the vector table from C.
68 struct FullJumpVec
70 unsigned long addis; // simplified: lis 11, a@h
71 unsigned long ori; // : li 11, a@l
72 unsigned long mtspr; // : mtctr 11
73 unsigned long jmp; // bcctr : bctr 11
75 /* browse MPCFPE32B.pdf to understand opcode creation */
76 #define __AROS_SET_FULLJMP(v,a)\
78 struct FullJumpVec *_v = (v); \
79 _v->addis = (15 << 26) | (11 << 21) | ((ULONG)(a) >> 16); \
80 _v->ori = (24 << 26) | (11 << 21) | (11 << 16) | ((ULONG)(a) & 0x0000FFFF);\
81 _v->mtspr = (31 << 26) | (11 << 21) | ( 9 << 16) | (467 << 1); \
82 _v->jmp = (19 << 26) | (20 << 21) | (528 << 1); \
85 struct JumpVec
87 unsigned short jmp;
88 unsigned char vec[4];
91 /* Internal macros */
92 #define __AROS_SET_VEC(v,a) (*(ULONG*)(v)->vec=(ULONG)(a))
93 #define __AROS_GET_VEC(v) ((APTR)(*(ULONG*)(v)->vec))
95 /* Use these to acces a vector table */
96 #define LIB_VECTSIZE (sizeof (struct JumpVec))
97 #define __AROS_GETJUMPVEC(lib,n) (&((struct JumpVec *)lib)[-(n)])
98 #define __AROS_GETVECADDR(lib,n) (__AROS_GET_VEC(__AROS_GETJUMPVEC(lib,n)))
99 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_SET_VEC(__AROS_GETJUMPVEC(lib,n),(APTR)(addr)))
100 #define __AROS_INITVEC(lib,n) __AROS_GETJUMPVEC(lib,n)->jmp = TRAP_LIB, \
101 __AROS_SETVECADDR(lib,n,_aros_not_implemented)
104 Code used to generate stub functions.
105 It must be *printed* with a function like printf into
106 a file to be compiled with gcc.
108 - The first parameter is the function name,
109 - The second parameter is the basename,
110 i.e. bname is the address of a pointer to the library base,
111 - The third parameter is the library vector to be called.
113 It's value must be computed by the stub generator with this code:
114 &(__AROS_GETJUMPVEC(0, n+1)->vec), where n is the library vector position in
115 the library vectors list.
118 #define STUBCODE_INIT \
119 "#define EMITSTUB(fname, bname, vec) " \
120 ".globl fname; " \
121 "fname : " \
122 "lis 11,bname@ha; " \
123 "lwz 11,bname@l(11); " \
124 "lwz 11,vec(11); " \
125 "mtctr 11; " \
126 "bctr;\n " \
127 "#define EMITALIAS(fname, alias) " \
128 ".weak alias; .set alias, fname\n"
129 #define STUBCODE \
130 "EMITSTUB(%s, %s, %d) "
131 #define ALIASCODE \
132 "EMITALIAS(%s, %s)\n"
134 We want to activate the execstubs and preserve all registers
135 when calling obtainsemaphore, obtainsemaphoreshared, releasesemaphore,
136 getcc, permit, forbid, enable, disable
138 #undef UseExecstubs
139 #define UseExecstubs 1
141 /* Macros to test/set failure of AllocEntry() */
142 #define AROS_ALLOCENTRY_FAILED(memType) \
143 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
144 #define AROS_CHECK_ALLOCENTRY(memList) \
145 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
148 Find the next valid alignment for a structure if the next x bytes must
149 be skipped.
151 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
153 /* Prototypes */
154 extern void _aros_not_implemented (char *);
156 /* How much stack do we need ? Lots :-) */
157 #define AROS_STACKSIZE 32768
159 /* How to map function arguments to CPU registers */
161 /* What to do with the library base in header, prototype and call */
162 #define __AROS_LH_BASE(basetype,basename) basetype basename = (basetype)REG_A6
163 #define __AROS_LP_BASE(basetype,basename) basetype __base = basename
164 #define __AROS_LC_BASE(basetype,basename) REG_A6 = (LONG)__base
165 #define __AROS_LD_BASE(basetype,basename) basetype basename
167 /* How to transform an argument in header, opt prototype, call and forced
168 prototype. */
169 #define __AROS_LHA(type,name,reg) type name = (type) REG_##reg
170 #define __AROS_LPA(type,name,reg) type r##reg = name
171 #define __AROS_LCA(type,name,reg) REG_##reg = (LONG)r##reg
172 #define __AROS_LDA(type,name,reg) type
173 #define __AROS_UFHA(type,name,reg) type name = (type) REG_##reg
174 #define __AROS_UFPA(type,name,reg) type r##reg = name
175 #define __AROS_UFCA(type,name,reg) REG_##reg = (LONG)r##reg
176 #define __AROS_UFDA(type,name,reg) type
177 #define __AROS_LHAQUAD(type,name,reg1,reg2) type name
178 #define __AROS_LPAQUAD(type,name,reg1,reg2) type
179 #define __AROS_LCAQUAD(type,name,reg1,reg2) name
180 #define __AROS_LDAQUAD(type,name,reg1,reg2) type
182 /* Prefix for library function in header, prototype and call */
183 #define __AROS_LH_PREFIX /* eps */
184 #define __AROS_LP_PREFIX /* eps */
185 #define __AROS_LC_PREFIX /* eps */
186 #define __AROS_LD_PREFIX /* eps */
187 #define __AROS_UFH_PREFIX /* eps */
188 #define __AROS_UFP_PREFIX /* eps */
189 #define __AROS_UFC_PREFIX /* eps */
190 #define __AROS_UFD_PREFIX /* eps */
192 #define __UFC3R(_t,_n,t1,n1,r1,t2,n2,r2,t3,n3,r3,p) \
194 long _n1 = (long)(n1);\
195 long _n2 = (long)(n2);\
196 long _n3 = (long)(n3);\
197 long _re;\
198 __asm__ __volatile__(\
199 "mr 3,%3\n\t" \
200 "mr 4,%4\n\t" \
201 "mr 5,%5\n\t" \
202 "stw 1,%1\n\t" \
203 "mflr 0\n\t" \
204 "stwu 1,-16(1)\n\t" \
205 "stw 0,12(1)\n\t" \
206 "mr 0,%2\n\t" \
207 "mtlr 0\n\t" \
208 "blrl\n\t" \
209 "mr %0,3\n\t" \
210 "lwz 11,0(1)\n\t" \
211 "lwz 0,-4(11)\n\t" \
212 "mtlr 0\n\t" \
213 "mr 1,11\n\t" \
214 : "=r"(_re), "=m"(*(APTR *)p)\
215 : "r"(_n), "r"(_n1), "r"(_n2), "r"(_n3)\
216 : "cc", "memory", "0", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13");\
217 (_t)_re;\
219 #define AROS_UFC3R(t,n,a1,a2,a3,p,ss) __UFC3R(t,n,a1,a2,a3,p)
221 /* Library prototypes expand to nothing */
222 #define __AROS_CPU_SPECIFIC_LP
224 #define AROS_LPQUAD1(t,n,a1,bt,bn,o,s)
225 #define AROS_LPQUAD2(t,n,a1,a2,bt,bn,o,s)
227 #define AROS_LP0(t,n,bt,bn,o,s)
228 #define AROS_LP1(t,n,a1,bt,bn,o,s)
229 #define AROS_LP2(t,n,a1,a2,bt,bn,o,s)
230 #define AROS_LP3(t,n,a1,a2,a3,bt,bn,o,s)
231 #define AROS_LP4(t,n,a1,a2,a3,a4,bt,bn,o,s)
232 #define AROS_LP5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s)
233 #define AROS_LP6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s)
234 #define AROS_LP7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s)
235 #define AROS_LP8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s)
236 #define AROS_LP9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s)
237 #define AROS_LP10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s)
238 #define AROS_LP11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s)
239 #define AROS_LP12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s)
240 #define AROS_LP13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s)
241 #define AROS_LP14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s)
242 #define AROS_LP15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s)
244 #define AROS_LP0I(t,n,bt,bn,o,s)
245 #define AROS_LP1I(t,n,a1,bt,bn,o,s)
246 #define AROS_LP2I(t,n,a1,a2,bt,bn,o,s)
247 #define AROS_LP3I(t,n,a1,a2,a3,bt,bn,o,s)
248 #define AROS_LP4I(t,n,a1,a2,a3,a4,bt,bn,o,s)
249 #define AROS_LP5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s)
250 #define AROS_LP6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s)
251 #define AROS_LP7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s)
252 #define AROS_LP8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s)
253 #define AROS_LP9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s)
254 #define AROS_LP10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s)
255 #define AROS_LP11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s)
256 #define AROS_LP12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s)
257 #define AROS_LP13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s)
258 #define AROS_LP14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s)
259 #define AROS_LP15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s)
261 /* Library function calls. They are made through m68k emulator. */
262 #define __AROS_CPU_SPECIFIC_LC
264 /* Call a library function which requires the libbase */
265 #define AROS_LC0(t,n,bt,bn,o,s) \
266 ({ \
267 __AROS_LP_BASE(bt,bn); \
268 __AROS_LC_BASE(bt,bn); \
269 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
272 #define AROS_LC1(t,n,a1,bt,bn,o,s) \
273 ({ \
274 __AROS_LPA(a1); \
275 __AROS_LP_BASE(bt,bn); \
276 __AROS_LCA(a1); \
277 __AROS_LC_BASE(bt,bn); \
278 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
280 #define AROS_LC2(t,n,a1,a2,bt,bn,o,s) \
281 ({ \
282 __AROS_LPA(a1); \
283 __AROS_LPA(a2); \
284 __AROS_LP_BASE(bt,bn); \
285 __AROS_LCA(a1); \
286 __AROS_LCA(a2); \
287 __AROS_LC_BASE(bt,bn); \
288 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
290 #define AROS_LC3(t,n,a1,a2,a3,bt,bn,o,s) \
291 ({ \
292 __AROS_LPA(a1); \
293 __AROS_LPA(a2); \
294 __AROS_LPA(a3); \
295 __AROS_LP_BASE(bt,bn); \
296 __AROS_LCA(a1); \
297 __AROS_LCA(a2); \
298 __AROS_LCA(a3); \
299 __AROS_LC_BASE(bt,bn); \
300 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
302 #define AROS_LC4(t,n,a1,a2,a3,a4,bt,bn,o,s) \
303 ({ \
304 __AROS_LPA(a1); \
305 __AROS_LPA(a2); \
306 __AROS_LPA(a3); \
307 __AROS_LPA(a4); \
308 __AROS_LP_BASE(bt,bn); \
309 __AROS_LCA(a1); \
310 __AROS_LCA(a2); \
311 __AROS_LCA(a3); \
312 __AROS_LCA(a4); \
313 __AROS_LC_BASE(bt,bn); \
314 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
316 #define AROS_LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \
317 ({ \
318 __AROS_LPA(a1); \
319 __AROS_LPA(a2); \
320 __AROS_LPA(a3); \
321 __AROS_LPA(a4); \
322 __AROS_LPA(a5); \
323 __AROS_LP_BASE(bt,bn); \
324 __AROS_LCA(a1); \
325 __AROS_LCA(a2); \
326 __AROS_LCA(a3); \
327 __AROS_LCA(a4); \
328 __AROS_LCA(a5); \
329 __AROS_LC_BASE(bt,bn); \
330 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
332 #define AROS_LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
333 ({ \
334 __AROS_LPA(a1); \
335 __AROS_LPA(a2); \
336 __AROS_LPA(a3); \
337 __AROS_LPA(a4); \
338 __AROS_LPA(a5); \
339 __AROS_LPA(a6); \
340 __AROS_LP_BASE(bt,bn); \
341 __AROS_LCA(a1); \
342 __AROS_LCA(a2); \
343 __AROS_LCA(a3); \
344 __AROS_LCA(a4); \
345 __AROS_LCA(a5); \
346 __AROS_LCA(a6); \
347 __AROS_LC_BASE(bt,bn); \
348 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
350 #define AROS_LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
351 ({ \
352 __AROS_LPA(a1); \
353 __AROS_LPA(a2); \
354 __AROS_LPA(a3); \
355 __AROS_LPA(a4); \
356 __AROS_LPA(a5); \
357 __AROS_LPA(a6); \
358 __AROS_LPA(a7); \
359 __AROS_LP_BASE(bt,bn); \
360 __AROS_LCA(a1); \
361 __AROS_LCA(a2); \
362 __AROS_LCA(a3); \
363 __AROS_LCA(a4); \
364 __AROS_LCA(a5); \
365 __AROS_LCA(a6); \
366 __AROS_LCA(a7); \
367 __AROS_LC_BASE(bt,bn); \
368 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
370 #define AROS_LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
371 ({ \
372 __AROS_LPA(a1); \
373 __AROS_LPA(a2); \
374 __AROS_LPA(a3); \
375 __AROS_LPA(a4); \
376 __AROS_LPA(a5); \
377 __AROS_LPA(a6); \
378 __AROS_LPA(a7); \
379 __AROS_LPA(a8); \
380 __AROS_LP_BASE(bt,bn); \
381 __AROS_LCA(a1); \
382 __AROS_LCA(a2); \
383 __AROS_LCA(a3); \
384 __AROS_LCA(a4); \
385 __AROS_LCA(a5); \
386 __AROS_LCA(a6); \
387 __AROS_LCA(a7); \
388 __AROS_LCA(a8); \
389 __AROS_LC_BASE(bt,bn); \
390 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
392 #define AROS_LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
393 ({ \
394 __AROS_LPA(a1); \
395 __AROS_LPA(a2); \
396 __AROS_LPA(a3); \
397 __AROS_LPA(a4); \
398 __AROS_LPA(a5); \
399 __AROS_LPA(a6); \
400 __AROS_LPA(a7); \
401 __AROS_LPA(a8); \
402 __AROS_LPA(a9); \
403 __AROS_LP_BASE(bt,bn); \
404 __AROS_LCA(a1); \
405 __AROS_LCA(a2); \
406 __AROS_LCA(a3); \
407 __AROS_LCA(a4); \
408 __AROS_LCA(a5); \
409 __AROS_LCA(a6); \
410 __AROS_LCA(a7); \
411 __AROS_LCA(a8); \
412 __AROS_LCA(a9); \
413 __AROS_LC_BASE(bt,bn); \
414 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
416 #define AROS_LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
417 ({ \
418 __AROS_LPA(a1); \
419 __AROS_LPA(a2); \
420 __AROS_LPA(a3); \
421 __AROS_LPA(a4); \
422 __AROS_LPA(a5); \
423 __AROS_LPA(a6); \
424 __AROS_LPA(a7); \
425 __AROS_LPA(a8); \
426 __AROS_LPA(a9); \
427 __AROS_LPA(a10); \
428 __AROS_LP_BASE(bt,bn); \
429 __AROS_LCA(a1); \
430 __AROS_LCA(a2); \
431 __AROS_LCA(a3); \
432 __AROS_LCA(a4); \
433 __AROS_LCA(a5); \
434 __AROS_LCA(a6); \
435 __AROS_LCA(a7); \
436 __AROS_LCA(a8); \
437 __AROS_LCA(a9); \
438 __AROS_LCA(a10); \
439 __AROS_LC_BASE(bt,bn); \
440 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
442 #define AROS_LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
443 ({ \
444 __AROS_LPA(a1); \
445 __AROS_LPA(a2); \
446 __AROS_LPA(a3); \
447 __AROS_LPA(a4); \
448 __AROS_LPA(a5); \
449 __AROS_LPA(a6); \
450 __AROS_LPA(a7); \
451 __AROS_LPA(a8); \
452 __AROS_LPA(a9); \
453 __AROS_LPA(a10); \
454 __AROS_LPA(a11); \
455 __AROS_LP_BASE(bt,bn); \
456 __AROS_LCA(a1); \
457 __AROS_LCA(a2); \
458 __AROS_LCA(a3); \
459 __AROS_LCA(a4); \
460 __AROS_LCA(a5); \
461 __AROS_LCA(a6); \
462 __AROS_LCA(a7); \
463 __AROS_LCA(a8); \
464 __AROS_LCA(a9); \
465 __AROS_LCA(a10); \
466 __AROS_LCA(a11); \
467 __AROS_LC_BASE(bt,bn); \
468 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
470 #define AROS_LC12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \
471 ({ \
472 __AROS_LPA(a1); \
473 __AROS_LPA(a2); \
474 __AROS_LPA(a3); \
475 __AROS_LPA(a4); \
476 __AROS_LPA(a5); \
477 __AROS_LPA(a6); \
478 __AROS_LPA(a7); \
479 __AROS_LPA(a8); \
480 __AROS_LPA(a9); \
481 __AROS_LPA(a10); \
482 __AROS_LPA(a11); \
483 __AROS_LPA(a12); \
484 __AROS_LP_BASE(bt,bn); \
485 __AROS_LCA(a1); \
486 __AROS_LCA(a2); \
487 __AROS_LCA(a3); \
488 __AROS_LCA(a4); \
489 __AROS_LCA(a5); \
490 __AROS_LCA(a6); \
491 __AROS_LCA(a7); \
492 __AROS_LCA(a8); \
493 __AROS_LCA(a9); \
494 __AROS_LCA(a10); \
495 __AROS_LCA(a11); \
496 __AROS_LCA(a12); \
497 __AROS_LC_BASE(bt,bn); \
498 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
500 #define AROS_LC13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \
501 ({ \
502 __AROS_LPA(a1); \
503 __AROS_LPA(a2); \
504 __AROS_LPA(a3); \
505 __AROS_LPA(a4); \
506 __AROS_LPA(a5); \
507 __AROS_LPA(a6); \
508 __AROS_LPA(a7); \
509 __AROS_LPA(a8); \
510 __AROS_LPA(a9); \
511 __AROS_LPA(a10); \
512 __AROS_LPA(a11); \
513 __AROS_LPA(a12); \
514 __AROS_LPA(a13); \
515 __AROS_LP_BASE(bt,bn); \
516 __AROS_LCA(a1); \
517 __AROS_LCA(a2); \
518 __AROS_LCA(a3); \
519 __AROS_LCA(a4); \
520 __AROS_LCA(a5); \
521 __AROS_LCA(a6); \
522 __AROS_LCA(a7); \
523 __AROS_LCA(a8); \
524 __AROS_LCA(a9); \
525 __AROS_LCA(a10); \
526 __AROS_LCA(a11); \
527 __AROS_LCA(a12); \
528 __AROS_LCA(a13); \
529 __AROS_LC_BASE(bt,bn); \
530 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
532 #define AROS_LC14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \
533 ({ \
534 __AROS_LPA(a1); \
535 __AROS_LPA(a2); \
536 __AROS_LPA(a3); \
537 __AROS_LPA(a4); \
538 __AROS_LPA(a5); \
539 __AROS_LPA(a6); \
540 __AROS_LPA(a7); \
541 __AROS_LPA(a8); \
542 __AROS_LPA(a9); \
543 __AROS_LPA(a10); \
544 __AROS_LPA(a11); \
545 __AROS_LPA(a12); \
546 __AROS_LPA(a13); \
547 __AROS_LPA(a14); \
548 __AROS_LP_BASE(bt,bn); \
549 __AROS_LCA(a1); \
550 __AROS_LCA(a2); \
551 __AROS_LCA(a3); \
552 __AROS_LCA(a4); \
553 __AROS_LCA(a5); \
554 __AROS_LCA(a6); \
555 __AROS_LCA(a7); \
556 __AROS_LCA(a8); \
557 __AROS_LCA(a9); \
558 __AROS_LCA(a10); \
559 __AROS_LCA(a11); \
560 __AROS_LCA(a12); \
561 __AROS_LCA(a13); \
562 __AROS_LCA(a14); \
563 __AROS_LC_BASE(bt,bn); \
564 (t)MyEmulHandle->EmulCallDirectOS(- 6 *o); \
566 #define AROS_LC15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \
567 ({ \
568 __AROS_LPA(a1); \
569 __AROS_LPA(a2); \
570 __AROS_LPA(a3); \
571 __AROS_LPA(a4); \
572 __AROS_LPA(a5); \
573 __AROS_LPA(a6); \
574 __AROS_LPA(a7); \
575 __AROS_LPA(a8); \
576 __AROS_LPA(a9); \
577 __AROS_LPA(a10); \
578 __AROS_LPA(a11); \
579 __AROS_LPA(a12); \
580 __AROS_LPA(a13); \
581 __AROS_LPA(a14); \
582 __AROS_LPA(a15); \
583 __AROS_LP_BASE(bt,bn); \
584 __AROS_LCA(a1); \
585 __AROS_LCA(a2); \
586 __AROS_LCA(a3); \
587 __AROS_LCA(a4); \
588 __AROS_LCA(a5); \
589 __AROS_LCA(a6); \
590 __AROS_LCA(a7); \
591 __AROS_LCA(a8); \
592 __AROS_LCA(a9); \
593 __AROS_LCA(a10); \
594 __AROS_LCA(a11); \
595 __AROS_LCA(a12); \
596 __AROS_LCA(a13); \
597 __AROS_LCA(a14); \
598 __AROS_LCA(a15); \
599 __AROS_LC_BASE(bt,bn); \
600 (t)MyEmulHandle->EmulCallDirectOS(-6 * o); \
603 /* Call a library function which doesn't require the libbase */
604 #define AROS_LC0I(t,n,bt,bn,o,s) \
605 AROS_LC0(t,n,bt,bn,o,s)
606 #define AROS_LC1I(t,n,a1,bt,bn,o,s) \
607 AROS_LC1(t,n,a1,bt,bn,o,s)
608 #define AROS_LC2I(t,n,a1,a2,bt,bn,o,s) \
609 AROS_LC2(t,n,a1,a2,bt,bn,o,s)
610 #define AROS_LC3I(t,n,a1,a2,a3,bt,bn,o,s) \
611 AROS_LC3(t,n,a1,a2,a3,bt,bn,o,s)
612 #define AROS_LC4I(t,n,a1,a2,a3,a4,bt,bn,o,s) \
613 AROS_LC4(t,n,a1,a2,a3,a4,bt,bn,o,s)
614 #define AROS_LC5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \
615 AROS_LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s)
616 #define AROS_LC6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
617 AROS_LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s)
618 #define AROS_LC7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
619 AROS_LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s)
620 #define AROS_LC8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
621 AROS_LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s)
622 #define AROS_LC9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
623 AROS_LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s)
624 #define AROS_LC10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
625 AROS_LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s)
626 #define AROS_LC11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
627 AROS_LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s)
628 #define AROS_LC12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \
629 AROS_LC12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s)
630 #define AROS_LC13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \
631 AROS_LC13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s)
632 #define AROS_LC14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \
633 AROS_LC14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s)
634 #define AROS_LC15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \
635 AROS_LC15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s)
637 /* asmcall stuff follows. Also use m68k emulator traps as entry points. */
638 #define __AROS_CPU_SPECIFIC_ASMCALLS
640 #define AROS_ASMSYMNAME(s) (&s##_Gate)
642 #if !(UseRegisterArgs && defined(AROS_COMPILER_NO_REGARGS))
643 /* Function headers for user functions */
644 #define AROS_UFH0(t,n) \
645 __AROS_UFH_PREFIX t n##_Func (void); \
646 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
647 __AROS_UFH_PREFIX t n##_Func(void) \
650 #define AROS_UFH1(t,n,a1) \
651 __AROS_UFH_PREFIX t n##_Func (void); \
652 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
653 __AROS_UFH_PREFIX t n##_Func(void) \
655 __AROS_UFHA(a1);
657 #define AROS_UFH2(t,n,a1,a2) \
658 __AROS_UFH_PREFIX t n##_Func (void); \
659 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
660 __AROS_UFH_PREFIX t n##_Func(void) \
662 __AROS_UFHA(a1); \
663 __AROS_UFHA(a2);
665 #define AROS_UFH3(t,n,a1,a2,a3) \
666 __AROS_UFH_PREFIX t n##_Func (void); \
667 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
668 __AROS_UFH_PREFIX t n##_Func(void) \
670 __AROS_UFHA(a1); \
671 __AROS_UFHA(a2); \
672 __AROS_UFHA(a3);
674 #define AROS_UFH3S(t,n,a1,a2,a3) \
675 static __AROS_UFH_PREFIX t n##_Func (void); \
676 static const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
677 static __AROS_UFH_PREFIX t n##_Func(void) \
679 __AROS_UFHA(a1); \
680 __AROS_UFHA(a2); \
681 __AROS_UFHA(a3);
683 #define AROS_UFH4(t,n,a1,a2,a3,a4) \
684 __AROS_UFH_PREFIX t n##_Func (void); \
685 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
686 __AROS_UFH_PREFIX t n##_Func(void) \
688 __AROS_UFHA(a1); \
689 __AROS_UFHA(a2); \
690 __AROS_UFHA(a3); \
691 __AROS_UFHA(a4);
693 #define AROS_UFH5(t,n,a1,a2,a3,a4,a5) \
694 __AROS_UFH_PREFIX t n##_Func (void); \
695 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
696 __AROS_UFH_PREFIX t n##_Func(void) \
698 __AROS_UFHA(a1); \
699 __AROS_UFHA(a2); \
700 __AROS_UFHA(a3); \
701 __AROS_UFHA(a4); \
702 __AROS_UFHA(a5);
704 #define AROS_UFH5S(t,n,a1,a2,a3,a4,a5) \
705 __AROS_UFH_PREFIX static t n##_Func (void); \
706 static const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
707 __AROS_UFH_PREFIX static t n##_Func(void) \
709 __AROS_UFHA(a1); \
710 __AROS_UFHA(a2); \
711 __AROS_UFHA(a3); \
712 __AROS_UFHA(a4); \
713 __AROS_UFHA(a5);
715 #define AROS_UFH6(t,n,a1,a2,a3,a4,a5,a6) \
716 __AROS_UFH_PREFIX t n##_Func (void); \
717 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
718 __AROS_UFH_PREFIX t n##_Func(void) \
720 __AROS_UFHA(a1); \
721 __AROS_UFHA(a2); \
722 __AROS_UFHA(a3); \
723 __AROS_UFHA(a4); \
724 __AROS_UFHA(a5); \
725 __AROS_UFHA(a6);
727 #define AROS_UFH7(t,n,a1,a2,a3,a4,a5,a6,a7) \
728 __AROS_UFH_PREFIX t n##_Func (void); \
729 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
730 __AROS_UFH_PREFIX t n##_Func(void) \
732 __AROS_UFHA(a1); \
733 __AROS_UFHA(a2); \
734 __AROS_UFHA(a3); \
735 __AROS_UFHA(a4); \
736 __AROS_UFHA(a5); \
737 __AROS_UFHA(a6); \
738 __AROS_UFHA(a7);
740 #define AROS_UFH8(t,n,a1,a2,a3,a4,a5,a6,a7,a8) \
741 __AROS_UFH_PREFIX t n##_Func (void); \
742 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
743 __AROS_UFH_PREFIX t n##_Func(void) \
745 __AROS_UFHA(a1); \
746 __AROS_UFHA(a2); \
747 __AROS_UFHA(a3); \
748 __AROS_UFHA(a4); \
749 __AROS_UFHA(a5); \
750 __AROS_UFHA(a6); \
751 __AROS_UFHA(a7); \
752 __AROS_UFHA(a8);
754 #define AROS_UFH9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
755 __AROS_UFH_PREFIX t n##_Func (void); \
756 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
757 __AROS_UFH_PREFIX t n##_Func(void) \
759 __AROS_UFHA(a1); \
760 __AROS_UFHA(a2); \
761 __AROS_UFHA(a3); \
762 __AROS_UFHA(a4); \
763 __AROS_UFHA(a5); \
764 __AROS_UFHA(a6); \
765 __AROS_UFHA(a7); \
766 __AROS_UFHA(a8); \
767 __AROS_UFHA(a9);
769 #define AROS_UFH10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
770 __AROS_UFH_PREFIX t n##_Func (void); \
771 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
772 __AROS_UFH_PREFIX t n##_Func(void) \
774 __AROS_UFHA(a1); \
775 __AROS_UFHA(a2); \
776 __AROS_UFHA(a3); \
777 __AROS_UFHA(a4); \
778 __AROS_UFHA(a5); \
779 __AROS_UFHA(a6); \
780 __AROS_UFHA(a7); \
781 __AROS_UFHA(a8); \
782 __AROS_UFHA(a9); \
783 __AROS_UFHA(a10);
785 #define AROS_UFH11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) \
786 __AROS_UFH_PREFIX t n##_Func (void); \
787 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
788 __AROS_UFH_PREFIX t n##_Func(void) \
790 __AROS_UFHA(a1); \
791 __AROS_UFHA(a2); \
792 __AROS_UFHA(a3); \
793 __AROS_UFHA(a4); \
794 __AROS_UFHA(a5); \
795 __AROS_UFHA(a6); \
796 __AROS_UFHA(a7); \
797 __AROS_UFHA(a8); \
798 __AROS_UFHA(a9); \
799 __AROS_UFHA(a10); \
800 __AROS_UFHA(a11);
802 #define AROS_UFH12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) \
803 __AROS_UFH_PREFIX t n##_Func (void); \
804 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
805 __AROS_UFH_PREFIX t n##_Func(void) \
807 __AROS_UFHA(a1); \
808 __AROS_UFHA(a2); \
809 __AROS_UFHA(a3); \
810 __AROS_UFHA(a4); \
811 __AROS_UFHA(a5); \
812 __AROS_UFHA(a6); \
813 __AROS_UFHA(a7); \
814 __AROS_UFHA(a8); \
815 __AROS_UFHA(a9); \
816 __AROS_UFHA(a10); \
817 __AROS_UFHA(a11); \
818 __AROS_UFHA(a12);
820 #define AROS_UFH13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) \
821 __AROS_UFH_PREFIX t n##_Func (void); \
822 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
823 __AROS_UFH_PREFIX t n##_Func(void) \
825 __AROS_UFHA(a1); \
826 __AROS_UFHA(a2); \
827 __AROS_UFHA(a3); \
828 __AROS_UFHA(a4); \
829 __AROS_UFHA(a5); \
830 __AROS_UFHA(a6); \
831 __AROS_UFHA(a7); \
832 __AROS_UFHA(a8); \
833 __AROS_UFHA(a9); \
834 __AROS_UFHA(a10); \
835 __AROS_UFHA(a11); \
836 __AROS_UFHA(a12); \
837 __AROS_UFHA(a13);
839 #define AROS_UFH14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
840 __AROS_UFH_PREFIX t n##_Func (void); \
841 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
842 __AROS_UFH_PREFIX t n##_Func(void) \
844 __AROS_UFHA(a1); \
845 __AROS_UFHA(a2); \
846 __AROS_UFHA(a3); \
847 __AROS_UFHA(a4); \
848 __AROS_UFHA(a5); \
849 __AROS_UFHA(a6); \
850 __AROS_UFHA(a7); \
851 __AROS_UFHA(a8); \
852 __AROS_UFHA(a9); \
853 __AROS_UFHA(a10); \
854 __AROS_UFHA(a11); \
855 __AROS_UFHA(a12); \
856 __AROS_UFHA(a13); \
857 __AROS_UFHA(a14);
859 #define AROS_UFH15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) \
860 __AROS_UFH_PREFIX t n##_Func (void); \
861 const struct EmulLibEntry n##_Gate = { TRAP_LIB, 0, (void(*))n##_Func }; \
862 __AROS_UFH_PREFIX t n##_Func(void) \
864 __AROS_UFHA(a1); \
865 __AROS_UFHA(a2); \
866 __AROS_UFHA(a3); \
867 __AROS_UFHA(a4); \
868 __AROS_UFHA(a5); \
869 __AROS_UFHA(a6); \
870 __AROS_UFHA(a7); \
871 __AROS_UFHA(a8); \
872 __AROS_UFHA(a9); \
873 __AROS_UFHA(a10); \
874 __AROS_UFHA(a11); \
875 __AROS_UFHA(a12); \
876 __AROS_UFHA(a13); \
877 __AROS_UFHA(a14); \
878 __AROS_UFHA(a15);
880 /* Call a user function */
881 #define AROS_UFC0(t,n) \
882 ((t)MyEmulHandle->EmulCallDirect68k((APTR)(n)))
884 #define AROS_UFC1(t,n,a1) \
885 ({ \
886 __AROS_UFPA(a1); \
887 __AROS_UFCA(a1); \
888 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
891 #define AROS_UFC2(t,n,a1,a2) \
892 ({ \
893 __AROS_UFPA(a1); \
894 __AROS_UFPA(a2); \
895 __AROS_UFCA(a1); \
896 __AROS_UFCA(a2); \
897 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
900 #define AROS_UFC3(t,n,a1,a2,a3) \
901 ({ \
902 __AROS_UFPA(a1); \
903 __AROS_UFPA(a2); \
904 __AROS_UFPA(a3); \
905 __AROS_UFCA(a1); \
906 __AROS_UFCA(a2); \
907 __AROS_UFCA(a3); \
908 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
911 #define AROS_UFC4(t,n,a1,a2,a3,a4) \
912 ({ \
913 __AROS_UFPA(a1); \
914 __AROS_UFPA(a2); \
915 __AROS_UFPA(a3); \
916 __AROS_UFPA(a4); \
917 __AROS_UFCA(a1); \
918 __AROS_UFCA(a2); \
919 __AROS_UFCA(a3); \
920 __AROS_UFCA(a4); \
921 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
924 #define AROS_UFC5(t,n,a1,a2,a3,a4,a5) \
925 ({ \
926 __AROS_UFPA(a1); \
927 __AROS_UFPA(a2); \
928 __AROS_UFPA(a3); \
929 __AROS_UFPA(a4); \
930 __AROS_UFPA(a5); \
931 __AROS_UFCA(a1); \
932 __AROS_UFCA(a2); \
933 __AROS_UFCA(a3); \
934 __AROS_UFCA(a4); \
935 __AROS_UFCA(a5); \
936 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
939 #define AROS_UFC6(t,n,a1,a2,a3,a4,a5,a6) \
940 ({ \
941 __AROS_UFPA(a1); \
942 __AROS_UFPA(a2); \
943 __AROS_UFPA(a3); \
944 __AROS_UFPA(a4); \
945 __AROS_UFPA(a5); \
946 __AROS_UFPA(a6); \
947 __AROS_UFCA(a1); \
948 __AROS_UFCA(a2); \
949 __AROS_UFCA(a3); \
950 __AROS_UFCA(a4); \
951 __AROS_UFCA(a5); \
952 __AROS_UFCA(a6); \
953 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
956 #define AROS_UFC7(t,n,a1,a2,a3,a4,a5,a6,a7) \
957 ({ \
958 __AROS_UFPA(a1); \
959 __AROS_UFPA(a2); \
960 __AROS_UFPA(a3); \
961 __AROS_UFPA(a4); \
962 __AROS_UFPA(a5); \
963 __AROS_UFPA(a6); \
964 __AROS_UFPA(a7); \
965 __AROS_UFCA(a1); \
966 __AROS_UFCA(a2); \
967 __AROS_UFCA(a3); \
968 __AROS_UFCA(a4); \
969 __AROS_UFCA(a5); \
970 __AROS_UFCA(a6); \
971 __AROS_UFCA(a7); \
972 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
975 #define AROS_UFC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8) \
976 ({ \
977 __AROS_UFPA(a1); \
978 __AROS_UFPA(a2); \
979 __AROS_UFPA(a3); \
980 __AROS_UFPA(a4); \
981 __AROS_UFPA(a5); \
982 __AROS_UFPA(a6); \
983 __AROS_UFPA(a7); \
984 __AROS_UFPA(a8); \
985 __AROS_UFCA(a1); \
986 __AROS_UFCA(a2); \
987 __AROS_UFCA(a3); \
988 __AROS_UFCA(a4); \
989 __AROS_UFCA(a5); \
990 __AROS_UFCA(a6); \
991 __AROS_UFCA(a7); \
992 __AROS_UFCA(a8); \
993 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
996 #define AROS_UFC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
997 ({ \
998 __AROS_UFPA(a1); \
999 __AROS_UFPA(a2); \
1000 __AROS_UFPA(a3); \
1001 __AROS_UFPA(a4); \
1002 __AROS_UFPA(a5); \
1003 __AROS_UFPA(a6); \
1004 __AROS_UFPA(a7); \
1005 __AROS_UFPA(a8); \
1006 __AROS_UFPA(a9); \
1007 __AROS_UFCA(a1); \
1008 __AROS_UFCA(a2); \
1009 __AROS_UFCA(a3); \
1010 __AROS_UFCA(a4); \
1011 __AROS_UFCA(a5); \
1012 __AROS_UFCA(a6); \
1013 __AROS_UFCA(a7); \
1014 __AROS_UFCA(a8); \
1015 __AROS_UFCA(a9); \
1016 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1019 #define AROS_UFC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
1020 ({ \
1021 __AROS_UFPA(a1); \
1022 __AROS_UFPA(a2); \
1023 __AROS_UFPA(a3); \
1024 __AROS_UFPA(a4); \
1025 __AROS_UFPA(a5); \
1026 __AROS_UFPA(a6); \
1027 __AROS_UFPA(a7); \
1028 __AROS_UFPA(a8); \
1029 __AROS_UFPA(a9); \
1030 __AROS_UFPA(a10); \
1031 __AROS_UFCA(a1); \
1032 __AROS_UFCA(a2); \
1033 __AROS_UFCA(a3); \
1034 __AROS_UFCA(a4); \
1035 __AROS_UFCA(a5); \
1036 __AROS_UFCA(a6); \
1037 __AROS_UFCA(a7); \
1038 __AROS_UFCA(a8); \
1039 __AROS_UFCA(a9); \
1040 __AROS_UFCA(a10); \
1041 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1044 #define AROS_UFC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) \
1045 ({ \
1046 __AROS_UFPA(a1); \
1047 __AROS_UFPA(a2); \
1048 __AROS_UFPA(a3); \
1049 __AROS_UFPA(a4); \
1050 __AROS_UFPA(a5); \
1051 __AROS_UFPA(a6); \
1052 __AROS_UFPA(a7); \
1053 __AROS_UFPA(a8); \
1054 __AROS_UFPA(a9); \
1055 __AROS_UFPA(a10); \
1056 __AROS_UFPA(a11); \
1057 __AROS_UFCA(a1); \
1058 __AROS_UFCA(a2); \
1059 __AROS_UFCA(a3); \
1060 __AROS_UFCA(a4); \
1061 __AROS_UFCA(a5); \
1062 __AROS_UFCA(a6); \
1063 __AROS_UFCA(a7); \
1064 __AROS_UFCA(a8); \
1065 __AROS_UFCA(a9); \
1066 __AROS_UFCA(a10); \
1067 __AROS_UFCA(a11); \
1068 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1071 #define AROS_UFC12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) \
1072 ({ \
1073 __AROS_UFPA(a1); \
1074 __AROS_UFPA(a2); \
1075 __AROS_UFPA(a3); \
1076 __AROS_UFPA(a4); \
1077 __AROS_UFPA(a5); \
1078 __AROS_UFPA(a6); \
1079 __AROS_UFPA(a7); \
1080 __AROS_UFPA(a8); \
1081 __AROS_UFPA(a9); \
1082 __AROS_UFPA(a10); \
1083 __AROS_UFPA(a11); \
1084 __AROS_UFPA(a12); \
1085 __AROS_UFCA(a1); \
1086 __AROS_UFCA(a2); \
1087 __AROS_UFCA(a3); \
1088 __AROS_UFCA(a4); \
1089 __AROS_UFCA(a5); \
1090 __AROS_UFCA(a6); \
1091 __AROS_UFCA(a7); \
1092 __AROS_UFCA(a8); \
1093 __AROS_UFCA(a9); \
1094 __AROS_UFCA(a10); \
1095 __AROS_UFCA(a11); \
1096 __AROS_UFCA(a12); \
1097 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1100 #define AROS_UFC13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) \
1101 ({ \
1102 __AROS_UFPA(a1); \
1103 __AROS_UFPA(a2); \
1104 __AROS_UFPA(a3); \
1105 __AROS_UFPA(a4); \
1106 __AROS_UFPA(a5); \
1107 __AROS_UFPA(a6); \
1108 __AROS_UFPA(a7); \
1109 __AROS_UFPA(a8); \
1110 __AROS_UFPA(a9); \
1111 __AROS_UFPA(a10); \
1112 __AROS_UFPA(a11); \
1113 __AROS_UFPA(a12); \
1114 __AROS_UFPA(a13); \
1115 __AROS_UFCA(a1); \
1116 __AROS_UFCA(a2); \
1117 __AROS_UFCA(a3); \
1118 __AROS_UFCA(a4); \
1119 __AROS_UFCA(a5); \
1120 __AROS_UFCA(a6); \
1121 __AROS_UFCA(a7); \
1122 __AROS_UFCA(a8); \
1123 __AROS_UFCA(a9); \
1124 __AROS_UFCA(a10); \
1125 __AROS_UFCA(a11); \
1126 __AROS_UFCA(a12); \
1127 __AROS_UFCA(a13); \
1128 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1131 #define AROS_UFC14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
1132 ({ \
1133 __AROS_UFPA(a1); \
1134 __AROS_UFPA(a2); \
1135 __AROS_UFPA(a3); \
1136 __AROS_UFPA(a4); \
1137 __AROS_UFPA(a5); \
1138 __AROS_UFPA(a6); \
1139 __AROS_UFPA(a7); \
1140 __AROS_UFPA(a8); \
1141 __AROS_UFPA(a9); \
1142 __AROS_UFPA(a10); \
1143 __AROS_UFPA(a11); \
1144 __AROS_UFPA(a12); \
1145 __AROS_UFPA(a13); \
1146 __AROS_UFPA(a14); \
1147 __AROS_UFCA(a1); \
1148 __AROS_UFCA(a2); \
1149 __AROS_UFCA(a3); \
1150 __AROS_UFCA(a4); \
1151 __AROS_UFCA(a5); \
1152 __AROS_UFCA(a6); \
1153 __AROS_UFCA(a7); \
1154 __AROS_UFCA(a8); \
1155 __AROS_UFCA(a9); \
1156 __AROS_UFCA(a10); \
1157 __AROS_UFCA(a11); \
1158 __AROS_UFCA(a12); \
1159 __AROS_UFCA(a13); \
1160 __AROS_UFCA(a14); \
1161 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1164 #define AROS_UFC15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) \
1165 ({ \
1166 __AROS_UFPA(a1); \
1167 __AROS_UFPA(a2); \
1168 __AROS_UFPA(a3); \
1169 __AROS_UFPA(a4); \
1170 __AROS_UFPA(a5); \
1171 __AROS_UFPA(a6); \
1172 __AROS_UFPA(a7); \
1173 __AROS_UFPA(a8); \
1174 __AROS_UFPA(a9); \
1175 __AROS_UFPA(a10); \
1176 __AROS_UFPA(a11); \
1177 __AROS_UFPA(a12); \
1178 __AROS_UFPA(a13); \
1179 __AROS_UFPA(a14); \
1180 __AROS_UFPA(a15); \
1181 __AROS_UFCA(a1); \
1182 __AROS_UFCA(a2); \
1183 __AROS_UFCA(a3); \
1184 __AROS_UFCA(a4); \
1185 __AROS_UFCA(a5); \
1186 __AROS_UFCA(a6); \
1187 __AROS_UFCA(a7); \
1188 __AROS_UFCA(a8); \
1189 __AROS_UFCA(a9); \
1190 __AROS_UFCA(a10); \
1191 __AROS_UFCA(a11); \
1192 __AROS_UFCA(a12); \
1193 __AROS_UFCA(a13); \
1194 __AROS_UFCA(a14); \
1195 __AROS_UFCA(a15); \
1196 (t)MyEmulHandle->EmulCallDirect68k((APTR)(n)); \
1199 #endif /* !(UseRegisterArgs && defined(AROS_COMPILER_NO_REGARGS)) */
1201 /* Prototypes for user functions */
1202 # define AROS_UFP0(t,n) \
1203 extern const struct EmulLibEntry n##_Gate;
1205 # define AROS_UFP1(t,n,a1) \
1206 extern const struct EmulLibEntry n##_Gate;
1208 # define AROS_UFP2(t,n,a1,a2) \
1209 extern const struct EmulLibEntry n##_Gate;
1211 # define AROS_UFP3(t,n,a1,a2,a3) \
1212 extern const struct EmulLibEntry n##_Gate;
1214 # define AROS_UFP3S(t,n,a1,a2,a3) \
1215 extern const struct EmulLibEntry n##_Gate;
1217 # define AROS_UFP4(t,n,a1,a2,a3,a4) \
1218 const struct EmulLibEntry Xj(n,_Gate);
1220 # define AROS_UFP5(t,n,a1,a2,a3,a4,a5) \
1221 extern const struct EmulLibEntry n##_Gate;
1223 # define AROS_UFP5S(t,n,a1,a2,a3,a4,a5) \
1224 extern const struct EmulLibEntry n##_Gate;
1225 # define AROS_UFP6(t,n,a1,a2,a3,a4,a5,a6) \
1226 extern const struct EmulLibEntry n##_Gate;
1228 # define AROS_UFP7(t,n,a1,a2,a3,a4,a5,a6,a7) \
1229 extern const struct EmulLibEntry n##_Gate;
1231 # define AROS_UFP8(t,n,a1,a2,a3,a4,a5,a6,a7,a8) \
1232 extern const struct EmulLibEntry n##_Gate;
1234 # define AROS_UFP9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
1235 extern const struct EmulLibEntry n##_Gate;
1237 # define AROS_UFP10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
1238 extern const struct EmulLibEntry n##_Gate;
1240 # define AROS_UFP11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) \
1241 extern const struct EmulLibEntry n##_Gate;
1243 # define AROS_UFP12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) \
1244 extern const struct EmulLibEntry n##_Gate;
1246 # define AROS_UFP13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) \
1247 extern const struct EmulLibEntry n##_Gate;
1249 # define AROS_UFP14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
1250 extern const struct EmulLibEntry n##_Gate;
1252 # define AROS_UFP15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) \
1253 extern const struct EmulLibEntry n##_Gate;
1255 #endif /* AROS_MORPHOS_CPU_H */