Don't print warning about unassigned interrupt lines on bridges.
[AROS.git] / arch / .unmaintained / m68k-linux / machine.h
blobd30503abcc555c312cd6cb0b91b849f7cfee8220
1 #ifndef AROS_MACHINE_H
2 #define AROS_MACHINE_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 NOTE: This file must compile *without* any other header !
10 Desc: machine.h include file for Linux/m68k (and others?)
11 Lang: english
14 /* We want register args, and LVOs */
15 #define UseRegisterArgs 1
16 #define EnableSetFunction 1
17 /*
18 We want full AmigaOS compatibility. When calling obtainsemaphore,
19 obtainsemaphoreshared, releasesemaphore, getcc, permit, forbid,
20 enable, disable and getcc *all* Registers need to be preserved.
21 But due to the gnu c-compiler we only have to preserve d0,d1,a0,a1.
22 UseExecstubs has to be defined when UseRegisterArgs is used!
24 #if UseRegisterArgs
25 #undef UseExecstubs
26 #define UseExecstubs 1
27 #endif
29 /* Linux/m68k gcc has no register args capabilities */
30 #define AROS_COMPILER_NO_REGARGS
32 /* Information generated by machine.c */
33 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
34 #define AROS_BIG_ENDIAN 1 /* Big or little endian */
35 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
36 #define AROS_WORDALIGN 2 /* Alignment for WORD */
37 #define AROS_LONGALIGN 2 /* Alignment for LONG */
38 #define AROS_PTRALIGN 2 /* Alignment for PTR */
39 #define AROS_IPTRALIGN 2 /* Alignment for IPTR */
40 #define AROS_DOUBLEALIGN 2 /* Alignment for double */
41 #define AROS_WORSTALIGN 8 /* Worst case alignment */
43 #define AROS_GET_SYSBASE extern struct ExecBase * SysBase;
44 #define AROS_GET_DOSBASE extern struct DosLibrary * DOSBase;
45 #define AROS_GET_SYSBASE_OK extern struct ExecBase * SysBase;
47 /* do we need a function attribute to get parameters on the stack? */
48 #define __stackparm
50 register unsigned char * AROS_GET_SP asm("%sp");
53 How much do I have to add to sp to get the address of the first
54 byte on the stack?
56 #define SP_OFFSET 0
59 Retain binary compatibility with AmigaOS.
60 Comment this out if you want APTRs.
62 #define AROS_BSTR_TYPE long
63 #define AROS_BPTR_TYPE long
64 #define MKBADDR(a) (((LONG)(a)) >> 2)
65 #define BADDR(a) ((APTR)((ULONG)(a) << 2))
67 /* For debugging only: Pass errnos from the emulated OS. dos/Fault() will
68 recognise them */
69 #undef PassThroughErrnos
70 #define PassThroughErrnos 0x40000000
72 /* Linux/m68k seems to set bit 31 in all memory allocations, so
73 default AllocEntry() checking goes wrong. */
74 #if 0
75 #define AROS_ALLOCENTRY_FAILED(memType) \
76 ((struct MemList *)NULL)
77 #define AROS_CHECK_ALLOCENTRY(memList) \
78 ((APTR)(memList) != NULL)
79 #else
80 /* It works now because of a nice trick :) */
81 #define AROS_ALLOCENTRY_FAILED(memType) \
82 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
83 #define AROS_CHECK_ALLOCENTRY(memList) \
84 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
85 #endif
88 One entry in a libraries' jumptable. For assembler compatibility, the
89 field jmp should contain the code for an absolute jmp to a 32bit
90 address. There are also a couple of macros which you should use to
91 access the vector table from C.
93 struct JumpVec
95 unsigned short jmp;
96 unsigned char vec[4];
99 /* Internal macros */
100 #define __AROS_ASMJMP 0x4EF9
101 #define __AROS_SET_VEC(v,a) (*(ULONG*)(v)->vec=(ULONG)(a))
103 #define __AROS_GET_VEC(v) ((APTR)(*(ULONG*)(v)->vec))
105 /* Use these to acces a vector table */
106 #define LIB_VECTSIZE (sizeof (struct JumpVec))
107 #define __AROS_GETJUMPVEC(lib,n) ((struct JumpVec *)(((UBYTE *)lib)-(n*LIB_VECTSIZE)))
108 #define __AROS_GETVECADDR(lib,n) (__AROS_GET_VEC(__AROS_GETJUMPVEC(lib,n)))
109 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_SET_VEC(__AROS_GETJUMPVEC(lib,n),(APTR)(addr)))
110 #define __AROS_INITVEC(lib,n) __AROS_GETJUMPVEC(lib,n)->jmp = __AROS_ASMJMP, \
111 __AROS_SETVECADDR(lib,n,_aros_not_implemented)
114 Find the next valid alignment for a structure if the next x bytes must
115 be skipped.
117 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
119 /* Prototypes */
120 extern void _aros_not_implemented (char *X);
122 /* How much stack do we need ? Lots :-) */
123 #define AROS_STACKSIZE 20000
125 /* How to map function arguments to CPU registers */
127 /* The registers */
128 #define D0 "%d0"
129 #define D1 "%d1"
130 #define D2 "%d2"
131 #define D3 "%d3"
132 #define D4 "%d4"
133 #define D5 "%d5"
134 #define D6 "%d6"
135 #define D7 "%d7"
136 #define A0 "%a0"
137 #define A1 "%a1"
138 #define A2 "%a2"
139 #define A3 "%a3"
140 #define A4 "%a4"
141 #define A5 "%a5"
142 #define A6 "%a6"
144 /* What to do with the library base in header, prototype and call */
145 #define __AROS_LH_BASE(basetype,basename) basetype basename
146 #define __AROS_LP_BASE(basetype,basename) basetype
147 #define __AROS_LC_BASE(basetype,basename) basename
148 #define __AROS_LD_BASE(basetype,basename) basetype
150 /* How to transform an argument in header, prototype and call */
151 #define __AROS_LHA(type,name,reg) type name
152 #define __AROS_LPA(type,name,reg) type
153 #define __AROS_LCA(type,name,reg) name
154 #define __AROS_LDA(type,name,reg) type
155 #define __AROS_UFHA(type,name,reg) type name
156 #define __AROS_UFPA(type,name,reg) type
157 #define __AROS_UFCA(type,name,reg) name
158 #define __AROS_UFDA(type,name,reg) type
159 #define __AROS_LHAQUAD(type,name,reg1,reg2) type name
160 #define __AROS_LPAQUAD(type,name,reg1,reg2) type
161 #define __AROS_LCAQUAD(type,name,reg1,reg2) name
163 /* Prefix for library function in header, prototype and call */
164 #define __AROS_LH_PREFIX /* eps */
165 #define __AROS_LP_PREFIX /* eps */
166 #define __AROS_LC_PREFIX /* eps */
167 #define __AROS_LD_PREFIX /* eps */
168 #define __AROS_UFH_PREFIX /* eps */
169 #define __AROS_UFP_PREFIX /* eps */
170 #define __AROS_UFC_PREFIX /* eps */
171 #define __AROS_UFD_PREFIX /* eps */
173 /* if this is defined, all AROS_LP*-macros will expand to nothing. */
174 #define __AROS_USE_MACROS_FOR_LIBCALL
176 #if UseRegisterArgs
177 /* We need to redefine all the macros for use with Linux/m68k gcc */
179 #define AROS_SLIB_ENTRY_S(n,s) #s "_" #n
181 #define AROS_SLIB_ENTRY_U(n,s) _ ## s ## _ ## n
183 #define __ASM_PREFIX(name,system) \
184 __asm__(".text\n\t.align 2\n\t"\
185 ".globl "## AROS_SLIB_ENTRY_S(name,system) ##"\n\t"\
186 ".type\t"## AROS_SLIB_ENTRY_S(name,system) ##",@function\n"\
187 AROS_SLIB_ENTRY_S(name,system) ##":\n\t"\
188 "move.l %a6,-(%sp)\n\t"
191 #define __ASM_PREFIXI(name,system) \
192 __asm__(".text\n\t.align 2\n\t"\
193 ".globl "## AROS_SLIB_ENTRY_S(name,system) ##"\n\t"\
194 ".type\t"## AROS_SLIB_ENTRY_S(name,system) ##",@function\n"\
195 AROS_SLIB_ENTRY_S(name,system) ##":\n\t"
198 #define __ASM_ARG(type, name, reg) \
199 "move.l "## reg ##",-(%sp)\n\t"
201 #define __ASM_ARGQUAD1(type, name, reg1, reg2) \
202 "move.l "## reg2 ##",-(%sp)\n\t"
203 #define __ASM_ARGQUAD2(type, name, reg1, reg2) \
204 "move.l "## reg1 ##",-(%sp)\n\t"
206 #ifdef __PIC__
207 #define __ASM_POSTFIX(type,name,system,argc) \
208 "bsr.l _"## AROS_SLIB_ENTRY_S(name,system) ##"@PLTPC\n\t"\
209 "add.w #4*" #argc "+4,%sp\n\t"\
210 "rts\n\t"\
211 ".size "## AROS_SLIB_ENTRY_S(name,system) ##",.-"\
212 ## AROS_SLIB_ENTRY_S(name,system) );\
213 __AROS_LH_PREFIX static type AROS_SLIB_ENTRY(name,_##system)(
214 #else
215 #define __ASM_POSTFIX(type,name,system,argc) \
216 "jbsr _"## AROS_SLIB_ENTRY_S(name,system) ##"\n\t"\
217 "add.w #4*" #argc "+4,%sp\n\t"\
218 "rts\n\t"\
219 ".size "## AROS_SLIB_ENTRY_S(name,system) ##",.-"\
220 ## AROS_SLIB_ENTRY_S(name,system) );\
221 __AROS_LH_PREFIX static type AROS_SLIB_ENTRY(name,_##system)(
222 #endif
224 #ifdef __PIC__
225 #define __ASM_POSTFIXI(type,name,system,argc) \
226 "bsr.l _"## AROS_SLIB_ENTRY_S(name,system) ##"@PLTPC\n\t"\
227 "add.w #4*" #argc ",%sp\n\t"\
228 "rts\n\t"\
229 ".size "## AROS_SLIB_ENTRY_S(name,system) ##",.-"\
230 ## AROS_SLIB_ENTRY_S(name,system) );\
231 __AROS_LH_PREFIX static type AROS_SLIB_ENTRY(name,_##system)(
232 #else
233 #define __ASM_POSTFIXI(type,name,system,argc) \
234 "jbsr _"## AROS_SLIB_ENTRY_S(name,system) ##"\n\t"\
235 "add.w #4*" #argc ",%sp\n\t"\
236 "rts\n\t"\
237 ".size "## AROS_SLIB_ENTRY_S(name,system) ##",.-"\
238 ## AROS_SLIB_ENTRY_S(name,system) );\
239 __AROS_LH_PREFIX static type AROS_SLIB_ENTRY(name,_##system)(
240 #endif
242 #define AROS_LHQUAD1(t,n,a1,bt,bn,o,s) \
243 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
244 __AROS_LPAQUAD(a1),\
245 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
246 __ASM_PREFIX(n,s)\
247 __ASM_ARGQUAD1(a1)\
248 __ASM_ARGQUAD2(a1)\
249 __ASM_POSTFIX(t,n,s,2)\
250 __AROS_LHAQUAD(a1),\
251 __AROS_LH_BASE(bt,bn))
253 #define AROS_LHQUAD2(t,n,a1,a2,bt,bn,o,s) \
254 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
255 __AROS_LPAQUAD(a1),\
256 __AROS_LPAQUAD(a2),\
257 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
258 __ASM_PREFIX(n,s)\
259 __ASM_ARGQUAD1(a2)\
260 __ASM_ARGQUAD2(a2)\
261 __ASM_ARGQUAD1(a1)\
262 __ASM_ARGQUAD2(a1)\
263 __ASM_POSTFIX(t,n,s,4)\
264 __AROS_LHAQUAD(a1),\
265 __AROS_LHAQUAD(a2),\
266 __AROS_LH_BASE(bt,bn))
268 #define AROS_LH0(t,n,bt,bn,o,s) \
269 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
270 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
271 __ASM_PREFIX(n,s)\
272 __ASM_POSTFIX(t,n,s,0)\
273 __AROS_LH_BASE(bt,bn))
275 #define AROS_LH1(t,n,a1,bt,bn,o,s) \
276 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
277 __AROS_LPA(a1),\
278 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
279 __ASM_PREFIX(n,s)\
280 __ASM_ARG(a1)\
281 __ASM_POSTFIX(t,n,s,1)\
282 __AROS_LHA(a1),\
283 __AROS_LH_BASE(bt,bn))
285 #define AROS_LH2(t,n,a1,a2,bt,bn,o,s) \
286 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
287 __AROS_LPA(a1),\
288 __AROS_LPA(a2),\
289 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
290 __ASM_PREFIX(n,s)\
291 __ASM_ARG(a2)\
292 __ASM_ARG(a1)\
293 __ASM_POSTFIX(t,n,s,2)\
294 __AROS_LHA(a1),\
295 __AROS_LHA(a2),\
296 __AROS_LH_BASE(bt,bn))
298 #define AROS_LH3(t,n,a1,a2,a3,bt,bn,o,s) \
299 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
300 __AROS_LPA(a1),\
301 __AROS_LPA(a2),\
302 __AROS_LPA(a3),\
303 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
304 __ASM_PREFIX(n,s)\
305 __ASM_ARG(a3)\
306 __ASM_ARG(a2)\
307 __ASM_ARG(a1)\
308 __ASM_POSTFIX(t,n,s,3)\
309 __AROS_LHA(a1),\
310 __AROS_LHA(a2),\
311 __AROS_LHA(a3),\
312 __AROS_LH_BASE(bt,bn))
314 #define AROS_LH4(t,n,a1,a2,a3,a4,bt,bn,o,s) \
315 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
316 __AROS_LPA(a1),\
317 __AROS_LPA(a2),\
318 __AROS_LPA(a3),\
319 __AROS_LPA(a4),\
320 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
321 __ASM_PREFIX(n,s)\
322 __ASM_ARG(a4)\
323 __ASM_ARG(a3)\
324 __ASM_ARG(a2)\
325 __ASM_ARG(a1)\
326 __ASM_POSTFIX(t,n,s,4)\
327 __AROS_LHA(a1),\
328 __AROS_LHA(a2),\
329 __AROS_LHA(a3),\
330 __AROS_LHA(a4),\
331 __AROS_LH_BASE(bt,bn))
333 #define AROS_LH5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \
334 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
335 __AROS_LPA(a1),\
336 __AROS_LPA(a2),\
337 __AROS_LPA(a3),\
338 __AROS_LPA(a4),\
339 __AROS_LPA(a5),\
340 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
341 __ASM_PREFIX(n,s)\
342 __ASM_ARG(a5)\
343 __ASM_ARG(a4)\
344 __ASM_ARG(a3)\
345 __ASM_ARG(a2)\
346 __ASM_ARG(a1)\
347 __ASM_POSTFIX(t,n,s,5)\
348 __AROS_LHA(a1),\
349 __AROS_LHA(a2),\
350 __AROS_LHA(a3),\
351 __AROS_LHA(a4),\
352 __AROS_LHA(a5),\
353 __AROS_LH_BASE(bt,bn))
355 #define AROS_LH6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
356 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
357 __AROS_LPA(a1),\
358 __AROS_LPA(a2),\
359 __AROS_LPA(a3),\
360 __AROS_LPA(a4),\
361 __AROS_LPA(a5),\
362 __AROS_LPA(a6),\
363 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
364 __ASM_PREFIX(n,s)\
365 __ASM_ARG(a6)\
366 __ASM_ARG(a5)\
367 __ASM_ARG(a4)\
368 __ASM_ARG(a3)\
369 __ASM_ARG(a2)\
370 __ASM_ARG(a1)\
371 __ASM_POSTFIX(t,n,s,6)\
372 __AROS_LHA(a1),\
373 __AROS_LHA(a2),\
374 __AROS_LHA(a3),\
375 __AROS_LHA(a4),\
376 __AROS_LHA(a5),\
377 __AROS_LHA(a6),\
378 __AROS_LH_BASE(bt,bn))
380 #define AROS_LH7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
381 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
382 __AROS_LPA(a1),\
383 __AROS_LPA(a2),\
384 __AROS_LPA(a3),\
385 __AROS_LPA(a4),\
386 __AROS_LPA(a5),\
387 __AROS_LPA(a6),\
388 __AROS_LPA(a7),\
389 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
390 __ASM_PREFIX(n,s)\
391 __ASM_ARG(a7)\
392 __ASM_ARG(a6)\
393 __ASM_ARG(a5)\
394 __ASM_ARG(a4)\
395 __ASM_ARG(a3)\
396 __ASM_ARG(a2)\
397 __ASM_ARG(a1)\
398 __ASM_POSTFIX(t,n,s,7)\
399 __AROS_LHA(a1),\
400 __AROS_LHA(a2),\
401 __AROS_LHA(a3),\
402 __AROS_LHA(a4),\
403 __AROS_LHA(a5),\
404 __AROS_LHA(a6),\
405 __AROS_LHA(a7),\
406 __AROS_LH_BASE(bt,bn))
408 #define AROS_LH8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
409 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
410 __AROS_LPA(a1),\
411 __AROS_LPA(a2),\
412 __AROS_LPA(a3),\
413 __AROS_LPA(a4),\
414 __AROS_LPA(a5),\
415 __AROS_LPA(a6),\
416 __AROS_LPA(a7),\
417 __AROS_LPA(a8),\
418 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
419 __ASM_PREFIX(n,s)\
420 __ASM_ARG(a8)\
421 __ASM_ARG(a7)\
422 __ASM_ARG(a6)\
423 __ASM_ARG(a5)\
424 __ASM_ARG(a4)\
425 __ASM_ARG(a3)\
426 __ASM_ARG(a2)\
427 __ASM_ARG(a1)\
428 __ASM_POSTFIX(t,n,s,8)\
429 __AROS_LHA(a1),\
430 __AROS_LHA(a2),\
431 __AROS_LHA(a3),\
432 __AROS_LHA(a4),\
433 __AROS_LHA(a5),\
434 __AROS_LHA(a6),\
435 __AROS_LHA(a7),\
436 __AROS_LHA(a8),\
437 __AROS_LH_BASE(bt,bn))
439 #define AROS_LH9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
440 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
441 __AROS_LPA(a1),\
442 __AROS_LPA(a2),\
443 __AROS_LPA(a3),\
444 __AROS_LPA(a4),\
445 __AROS_LPA(a5),\
446 __AROS_LPA(a6),\
447 __AROS_LPA(a7),\
448 __AROS_LPA(a8),\
449 __AROS_LPA(a9),\
450 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
451 __ASM_PREFIX(n,s)\
452 __ASM_ARG(a9)\
453 __ASM_ARG(a8)\
454 __ASM_ARG(a7)\
455 __ASM_ARG(a6)\
456 __ASM_ARG(a5)\
457 __ASM_ARG(a4)\
458 __ASM_ARG(a3)\
459 __ASM_ARG(a2)\
460 __ASM_ARG(a1)\
461 __ASM_POSTFIX(t,n,s,9)\
462 __AROS_LHA(a1),\
463 __AROS_LHA(a2),\
464 __AROS_LHA(a3),\
465 __AROS_LHA(a4),\
466 __AROS_LHA(a5),\
467 __AROS_LHA(a6),\
468 __AROS_LHA(a7),\
469 __AROS_LHA(a8),\
470 __AROS_LHA(a9),\
471 __AROS_LH_BASE(bt,bn))
473 #define AROS_LH10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
474 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
475 __AROS_LPA(a1),\
476 __AROS_LPA(a2),\
477 __AROS_LPA(a3),\
478 __AROS_LPA(a4),\
479 __AROS_LPA(a5),\
480 __AROS_LPA(a6),\
481 __AROS_LPA(a7),\
482 __AROS_LPA(a8),\
483 __AROS_LPA(a9),\
484 __AROS_LPA(a10),\
485 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
486 __ASM_PREFIX(n,s)\
487 __ASM_ARG(a10)\
488 __ASM_ARG(a9)\
489 __ASM_ARG(a8)\
490 __ASM_ARG(a7)\
491 __ASM_ARG(a6)\
492 __ASM_ARG(a5)\
493 __ASM_ARG(a4)\
494 __ASM_ARG(a3)\
495 __ASM_ARG(a2)\
496 __ASM_ARG(a1)\
497 __ASM_POSTFIX(t,n,s,10)\
498 __AROS_LHA(a1),\
499 __AROS_LHA(a2),\
500 __AROS_LHA(a3),\
501 __AROS_LHA(a4),\
502 __AROS_LHA(a5),\
503 __AROS_LHA(a6),\
504 __AROS_LHA(a7),\
505 __AROS_LHA(a8),\
506 __AROS_LHA(a9),\
507 __AROS_LHA(a10),\
508 __AROS_LH_BASE(bt,bn))
510 #define AROS_LH11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
511 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
512 __AROS_LPA(a1),\
513 __AROS_LPA(a2),\
514 __AROS_LPA(a3),\
515 __AROS_LPA(a4),\
516 __AROS_LPA(a5),\
517 __AROS_LPA(a6),\
518 __AROS_LPA(a7),\
519 __AROS_LPA(a8),\
520 __AROS_LPA(a9),\
521 __AROS_LPA(a10),\
522 __AROS_LPA(a11),\
523 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
524 __ASM_PREFIX(n,s)\
525 __ASM_ARG(a11)\
526 __ASM_ARG(a10)\
527 __ASM_ARG(a9)\
528 __ASM_ARG(a8)\
529 __ASM_ARG(a7)\
530 __ASM_ARG(a6)\
531 __ASM_ARG(a5)\
532 __ASM_ARG(a4)\
533 __ASM_ARG(a3)\
534 __ASM_ARG(a2)\
535 __ASM_ARG(a1)\
536 __ASM_POSTFIX(t,n,s,11)\
537 __AROS_LHA(a1),\
538 __AROS_LHA(a2),\
539 __AROS_LHA(a3),\
540 __AROS_LHA(a4),\
541 __AROS_LHA(a5),\
542 __AROS_LHA(a6),\
543 __AROS_LHA(a7),\
544 __AROS_LHA(a8),\
545 __AROS_LHA(a9),\
546 __AROS_LHA(a10),\
547 __AROS_LHA(a11),\
548 __AROS_LH_BASE(bt,bn))
550 #define AROS_LH12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \
551 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
552 __AROS_LPA(a1),\
553 __AROS_LPA(a2),\
554 __AROS_LPA(a3),\
555 __AROS_LPA(a4),\
556 __AROS_LPA(a5),\
557 __AROS_LPA(a6),\
558 __AROS_LPA(a7),\
559 __AROS_LPA(a8),\
560 __AROS_LPA(a9),\
561 __AROS_LPA(a10),\
562 __AROS_LPA(a11),\
563 __AROS_LPA(a12),\
564 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
565 __ASM_PREFIX(n,s)\
566 __ASM_ARG(a12)\
567 __ASM_ARG(a11)\
568 __ASM_ARG(a10)\
569 __ASM_ARG(a9)\
570 __ASM_ARG(a8)\
571 __ASM_ARG(a7)\
572 __ASM_ARG(a6)\
573 __ASM_ARG(a5)\
574 __ASM_ARG(a4)\
575 __ASM_ARG(a3)\
576 __ASM_ARG(a2)\
577 __ASM_ARG(a1)\
578 __ASM_POSTFIX(t,n,s,12)\
579 __AROS_LHA(a1),\
580 __AROS_LHA(a2),\
581 __AROS_LHA(a3),\
582 __AROS_LHA(a4),\
583 __AROS_LHA(a5),\
584 __AROS_LHA(a6),\
585 __AROS_LHA(a7),\
586 __AROS_LHA(a8),\
587 __AROS_LHA(a9),\
588 __AROS_LHA(a10),\
589 __AROS_LHA(a11),\
590 __AROS_LHA(a12),\
591 __AROS_LH_BASE(bt,bn))
593 #define AROS_LH13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \
594 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
595 __AROS_LPA(a1),\
596 __AROS_LPA(a2),\
597 __AROS_LPA(a3),\
598 __AROS_LPA(a4),\
599 __AROS_LPA(a5),\
600 __AROS_LPA(a6),\
601 __AROS_LPA(a7),\
602 __AROS_LPA(a8),\
603 __AROS_LPA(a9),\
604 __AROS_LPA(a10),\
605 __AROS_LPA(a11),\
606 __AROS_LPA(a12),\
607 __AROS_LPA(a13),\
608 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
609 __ASM_PREFIX(n,s)\
610 __ASM_ARG(a13)\
611 __ASM_ARG(a12)\
612 __ASM_ARG(a11)\
613 __ASM_ARG(a10)\
614 __ASM_ARG(a9)\
615 __ASM_ARG(a8)\
616 __ASM_ARG(a7)\
617 __ASM_ARG(a6)\
618 __ASM_ARG(a5)\
619 __ASM_ARG(a4)\
620 __ASM_ARG(a3)\
621 __ASM_ARG(a2)\
622 __ASM_ARG(a1)\
623 __ASM_POSTFIX(t,n,s,13)\
624 __AROS_LHA(a1),\
625 __AROS_LHA(a2),\
626 __AROS_LHA(a3),\
627 __AROS_LHA(a4),\
628 __AROS_LHA(a5),\
629 __AROS_LHA(a6),\
630 __AROS_LHA(a7),\
631 __AROS_LHA(a8),\
632 __AROS_LHA(a9),\
633 __AROS_LHA(a10),\
634 __AROS_LHA(a11),\
635 __AROS_LHA(a12),\
636 __AROS_LHA(a13),\
637 __AROS_LH_BASE(bt,bn))
639 #define AROS_LH14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \
640 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
641 __AROS_LPA(a1),\
642 __AROS_LPA(a2),\
643 __AROS_LPA(a3),\
644 __AROS_LPA(a4),\
645 __AROS_LPA(a5),\
646 __AROS_LPA(a6),\
647 __AROS_LPA(a7),\
648 __AROS_LPA(a8),\
649 __AROS_LPA(a9),\
650 __AROS_LPA(a10),\
651 __AROS_LPA(a11),\
652 __AROS_LPA(a12),\
653 __AROS_LPA(a13),\
654 __AROS_LPA(a14),\
655 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
656 __ASM_PREFIX(n,s)\
657 __ASM_ARG(a14)\
658 __ASM_ARG(a13)\
659 __ASM_ARG(a12)\
660 __ASM_ARG(a11)\
661 __ASM_ARG(a10)\
662 __ASM_ARG(a9)\
663 __ASM_ARG(a8)\
664 __ASM_ARG(a7)\
665 __ASM_ARG(a6)\
666 __ASM_ARG(a5)\
667 __ASM_ARG(a4)\
668 __ASM_ARG(a3)\
669 __ASM_ARG(a2)\
670 __ASM_ARG(a1)\
671 __ASM_POSTFIX(t,n,s,14)\
672 __AROS_LHA(a1),\
673 __AROS_LHA(a2),\
674 __AROS_LHA(a3),\
675 __AROS_LHA(a4),\
676 __AROS_LHA(a5),\
677 __AROS_LHA(a6),\
678 __AROS_LHA(a7),\
679 __AROS_LHA(a8),\
680 __AROS_LHA(a9),\
681 __AROS_LHA(a10),\
682 __AROS_LHA(a11),\
683 __AROS_LHA(a12),\
684 __AROS_LHA(a13),\
685 __AROS_LHA(a14),\
686 __AROS_LH_BASE(bt,bn))
688 #define AROS_LH15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \
689 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
690 __AROS_LPA(a1),\
691 __AROS_LPA(a2),\
692 __AROS_LPA(a3),\
693 __AROS_LPA(a4),\
694 __AROS_LPA(a5),\
695 __AROS_LPA(a6),\
696 __AROS_LPA(a7),\
697 __AROS_LPA(a8),\
698 __AROS_LPA(a9),\
699 __AROS_LPA(a10),\
700 __AROS_LPA(a11),\
701 __AROS_LPA(a12),\
702 __AROS_LPA(a13),\
703 __AROS_LPA(a14),\
704 __AROS_LPA(a15),\
705 __AROS_LP_BASE(bt,bn)) __attribute__((unused));\
706 __ASM_PREFIX(n,s)\
707 __ARM_ARG(a15)\
708 __ASM_ARG(a14)\
709 __ASM_ARG(a13)\
710 __ASM_ARG(a12)\
711 __ASM_ARG(a11)\
712 __ASM_ARG(a10)\
713 __ASM_ARG(a9)\
714 __ASM_ARG(a8)\
715 __ASM_ARG(a7)\
716 __ASM_ARG(a6)\
717 __ASM_ARG(a5)\
718 __ASM_ARG(a4)\
719 __ASM_ARG(a3)\
720 __ASM_ARG(a2)\
721 __ASM_ARG(a1)\
722 __ASM_POSTFIX(t,n,s,15)\
723 __AROS_LHA(a1),\
724 __AROS_LHA(a2),\
725 __AROS_LHA(a3),\
726 __AROS_LHA(a4),\
727 __AROS_LHA(a5),\
728 __AROS_LHA(a6),\
729 __AROS_LHA(a7),\
730 __AROS_LHA(a8),\
731 __AROS_LHA(a9),\
732 __AROS_LHA(a10),\
733 __AROS_LHA(a11),\
734 __AROS_LHA(a12),\
735 __AROS_LHA(a13),\
736 __AROS_LHA(a14),\
737 __AROS_LHA(a15),\
738 __AROS_LH_BASE(bt,bn))
740 /* Library functions which don't need the libbase */
741 #define AROS_LH0I(t,n,bt,bn,o,s) \
742 __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s)(void)
744 #define AROS_LH1I(t,n,a1,bt,bn,o,s) \
745 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
746 __AROS_LPA(a1)) __attribute__((unused));\
747 __ASM_PREFIXI(n,s)\
748 __ASM_ARG(a1)\
749 __ASM_POSTFIXI(t,n,s,1)\
750 __AROS_LHA(a1))
752 #define AROS_LH2I(t,n,a1,a2,bt,bn,o,s) \
753 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
754 __AROS_LPA(a1),\
755 __AROS_LPA(a2)) __attribute__((unused));\
756 __ASM_PREFIXI(n,s)\
757 __ASM_ARG(a2)\
758 __ASM_ARG(a1)\
759 __ASM_POSTFIXI(t,n,s,2)\
760 __AROS_LHA(a1),\
761 __AROS_LHA(a2))
763 #define AROS_LH3I(t,n,a1,a2,a3,bt,bn,o,s) \
764 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
765 __AROS_LPA(a1),\
766 __AROS_LPA(a2),\
767 __AROS_LPA(a3)) __attribute__((unused));\
768 __ASM_PREFIXI(n,s)\
769 __ASM_ARG(a3)\
770 __ASM_ARG(a2)\
771 __ASM_ARG(a1)\
772 __ASM_POSTFIXI(t,n,s,3)\
773 __AROS_LHA(a1),\
774 __AROS_LHA(a2),\
775 __AROS_LHA(a3))
777 #define AROS_LH4I(t,n,a1,a2,a3,a4,bt,bn,o,s) \
778 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
779 __AROS_LPA(a1),\
780 __AROS_LPA(a2),\
781 __AROS_LPA(a3),\
782 __AROS_LPA(a4)) __attribute__((unused));\
783 __ASM_PREFIXI(n,s)\
784 __ASM_ARG(a4)\
785 __ASM_ARG(a3)\
786 __ASM_ARG(a2)\
787 __ASM_ARG(a1)\
788 __ASM_POSTFIXI(t,n,s,4)\
789 __AROS_LHA(a1),\
790 __AROS_LHA(a2),\
791 __AROS_LHA(a3),\
792 __AROS_LHA(a4))
794 #define AROS_LH5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \
795 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
796 __AROS_LPA(a1),\
797 __AROS_LPA(a2),\
798 __AROS_LPA(a3),\
799 __AROS_LPA(a4),\
800 __AROS_LPA(a5)) __attribute__((unused));\
801 __ASM_PREFIXI(n,s)\
802 __ASM_ARG(a5)\
803 __ASM_ARG(a4)\
804 __ASM_ARG(a3)\
805 __ASM_ARG(a2)\
806 __ASM_ARG(a1)\
807 __ASM_POSTFIXI(t,n,s,5)\
808 __AROS_LHA(a1),\
809 __AROS_LHA(a2),\
810 __AROS_LHA(a3),\
811 __AROS_LHA(a4),\
812 __AROS_LHA(a5))
814 #define AROS_LH6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
815 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
816 __AROS_LPA(a1),\
817 __AROS_LPA(a2),\
818 __AROS_LPA(a3),\
819 __AROS_LPA(a4),\
820 __AROS_LPA(a5),\
821 __AROS_LPA(a6)) __attribute__((unused));\
822 __ASM_PREFIXI(n,s)\
823 __ASM_ARG(a6)\
824 __ASM_ARG(a5)\
825 __ASM_ARG(a4)\
826 __ASM_ARG(a3)\
827 __ASM_ARG(a2)\
828 __ASM_ARG(a1)\
829 __ASM_POSTFIXI(t,n,s,6)\
830 __AROS_LHA(a1),\
831 __AROS_LHA(a2),\
832 __AROS_LHA(a3),\
833 __AROS_LHA(a4),\
834 __AROS_LHA(a5),\
835 __AROS_LHA(a6))
837 #define AROS_LH7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
838 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
839 __AROS_LPA(a1),\
840 __AROS_LPA(a2),\
841 __AROS_LPA(a3),\
842 __AROS_LPA(a4),\
843 __AROS_LPA(a5),\
844 __AROS_LPA(a6),\
845 __AROS_LPA(a7)) __attribute__((unused));\
846 __ASM_PREFIXI(n,s)\
847 __ASM_ARG(a7)\
848 __ASM_ARG(a6)\
849 __ASM_ARG(a5)\
850 __ASM_ARG(a4)\
851 __ASM_ARG(a3)\
852 __ASM_ARG(a2)\
853 __ASM_ARG(a1)\
854 __ASM_POSTFIXI(t,n,s,7)\
855 __AROS_LHA(a1),\
856 __AROS_LHA(a2),\
857 __AROS_LHA(a3),\
858 __AROS_LHA(a4),\
859 __AROS_LHA(a5),\
860 __AROS_LHA(a6),\
861 __AROS_LHA(a7))
863 #define AROS_LH8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
864 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
865 __AROS_LPA(a1),\
866 __AROS_LPA(a2),\
867 __AROS_LPA(a3),\
868 __AROS_LPA(a4),\
869 __AROS_LPA(a5),\
870 __AROS_LPA(a6),\
871 __AROS_LPA(a7),\
872 __AROS_LPA(a8)) __attribute__((unused));\
873 __ASM_PREFIXI(n,s)\
874 __ASM_ARG(a8)\
875 __ASM_ARG(a7)\
876 __ASM_ARG(a6)\
877 __ASM_ARG(a5)\
878 __ASM_ARG(a4)\
879 __ASM_ARG(a3)\
880 __ASM_ARG(a2)\
881 __ASM_ARG(a1)\
882 __ASM_POSTFIXI(t,n,s,8)\
883 __AROS_LHA(a1),\
884 __AROS_LHA(a2),\
885 __AROS_LHA(a3),\
886 __AROS_LHA(a4),\
887 __AROS_LHA(a5),\
888 __AROS_LHA(a6),\
889 __AROS_LHA(a7),\
890 __AROS_LHA(a8))
892 #define AROS_LH9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
893 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
894 __AROS_LPA(a1),\
895 __AROS_LPA(a2),\
896 __AROS_LPA(a3),\
897 __AROS_LPA(a4),\
898 __AROS_LPA(a5),\
899 __AROS_LPA(a6),\
900 __AROS_LPA(a7),\
901 __AROS_LPA(a8),\
902 __AROS_LPA(a9)) __attribute__((unused));\
903 __ASM_PREFIXI(n,s)\
904 __ASM_ARG(a9)\
905 __ASM_ARG(a8)\
906 __ASM_ARG(a7)\
907 __ASM_ARG(a6)\
908 __ASM_ARG(a5)\
909 __ASM_ARG(a4)\
910 __ASM_ARG(a3)\
911 __ASM_ARG(a2)\
912 __ASM_ARG(a1)\
913 __ASM_POSTFIXI(t,n,s,9)\
914 __AROS_LHA(a1),\
915 __AROS_LHA(a2),\
916 __AROS_LHA(a3),\
917 __AROS_LHA(a4),\
918 __AROS_LHA(a5),\
919 __AROS_LHA(a6),\
920 __AROS_LHA(a7),\
921 __AROS_LHA(a8),\
922 __AROS_LHA(a9))
924 #define AROS_LH10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
925 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
926 __AROS_LPA(a1),\
927 __AROS_LPA(a2),\
928 __AROS_LPA(a3),\
929 __AROS_LPA(a4),\
930 __AROS_LPA(a5),\
931 __AROS_LPA(a6),\
932 __AROS_LPA(a7),\
933 __AROS_LPA(a8),\
934 __AROS_LPA(a9),\
935 __AROS_LPA(a10)) __attribute__((unused));\
936 __ASM_PREFIXI(n,s)\
937 __ASM_ARG(a10)\
938 __ASM_ARG(a9)\
939 __ASM_ARG(a8)\
940 __ASM_ARG(a7)\
941 __ASM_ARG(a6)\
942 __ASM_ARG(a5)\
943 __ASM_ARG(a4)\
944 __ASM_ARG(a3)\
945 __ASM_ARG(a2)\
946 __ASM_ARG(a1)\
947 __ASM_POSTFIXI(t,n,s,10)\
948 __AROS_LHA(a1),\
949 __AROS_LHA(a2),\
950 __AROS_LHA(a3),\
951 __AROS_LHA(a4),\
952 __AROS_LHA(a5),\
953 __AROS_LHA(a6),\
954 __AROS_LHA(a7),\
955 __AROS_LHA(a8),\
956 __AROS_LHA(a9),\
957 __AROS_LHA(a10))
959 #define AROS_LH11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
960 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
961 __AROS_LPA(a1),\
962 __AROS_LPA(a2),\
963 __AROS_LPA(a3),\
964 __AROS_LPA(a4),\
965 __AROS_LPA(a5),\
966 __AROS_LPA(a6),\
967 __AROS_LPA(a7),\
968 __AROS_LPA(a8),\
969 __AROS_LPA(a9),\
970 __AROS_LPA(a10),\
971 __AROS_LPA(a11)) __attribute__((unused));\
972 __ASM_PREFIXI(n,s)\
973 __ASM_ARG(a11)\
974 __ASM_ARG(a10)\
975 __ASM_ARG(a9)\
976 __ASM_ARG(a8)\
977 __ASM_ARG(a7)\
978 __ASM_ARG(a6)\
979 __ASM_ARG(a5)\
980 __ASM_ARG(a4)\
981 __ASM_ARG(a3)\
982 __ASM_ARG(a2)\
983 __ASM_ARG(a1)\
984 __ASM_POSTFIXI(t,n,s,11)\
985 __AROS_LHA(a1),\
986 __AROS_LHA(a2),\
987 __AROS_LHA(a3),\
988 __AROS_LHA(a4),\
989 __AROS_LHA(a5),\
990 __AROS_LHA(a6),\
991 __AROS_LHA(a7),\
992 __AROS_LHA(a8),\
993 __AROS_LHA(a9),\
994 __AROS_LHA(a10),\
995 __AROS_LHA(a11))
997 #define AROS_LH12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \
998 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
999 __AROS_LPA(a1),\
1000 __AROS_LPA(a2),\
1001 __AROS_LPA(a3),\
1002 __AROS_LPA(a4),\
1003 __AROS_LPA(a5),\
1004 __AROS_LPA(a6),\
1005 __AROS_LPA(a7),\
1006 __AROS_LPA(a8),\
1007 __AROS_LPA(a9),\
1008 __AROS_LPA(a10),\
1009 __AROS_LPA(a11),\
1010 __AROS_LPA(a12)) __attribute__((unused));\
1011 __ASM_PREFIXI(n,s)\
1012 __ASM_ARG(a12)\
1013 __ASM_ARG(a11)\
1014 __ASM_ARG(a10)\
1015 __ASM_ARG(a9)\
1016 __ASM_ARG(a8)\
1017 __ASM_ARG(a7)\
1018 __ASM_ARG(a6)\
1019 __ASM_ARG(a5)\
1020 __ASM_ARG(a4)\
1021 __ASM_ARG(a3)\
1022 __ASM_ARG(a2)\
1023 __ASM_ARG(a1)\
1024 __ASM_POSTFIXI(t,n,s,12)\
1025 __AROS_LHA(a1),\
1026 __AROS_LHA(a2),\
1027 __AROS_LHA(a3),\
1028 __AROS_LHA(a4),\
1029 __AROS_LHA(a5),\
1030 __AROS_LHA(a6),\
1031 __AROS_LHA(a7),\
1032 __AROS_LHA(a8),\
1033 __AROS_LHA(a9),\
1034 __AROS_LHA(a10),\
1035 __AROS_LHA(a11),\
1036 __AROS_LHA(a12))
1038 #define AROS_LH13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \
1039 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
1040 __AROS_LPA(a1),\
1041 __AROS_LPA(a2),\
1042 __AROS_LPA(a3),\
1043 __AROS_LPA(a4),\
1044 __AROS_LPA(a5),\
1045 __AROS_LPA(a6),\
1046 __AROS_LPA(a7),\
1047 __AROS_LPA(a8),\
1048 __AROS_LPA(a9),\
1049 __AROS_LPA(a10),\
1050 __AROS_LPA(a11),\
1051 __AROS_LPA(a12),\
1052 __AROS_LPA(a13)) __attribute__((unused));\
1053 __ASM_PREFIXI(n,s)\
1054 __ASM_ARG(a13)\
1055 __ASM_ARG(a12)\
1056 __ASM_ARG(a11)\
1057 __ASM_ARG(a10)\
1058 __ASM_ARG(a9)\
1059 __ASM_ARG(a8)\
1060 __ASM_ARG(a7)\
1061 __ASM_ARG(a6)\
1062 __ASM_ARG(a5)\
1063 __ASM_ARG(a4)\
1064 __ASM_ARG(a3)\
1065 __ASM_ARG(a2)\
1066 __ASM_ARG(a1)\
1067 __ASM_POSTFIXI(t,n,s,13)\
1068 __AROS_LHA(a1),\
1069 __AROS_LHA(a2),\
1070 __AROS_LHA(a3),\
1071 __AROS_LHA(a4),\
1072 __AROS_LHA(a5),\
1073 __AROS_LHA(a6),\
1074 __AROS_LHA(a7),\
1075 __AROS_LHA(a8),\
1076 __AROS_LHA(a9),\
1077 __AROS_LHA(a10),\
1078 __AROS_LHA(a11),\
1079 __AROS_LHA(a12),\
1080 __AROS_LHA(a13))
1082 #define AROS_LH14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \
1083 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
1084 __AROS_LPA(a1),\
1085 __AROS_LPA(a2),\
1086 __AROS_LPA(a3),\
1087 __AROS_LPA(a4),\
1088 __AROS_LPA(a5),\
1089 __AROS_LPA(a6),\
1090 __AROS_LPA(a7),\
1091 __AROS_LPA(a8),\
1092 __AROS_LPA(a9),\
1093 __AROS_LPA(a10),\
1094 __AROS_LPA(a11),\
1095 __AROS_LPA(a12),\
1096 __AROS_LPA(a13),\
1097 __AROS_LPA(a14)) __attribute__((unused));\
1098 __ASM_PREFIXI(n,s)\
1099 __ASM_ARG(a14)\
1100 __ASM_ARG(a13)\
1101 __ASM_ARG(a12)\
1102 __ASM_ARG(a11)\
1103 __ASM_ARG(a10)\
1104 __ASM_ARG(a9)\
1105 __ASM_ARG(a8)\
1106 __ASM_ARG(a7)\
1107 __ASM_ARG(a6)\
1108 __ASM_ARG(a5)\
1109 __ASM_ARG(a4)\
1110 __ASM_ARG(a3)\
1111 __ASM_ARG(a2)\
1112 __ASM_ARG(a1)\
1113 __ASM_POSTFIXI(t,n,s,14)\
1114 __AROS_LHA(a1),\
1115 __AROS_LHA(a2),\
1116 __AROS_LHA(a3),\
1117 __AROS_LHA(a4),\
1118 __AROS_LHA(a5),\
1119 __AROS_LHA(a6),\
1120 __AROS_LHA(a7),\
1121 __AROS_LHA(a8),\
1122 __AROS_LHA(a9),\
1123 __AROS_LHA(a10),\
1124 __AROS_LHA(a11),\
1125 __AROS_LHA(a12),\
1126 __AROS_LHA(a13),\
1127 __AROS_LHA(a14))
1129 #define AROS_LH15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \
1130 __AROS_LP_PREFIX static t AROS_SLIB_ENTRY_U(n,s)(\
1131 __AROS_LPA(a1),\
1132 __AROS_LPA(a2),\
1133 __AROS_LPA(a3),\
1134 __AROS_LPA(a4),\
1135 __AROS_LPA(a5),\
1136 __AROS_LPA(a6),\
1137 __AROS_LPA(a7),\
1138 __AROS_LPA(a8),\
1139 __AROS_LPA(a9),\
1140 __AROS_LPA(a10),\
1141 __AROS_LPA(a11),\
1142 __AROS_LPA(a12),\
1143 __AROS_LPA(a13),\
1144 __AROS_LPA(a14),\
1145 __AROS_LPA(a15)) __attribute__((unused));\
1146 __ASM_PREFIXI(n,s)\
1147 __ASM_ARG(a15)\
1148 __ASM_ARG(a14)\
1149 __ASM_ARG(a13)\
1150 __ASM_ARG(a12)\
1151 __ASM_ARG(a11)\
1152 __ASM_ARG(a10)\
1153 __ASM_ARG(a9)\
1154 __ASM_ARG(a8)\
1155 __ASM_ARG(a7)\
1156 __ASM_ARG(a6)\
1157 __ASM_ARG(a5)\
1158 __ASM_ARG(a4)\
1159 __ASM_ARG(a3)\
1160 __ASM_ARG(a2)\
1161 __ASM_ARG(a1)\
1162 __ASM_POSTFIXI(t,n,s,15)\
1163 __AROS_LHA(a1),\
1164 __AROS_LHA(a2),\
1165 __AROS_LHA(a3),\
1166 __AROS_LHA(a4),\
1167 __AROS_LHA(a5),\
1168 __AROS_LHA(a6),\
1169 __AROS_LHA(a7),\
1170 __AROS_LHA(a8),\
1171 __AROS_LHA(a9),\
1172 __AROS_LHA(a10),\
1173 __AROS_LHA(a11),\
1174 __AROS_LHA(a12),\
1175 __AROS_LHA(a13),\
1176 __AROS_LHA(a14),\
1177 __AROS_LHA(a15))
1181 Taken from an old version of AROS:
1182 This is one way to call a function with registerized parameters and gcc:
1183 I build a define that defines normal function calls into one of those
1184 LC0()-Makros for expansion directly into the source code.
1186 They work as follows:
1187 First I copy the arguments of the function into normal variables.
1188 Second I copy those variables into the appropriate registers.
1189 (I cannot write them directly into those registers because this locks
1190 the register and one of the arguments may be a function call that needs it.)
1191 Third I call the assembler function with registers as arguments.
1192 Fourth I return the result. (The casting of the long is necessary to make
1193 void work).
1195 Prototype stylish Macros are also possible (using __inline functions instead
1196 of defines) but they need more system ressources to compile, more complicated
1197 Makefiles (gcc cannot inline without optimization) and cannot use local
1198 library bases.
1201 /****************************************************/
1202 #define __LC0(type,name,basetype,basename,offset,system) \
1203 ({ \
1205 long _##name##_re; \
1206 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1207 "move.l %1,%%a6\n\t" \
1208 "jsr %%a6@(-6*"#offset":W)\n\t" \
1209 "move.l (%%sp)+,%%a6\n\t" \
1210 "move.l %%d0,%0" \
1211 :"=g"(_##name##_re) \
1212 :"g"(basename) \
1213 :D0,D1,A0,A1,"memory","cc"); \
1214 (type)_##name##_re; \
1218 #define __LC1(t,n,t1,n1,r1,bt,bn,o,s) \
1219 ({ \
1220 t1 _##n##_n1 = (n1); \
1222 long _##n##_re; \
1223 register t1 _n1 __asm(r1) = _##n##_n1; \
1224 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1225 "move.l %1,%%a6\n\t" \
1226 "jsr %%a6@(-6*"#o":W)\n\t" \
1227 "move.l (%%sp)+,%%a6\n\t" \
1228 "move.l %%d0,%0" \
1229 :"=g"(_##n##_re) \
1230 :"g"(bn), "r"(_n1) \
1231 :A0,A1,D0,D1,"memory","cc"); \
1232 (t)_##n##_re; \
1236 #define __LC2(t,name,t1,n1,r1,t2,n2,r2,bt,bn,o,s) \
1237 ({ \
1238 t1 _##name##_n1 = (n1); \
1239 t2 _##name##_n2 = (n2); \
1241 long _##name##_re; \
1242 register t1 _n1 __asm(r1) = _##name##_n1; \
1243 register t2 _n2 __asm(r2) = _##name##_n2; \
1244 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1245 "move.l %1,%%a6\n\t" \
1246 "jsr %%a6@(-6*"#o":W)\n\t" \
1247 "move.l (%%sp)+,%%a6\n\t" \
1248 "move.l %%d0,%0" \
1249 :"=g"(_##name##_re) \
1250 :"g"(bn), "r"(_n1), "r"(_n2) \
1251 :D0,D1,A0,A1,"memory","cc"); \
1252 (t)_##name##_re; \
1256 #define __LC3(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,bt,bn,o,s) \
1257 ({ \
1258 t1 _##name##_n1 = (n1); \
1259 t2 _##name##_n2 = (n2); \
1260 t3 _##name##_n3 = (n3); \
1262 long _##name##_re; \
1263 register t1 _n1 __asm(r1) = _##name##_n1; \
1264 register t2 _n2 __asm(r2) = _##name##_n2; \
1265 register t3 _n3 __asm(r3) = _##name##_n3; \
1266 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1267 "move.l %1,%%a6\n\t" \
1268 "jsr %%a6@(-6*"#o":W)\n\t" \
1269 "move.l (%%sp)+,%%a6\n\t" \
1270 "move.l %%d0,%0" \
1271 :"=g"(_##name##_re) \
1272 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3) \
1273 :A0,A1,D0,D1,"memory","cc"); \
1274 (t)_##name##_re; \
1278 #define __LC4(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,bt,bn,o,s) \
1279 ({ \
1280 t1 _##name##_n1 = (n1); \
1281 t2 _##name##_n2 = (n2); \
1282 t3 _##name##_n3 = (n3); \
1283 t4 _##name##_n4 = (n4); \
1285 long _##name##_re; \
1286 register t1 _n1 __asm(r1) = _##name##_n1; \
1287 register t2 _n2 __asm(r2) = _##name##_n2; \
1288 register t3 _n3 __asm(r3) = _##name##_n3; \
1289 register t4 _n4 __asm(r4) = _##name##_n4; \
1290 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1291 "move.l %1,%%a6\n\t" \
1292 "jsr %%a6@(-6*"#o":W)\n\t" \
1293 "move.l (%%sp)+,%%a6\n\t" \
1294 "move.l %%d0,%0" \
1295 :"=g"(_##name##_re) \
1296 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1297 "r"(_n4) \
1298 :A0,A1,D0,D1,"memory","cc"); \
1299 (t)_##name##_re; \
1303 #define __LC5(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,bt,bn,o,s) \
1304 ({ \
1305 t1 _##name##_n1 = (n1); \
1306 t2 _##name##_n2 = (n2); \
1307 t3 _##name##_n3 = (n3); \
1308 t4 _##name##_n4 = (n4); \
1309 t5 _##name##_n5 = (n5); \
1311 long _##name##_re; \
1312 register t1 _n1 __asm(r1) = _##name##_n1; \
1313 register t2 _n2 __asm(r2) = _##name##_n2; \
1314 register t3 _n3 __asm(r3) = _##name##_n3; \
1315 register t4 _n4 __asm(r4) = _##name##_n4; \
1316 register t5 _n5 __asm(r5) = _##name##_n5; \
1317 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1318 "move.l %1,%%a6\n\t" \
1319 "jsr %%a6@(-6*"#o":W)\n\t" \
1320 "move.l (%%sp)+,%%a6\n\t" \
1321 "move.l %%d0,%0" \
1322 :"=g"(_##name##_re) \
1323 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1324 "r"(_n4), "r"(_n5) \
1325 :A0,A1,D0,D1,"memory","cc"); \
1326 (t)_##name##_re; \
1330 #define __LC6(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,bt,bn,o,s) \
1331 ({ \
1332 t1 _##name##_n1 = (n1); \
1333 t2 _##name##_n2 = (n2); \
1334 t3 _##name##_n3 = (n3); \
1335 t4 _##name##_n4 = (n4); \
1336 t5 _##name##_n5 = (n5); \
1337 t6 _##name##_n6 = (n6); \
1339 long _##name##_re; \
1340 register t1 _n1 __asm(r1) = _##name##_n1; \
1341 register t2 _n2 __asm(r2) = _##name##_n2; \
1342 register t3 _n3 __asm(r3) = _##name##_n3; \
1343 register t4 _n4 __asm(r4) = _##name##_n4; \
1344 register t5 _n5 __asm(r5) = _##name##_n5; \
1345 register t6 _n6 __asm(r6) = _##name##_n6; \
1346 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1347 "move.l %1,%%a6\n\t" \
1348 "jsr %%a6@(-6*"#o":W)\n\t" \
1349 "move.l (%%sp)+,%%a6\n\t" \
1350 "move.l %%d0,%0" \
1351 :"=g"(_##name##_re) \
1352 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1353 "r"(_n4), "r"(_n5), "r"(_n6) \
1354 :A0,A1,D0,D1,"memory","cc"); \
1355 (t)_##name##_re; \
1359 #define __LC7(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,t7,n7,r7,bt,bn,o,s) \
1360 ({ \
1361 t1 _##name##_n1 = (n1); \
1362 t2 _##name##_n2 = (n2); \
1363 t3 _##name##_n3 = (n3); \
1364 t4 _##name##_n4 = (n4); \
1365 t5 _##name##_n5 = (n5); \
1366 t6 _##name##_n6 = (n6); \
1367 t7 _##name##_n7 = (n7); \
1369 long _##name##_re; \
1370 register t1 _n1 __asm(r1) = _##name##_n1; \
1371 register t2 _n2 __asm(r2) = _##name##_n2; \
1372 register t3 _n3 __asm(r3) = _##name##_n3; \
1373 register t4 _n4 __asm(r4) = _##name##_n4; \
1374 register t5 _n5 __asm(r5) = _##name##_n5; \
1375 register t6 _n6 __asm(r6) = _##name##_n6; \
1376 register t7 _n7 __asm(r7) = _##name##_n7; \
1377 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1378 "move.l %1,%%a6\n\t" \
1379 "jsr %%a6@(-6*"#o":W)\n\t" \
1380 "move.l (%%sp)+,%%a6\n\t" \
1381 "move.l %%d0,%0" \
1382 :"=g"(_##name##_re) \
1383 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1384 "r"(_n4), "r"(_n5), "r"(_n6), "r"(_n7) \
1385 :A0,A1,D0,D1,"memory","cc"); \
1386 (t)_##name##_re; \
1390 #define __LC8(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,t7,n7,r7,t8,n8,r8,bt,bn,o,s) \
1391 ({ \
1392 t1 _##name##_n1 = (n1); \
1393 t2 _##name##_n2 = (n2); \
1394 t3 _##name##_n3 = (n3); \
1395 t4 _##name##_n4 = (n4); \
1396 t5 _##name##_n5 = (n5); \
1397 t6 _##name##_n6 = (n6); \
1398 t7 _##name##_n7 = (n7); \
1399 t8 _##name##_n8 = (n8); \
1401 long _##name##_re; \
1402 register t1 _n1 __asm(r1) = _##name##_n1; \
1403 register t2 _n2 __asm(r2) = _##name##_n2; \
1404 register t3 _n3 __asm(r3) = _##name##_n3; \
1405 register t4 _n4 __asm(r4) = _##name##_n4; \
1406 register t5 _n5 __asm(r5) = _##name##_n5; \
1407 register t6 _n6 __asm(r6) = _##name##_n6; \
1408 register t7 _n7 __asm(r7) = _##name##_n7; \
1409 register t8 _n8 __asm(r8) = _##name##_n8; \
1410 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1411 "move.l %1,%%a6\n\t" \
1412 "jsr %%a6@(-6*"#o":W)\n\t" \
1413 "move.l (%%sp)+,%%a6\n\t" \
1414 "move.l %%d0,%0" \
1415 :"=g"(_##name##_re) \
1416 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1417 "r"(_n4), "r"(_n5), "r"(_n6), "r"(_n7),\
1418 "r"(_n8) \
1419 :A0,A1,D0,D1,"memory","cc"); \
1420 (t)_##name##_re; \
1424 #define __LC9(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,t7,n7,r7,t8,n8,r8,t9,n9,r9,bt,bn,o,s) \
1425 ({ \
1426 t1 _##name##_n1 = (n1); \
1427 t2 _##name##_n2 = (n2); \
1428 t3 _##name##_n3 = (n3); \
1429 t4 _##name##_n4 = (n4); \
1430 t5 _##name##_n5 = (n5); \
1431 t6 _##name##_n6 = (n6); \
1432 t7 _##name##_n7 = (n7); \
1433 t8 _##name##_n8 = (n8); \
1434 t9 _##name##_n9 = (n9); \
1436 long _##name##_re; \
1437 register t1 _n1 __asm(r1) = _##name##_n1; \
1438 register t2 _n2 __asm(r2) = _##name##_n2; \
1439 register t3 _n3 __asm(r3) = _##name##_n3; \
1440 register t4 _n4 __asm(r4) = _##name##_n4; \
1441 register t5 _n5 __asm(r5) = _##name##_n5; \
1442 register t6 _n6 __asm(r6) = _##name##_n6; \
1443 register t7 _n7 __asm(r7) = _##name##_n7; \
1444 register t8 _n8 __asm(r8) = _##name##_n8; \
1445 register t9 _n9 __asm(r9) = _##name##_n9; \
1446 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1447 "move.l %1,%%a6\n\t" \
1448 "jsr %%a6@(-6*"#o":W)\n\t" \
1449 "move.l (%%sp)+,%%a6" \
1450 :"=g"(_##name##_re) \
1451 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1452 "r"(_n4), "r"(_n5), "r"(_n6), "r"(_n7),\
1453 "r"(_n8), "r"(_n9) \
1454 :A0,A1,D0,D1,"memory","cc"); \
1455 (t)_##name##_re; \
1459 #define __LC10(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,t7,n7,r7,t8,n8,r8,t9,n9,r9,t10,n10,r10,bt,bn,o,s) \
1460 ({ \
1461 t1 _##name##_n1 = (n1); \
1462 t2 _##name##_n2 = (n2); \
1463 t3 _##name##_n3 = (n3); \
1464 t4 _##name##_n4 = (n4); \
1465 t5 _##name##_n5 = (n5); \
1466 t6 _##name##_n6 = (n6); \
1467 t7 _##name##_n7 = (n7); \
1468 t8 _##name##_n8 = (n8); \
1469 t9 _##name##_n9 = (n9); \
1470 t10 _##name##_n10 = (n10); \
1472 long _##name##_re; \
1473 register t1 _n1 __asm(r1) = _##name##_n1; \
1474 register t2 _n2 __asm(r2) = _##name##_n2; \
1475 register t3 _n3 __asm(r3) = _##name##_n3; \
1476 register t4 _n4 __asm(r4) = _##name##_n4; \
1477 register t5 _n5 __asm(r5) = _##name##_n5; \
1478 register t6 _n6 __asm(r6) = _##name##_n6; \
1479 register t7 _n7 __asm(r7) = _##name##_n7; \
1480 register t8 _n8 __asm(r8) = _##name##_n8; \
1481 register t9 _n9 __asm(r9) = _##name##_n9; \
1482 register t10 _n10 __asm(r10) = _##name##_n10; \
1483 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1484 "move.l %1,%%a6\n\t" \
1485 "jsr %%a6@(-6*"#o":W)\n\t" \
1486 "move.l (%%sp)+,%%a6" \
1487 :"=g"(_##name##_re) \
1488 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1489 "r"(_n4), "r"(_n5), "r"(_n6), "r"(_n7),\
1490 "r"(_n8), "r"(_n9), "r"(_n10) \
1491 :A0,A1,D0,D1,"memory","cc"); \
1492 (t)_##name##_re; \
1496 #define __LC11(t,name,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5,t6,n6,r6,t7,n7,r7,t8,n8,r8,t9,n9,r9,t10,n10,r10,t11,n11,r11,bt,bn,o,s) \
1497 ({ \
1498 t1 _##name##_n1 = (n1); \
1499 t2 _##name##_n2 = (n2); \
1500 t3 _##name##_n3 = (n3); \
1501 t4 _##name##_n4 = (n4); \
1502 t5 _##name##_n5 = (n5); \
1503 t6 _##name##_n6 = (n6); \
1504 t7 _##name##_n7 = (n7); \
1505 t8 _##name##_n8 = (n8); \
1506 t9 _##name##_n9 = (n9); \
1507 t10 _##name##_n10 = (n10); \
1508 t11 _##name##_n11 = (n11); \
1510 long _##name##_re; \
1511 register t1 _n1 __asm(r1) = _##name##_n1; \
1512 register t2 _n2 __asm(r2) = _##name##_n2; \
1513 register t3 _n3 __asm(r3) = _##name##_n3; \
1514 register t4 _n4 __asm(r4) = _##name##_n4; \
1515 register t5 _n5 __asm(r5) = _##name##_n5; \
1516 register t6 _n6 __asm(r6) = _##name##_n6; \
1517 register t7 _n7 __asm(r7) = _##name##_n7; \
1518 register t8 _n8 __asm(r8) = _##name##_n8; \
1519 register t9 _n9 __asm(r9) = _##name##_n9; \
1520 register t10 _n10 __asm(r10) = _##name##_n10; \
1521 register t11 _n11 __asm(r11) = _##name##_n11; \
1522 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1523 "move.l %1,%%a6\n\t" \
1524 "jsr %%a6@(-6*"#o":W)\n\t" \
1525 "move.l (%%sp)+,%%a6" \
1526 :"=g"(_##name##_re) \
1527 :"g"(bn), "r"(_n1), "r"(_n2), "r"(_n3), \
1528 "r"(_n4), "r"(_n5), "r"(_n6), "r"(_n7),\
1529 "r"(_n8), "r"(_n9), "r"(_n10), \
1530 "r"(_n11) \
1531 :A0,A1,D0,D1,"memory","cc"); \
1532 (t)_##name##_re; \
1536 /****************************************************/
1538 #define __LCQUAD1(t,n,t1,n1,r11,r12,bt,bn,o,s) \
1539 ({ \
1540 t1 _##n##_n1 = (n1); \
1542 t _##n##_re; \
1543 register t1 _n1 __asm(r11) = _##n##_n1; \
1544 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1545 "move.l %2,%%a6\n\t" \
1546 "jsr %%a6@(-6*"#o":W)\n\t" \
1547 "move.l (%%sp)+,%%a6\n\t" \
1548 "movem.l %%d0-%%d1,%0\n\t" \
1549 :"=m"(_##n##_re) \
1550 :"r"(_n1),"g"(bn) \
1551 :A0,A1,D0,D1,"memory","cc"); \
1552 (t)_##n##_re; \
1556 #define __LCQUAD2(t,name,t1,n1,r11,r12,t2,n2,r21,r22,bt,bn,o,s) \
1557 ({ \
1558 t1 _##name##_n1 = (n1); \
1559 t2 _##name##_n2 = (n2); \
1561 t _##name##_re; \
1562 register t1 _n1 __asm(r11) = _##name##_n1; \
1563 register t2 _n2 __asm(r21) = _##name##_n2; \
1564 __asm __volatile("move.l %%a6,-(%%sp)\n\t" \
1565 "move.l %3,%%a6\n\t" \
1566 "jsr %%a6@(-6*"#o":W)\n\t" \
1567 "move.l (%%sp)+,%%a6\n\t" \
1568 "movem.l %%d0-%%d1,%0\n\t" \
1569 :"=m"(_##name##_re) \
1570 :"r"(_n1),"r"(_n2),"g"(bn) \
1571 :D0,D1,A0,A1,"memory","cc"); \
1572 (t)_##name##_re; \
1576 /****************************************************/
1577 #define AROS_LCQUAD1(t,n,a1,bt,bn,o,s) __LCQUAD1(t,n,a1,bt,bn,o,s)
1578 #define AROS_LCQUAD2(t,n,a1,a2,bt,bn,o,s) __LCQUAD2(t,n,a1,a2,bt,bn,o,s)
1580 #define AROS_LC0(t,n,bt,bn,o,s) __LC0(t,n,bt,bn,o,s)
1581 #define AROS_LC0I(t,n,bt,bn,o,s) __LC0(t,n,bt,bn,o,s)
1582 #define AROS_LC1(t,n,a1,bt,bn,o,s) __LC1(t,n,a1,bt,bn,o,s)
1583 #define AROS_LC1I(t,n,a1,bt,bn,o,s) __LC1(t,n,a1,bt,bn,o,s)
1584 #define AROS_LC2(t,n,a1,a2,bt,bn,o,s) __LC2(t,n,a1,a2,bt,bn,o,s)
1585 #define AROS_LC2I(t,n,a1,a2,bt,bn,o,s) __LC2(t,n,a1,a2,bt,bn,o,s)
1586 #define AROS_LC3(t,n,a1,a2,a3,bt,bn,o,s) __LC3(t,n,a1,a2,a3,bt,bn,o,s)
1587 #define AROS_LC3I(t,n,a1,a2,a3,bt,bn,o,s) __LC3(t,n,a1,a2,a3,bt,bn,o,s)
1588 #define AROS_LC4(t,n,a1,a2,a3,a4,bt,bn,o,s) __LC4(t,n,a1,a2,a3,a4,bt,bn,o,s)
1589 #define AROS_LC4I(t,n,a1,a2,a3,a4,bt,bn,o,s) __LC4(t,n,a1,a2,a3,a4,bt,bn,o,s)
1590 #define AROS_LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) __LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s)
1591 #define AROS_LC5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) __LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s)
1592 #define AROS_LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
1593 __LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s)
1594 #define AROS_LC6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \
1595 __LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s)
1596 #define AROS_LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
1597 __LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s)
1598 #define AROS_LC7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \
1599 __LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s)
1600 #define AROS_LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
1601 __LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s)
1602 #define AROS_LC8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \
1603 __LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s)
1604 #if 0
1605 #define AROS_LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
1606 __LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s)
1607 #define AROS_LC9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
1608 __LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s)
1609 #define AROS_LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
1610 __LC10(t,n,a1,a2,a3,a4,a5,a7,a7,a8,a9,a10,bt,bn,o,s)
1611 #define AROS_LC10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
1612 __LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s)
1613 #define AROS_LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
1614 __LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s)
1615 #define AROS_LC11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
1616 __LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s)
1617 #endif
1619 #if 1
1620 /* AROS_LC9 and higher just don't work with gcc. gcc complains
1621 about too many registers being used. So we have to fall back
1622 to stubs for this kind of calls.
1624 #define AROS_LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \
1626 __AROS_LCA(a1),\
1627 __AROS_LCA(a2),\
1628 __AROS_LCA(a3),\
1629 __AROS_LCA(a4),\
1630 __AROS_LCA(a5),\
1631 __AROS_LCA(a6),\
1632 __AROS_LCA(a7),\
1633 __AROS_LCA(a8),\
1634 __AROS_LCA(a9),\
1635 __AROS_LC_BASE(bt,bn))
1637 #define AROS_LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \
1639 __AROS_LCA(a1),\
1640 __AROS_LCA(a2),\
1641 __AROS_LCA(a3),\
1642 __AROS_LCA(a4),\
1643 __AROS_LCA(a5),\
1644 __AROS_LCA(a6),\
1645 __AROS_LCA(a7),\
1646 __AROS_LCA(a8),\
1647 __AROS_LCA(a9),\
1648 __AROS_LCA(a10),\
1649 __AROS_LC_BASE(bt,bn))
1651 #define AROS_LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \
1653 __AROS_LCA(a1),\
1654 __AROS_LCA(a2),\
1655 __AROS_LCA(a3),\
1656 __AROS_LCA(a4),\
1657 __AROS_LCA(a5),\
1658 __AROS_LCA(a6),\
1659 __AROS_LCA(a7),\
1660 __AROS_LCA(a8),\
1661 __AROS_LCA(a9),\
1662 __AROS_LCA(a10),\
1663 __AROS_LCA(a11),\
1664 __AROS_LC_BASE(bt,bn))
1665 #endif
1667 #define AROS_LVO_CALL0(returntype,basetype,basename,offset,system) \
1668 __LC0(returntype,,basetype,basename,offset,system)
1670 #define AROS_LVO_CALL1(t,a1,bt,bn,o,s) \
1671 __LC1(t,,a1,bt,bn,o,s)
1673 #define AROS_LVO_CALL1NR(a1,bt,bn,o,s) \
1674 __LC1(void,,a1,bt,bn,o,s)
1676 #define AROS_LVO_CALL2(t,a1,a2,bt,bn,o,s) \
1677 __LC2(t,,a1,a2,bt,bn,o,s)
1679 #define AROS_LVO_CALL3(t,a1,a2,a3,bt,bn,o,s) \
1680 __LC3(t,,a1,a2,a3,bt,bn,o,s)
1682 #define AROS_LVO_CALL3NR(a1,a2,a3,bt,bn,o,s) \
1683 __LC3(void,,a1,a2,a3,bt,bn,o,s)
1685 #define AROS_LVO_CALL4(t,a1,a2,a3,a4,bt,bn,o,s) \
1686 __LC4(t,,a1,a2,a3,a4,bt,bn,o,s)
1688 /*****************************************************************/
1690 /* Macros for user functions */
1692 #define AROS_UF_ENTRY_U(n) _ ## n
1694 #define __ASM_PREFIX_U(name) \
1695 __asm__(".text\n\t.align 2\n"\
1696 ".globl " #name "\n\t"\
1697 ".type\t" #name ",@function\n"\
1698 #name ":\n\t"\
1700 #define __ASM_PREFIX_US(name) \
1701 __asm__(".text\n\t.align 2\n\t"\
1702 ".type\t" #name ",@function\n"\
1703 #name ":\n\t"\
1705 #ifdef __PIC__
1706 #define __ASM_POSTFIX_U(type,name,argc) \
1707 "bsr.l _" #name "@PLTPC\n\t"\
1708 "add.w #4*" #argc ",%sp\n\t"\
1709 "rts\n\t"\
1710 ".size " #name ",.-" #name);\
1711 __AROS_UFH_PREFIX static type _##name (
1712 #else
1713 #define __ASM_POSTFIX_U(type,name,argc) \
1714 "jbsr _" #name "\n\t"\
1715 "add.w #4*" #argc ",%sp\n\t"\
1716 "rts\n\t"\
1717 ".size " #name ",.-" #name);\
1718 __AROS_UFH_PREFIX static type _##name (
1719 #endif
1721 /* Function headers for user functions */
1723 #define AROS_UFH0(t,n) \
1724 t n (void)
1726 #define AROS_UFH1(t,n,a1) \
1727 t n ();\
1728 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1729 __AROS_UFPA(a1)) __attribute__((unused));\
1730 __ASM_PREFIX_U(n)\
1731 __ASM_ARG(a1)\
1732 __ASM_POSTFIX_U(t,n,1)\
1733 __AROS_UFHA(a1))
1735 #define AROS_UFH2(t,n,a1,a2) \
1736 t n ();\
1737 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1738 __AROS_UFPA(a1),\
1739 __AROS_UFPA(a2)) __attribute__((unused));\
1740 __ASM_PREFIX_U(n)\
1741 __ASM_ARG(a2)\
1742 __ASM_ARG(a1)\
1743 __ASM_POSTFIX_U(t,n,2)\
1744 __AROS_UFHA(a1),\
1745 __AROS_UFHA(a2))
1747 #define AROS_UFH3(t,n,a1,a2,a3) \
1748 t n ();\
1749 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1750 __AROS_UFPA(a1),\
1751 __AROS_UFPA(a2),\
1752 __AROS_UFPA(a3)) __attribute__((unused));\
1753 __ASM_PREFIX_U(n)\
1754 __ASM_ARG(a3)\
1755 __ASM_ARG(a2)\
1756 __ASM_ARG(a1)\
1757 __ASM_POSTFIX_U(t,n,3)\
1758 __AROS_UFHA(a1),\
1759 __AROS_UFHA(a2),\
1760 __AROS_UFHA(a3))
1762 #define AROS_UFH3S(t,n,a1,a2,a3) \
1763 t n ();\
1764 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1765 __AROS_UFPA(a1),\
1766 __AROS_UFPA(a2),\
1767 __AROS_UFPA(a3)) __attribute__((unused));\
1768 __ASM_PREFIX_US(n)\
1769 __ASM_ARG(a3)\
1770 __ASM_ARG(a2)\
1771 __ASM_ARG(a1)\
1772 __ASM_POSTFIX_U(t,n,3)\
1773 __AROS_UFHA(a1),\
1774 __AROS_UFHA(a2),\
1775 __AROS_UFHA(a3))
1777 #define AROS_UFH4(t,n,a1,a2,a3,a4) \
1778 t n ();\
1779 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1780 __AROS_UFPA(a1),\
1781 __AROS_UFPA(a2),\
1782 __AROS_UFPA(a3),\
1783 __AROS_UFPA(a4)) __attribute__((unused));\
1784 __ASM_PREFIX_U(n)\
1785 __ASM_ARG(a4)\
1786 __ASM_ARG(a3)\
1787 __ASM_ARG(a2)\
1788 __ASM_ARG(a1)\
1789 __ASM_POSTFIX_U(t,n,4)\
1790 __AROS_UFHA(a1),\
1791 __AROS_UFHA(a2),\
1792 __AROS_UFHA(a3),\
1793 __AROS_UFHA(a4))
1795 #define AROS_UFH5(t,n,a1,a2,a3,a4,a5) \
1796 t n ();\
1797 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1798 __AROS_UFPA(a1),\
1799 __AROS_UFPA(a2),\
1800 __AROS_UFPA(a3),\
1801 __AROS_UFPA(a4),\
1802 __AROS_UFPA(a5)) __attribute__((unused));\
1803 __ASM_PREFIX_U(n)\
1804 __ASM_ARG(a5)\
1805 __ASM_ARG(a4)\
1806 __ASM_ARG(a3)\
1807 __ASM_ARG(a2)\
1808 __ASM_ARG(a1)\
1809 __ASM_POSTFIX_U(t,n,5)\
1810 __AROS_UFHA(a1),\
1811 __AROS_UFHA(a2),\
1812 __AROS_UFHA(a3),\
1813 __AROS_UFHA(a4),\
1814 __AROS_UFHA(a5))
1816 #define AROS_UFH5S(t,n,a1,a2,a3,a4,a5) \
1817 t n ();\
1818 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1819 __AROS_UFPA(a1),\
1820 __AROS_UFPA(a2),\
1821 __AROS_UFPA(a3),\
1822 __AROS_UFPA(a4),\
1823 __AROS_UFPA(a5)) __attribute__((unused));\
1824 __ASM_PREFIX_US(n)\
1825 __ASM_ARG(a5)\
1826 __ASM_ARG(a4)\
1827 __ASM_ARG(a3)\
1828 __ASM_ARG(a2)\
1829 __ASM_ARG(a1)\
1830 __ASM_POSTFIX_U(t,n,5)\
1831 __AROS_UFHA(a1),\
1832 __AROS_UFHA(a2),\
1833 __AROS_UFHA(a3),\
1834 __AROS_UFHA(a4),\
1835 __AROS_UFHA(a5))
1837 #define AROS_UFH6(t,n,a1,a2,a3,a4,a5,a6) \
1838 t n ();\
1839 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1840 __AROS_UFPA(a1),\
1841 __AROS_UFPA(a2),\
1842 __AROS_UFPA(a3),\
1843 __AROS_UFPA(a4),\
1844 __AROS_UFPA(a5),\
1845 __AROS_UFPA(a6)) __attribute__((unused));\
1846 __ASM_PREFIX_U(n)\
1847 __ASM_ARG(a6)\
1848 __ASM_ARG(a5)\
1849 __ASM_ARG(a4)\
1850 __ASM_ARG(a3)\
1851 __ASM_ARG(a2)\
1852 __ASM_ARG(a1)\
1853 __ASM_POSTFIX_U(t,n,6)\
1854 __AROS_UFHA(a1),\
1855 __AROS_UFHA(a2),\
1856 __AROS_UFHA(a3),\
1857 __AROS_UFHA(a4),\
1858 __AROS_UFHA(a5),\
1859 __AROS_UFHA(a6))
1861 #define AROS_UFH7(t,n,a1,a2,a3,a4,a5,a6,a7) \
1862 t n ();\
1863 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1864 __AROS_UFPA(a1),\
1865 __AROS_UFPA(a2),\
1866 __AROS_UFPA(a3),\
1867 __AROS_UFPA(a4),\
1868 __AROS_UFPA(a5),\
1869 __AROS_UFPA(a6),\
1870 __AROS_UFPA(a7)) __attribute__((unused));\
1871 __ASM_PREFIX_U(n)\
1872 __ASM_ARG(a7)\
1873 __ASM_ARG(a6)\
1874 __ASM_ARG(a5)\
1875 __ASM_ARG(a4)\
1876 __ASM_ARG(a3)\
1877 __ASM_ARG(a2)\
1878 __ASM_ARG(a1)\
1879 __ASM_POSTFIX_U(t,n,7)\
1880 __AROS_UFHA(a1),\
1881 __AROS_UFHA(a2),\
1882 __AROS_UFHA(a3),\
1883 __AROS_UFHA(a4),\
1884 __AROS_UFHA(a5),\
1885 __AROS_UFHA(a6),\
1886 __AROS_UFHA(a7))
1888 #define AROS_UFH8(t,n,a1,a2,a3,a4,a5,a6,a7,a8) \
1889 t n ();\
1890 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1891 __AROS_UFPA(a1),\
1892 __AROS_UFPA(a2),\
1893 __AROS_UFPA(a3),\
1894 __AROS_UFPA(a4),\
1895 __AROS_UFPA(a5),\
1896 __AROS_UFPA(a6),\
1897 __AROS_UFPA(a7),\
1898 __AROS_UFPA(a8)) __attribute__((unused));\
1899 __ASM_PREFIX_U(n)\
1900 __ASM_ARG(a8)\
1901 __ASM_ARG(a7)\
1902 __ASM_ARG(a6)\
1903 __ASM_ARG(a5)\
1904 __ASM_ARG(a4)\
1905 __ASM_ARG(a3)\
1906 __ASM_ARG(a2)\
1907 __ASM_ARG(a1)\
1908 __ASM_POSTFIX_U(t,n,8)\
1909 __AROS_UFHA(a1),\
1910 __AROS_UFHA(a2),\
1911 __AROS_UFHA(a3),\
1912 __AROS_UFHA(a4),\
1913 __AROS_UFHA(a5),\
1914 __AROS_UFHA(a6),\
1915 __AROS_UFHA(a7),\
1916 __AROS_UFHA(a8))
1918 #define AROS_UFH9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
1919 t n ();\
1920 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1921 __AROS_UFPA(a1),\
1922 __AROS_UFPA(a2),\
1923 __AROS_UFPA(a3),\
1924 __AROS_UFPA(a4),\
1925 __AROS_UFPA(a5),\
1926 __AROS_UFPA(a6),\
1927 __AROS_UFPA(a7),\
1928 __AROS_UFPA(a8),\
1929 __AROS_UFPA(a9)) __attribute__((unused));\
1930 __ASM_PREFIX_U(n)\
1931 __ASM_ARG(a9)\
1932 __ASM_ARG(a8)\
1933 __ASM_ARG(a7)\
1934 __ASM_ARG(a6)\
1935 __ASM_ARG(a5)\
1936 __ASM_ARG(a4)\
1937 __ASM_ARG(a3)\
1938 __ASM_ARG(a2)\
1939 __ASM_ARG(a1)\
1940 __ASM_POSTFIX_U(t,n,9)\
1941 __AROS_UFHA(a1),\
1942 __AROS_UFHA(a2),\
1943 __AROS_UFHA(a3),\
1944 __AROS_UFHA(a4),\
1945 __AROS_UFHA(a5),\
1946 __AROS_UFHA(a6),\
1947 __AROS_UFHA(a7),\
1948 __AROS_UFHA(a8),\
1949 __AROS_UFHA(a9))
1951 #define AROS_UFH10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
1952 t n ();\
1953 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1954 __AROS_UFPA(a1),\
1955 __AROS_UFPA(a2),\
1956 __AROS_UFPA(a3),\
1957 __AROS_UFPA(a4),\
1958 __AROS_UFPA(a5),\
1959 __AROS_UFPA(a6),\
1960 __AROS_UFPA(a7),\
1961 __AROS_UFPA(a8),\
1962 __AROS_UFPA(a9),\
1963 __AROS_UFPA(a10)) __attribute__((unused));\
1964 __ASM_PREFIX_U(n)\
1965 __ASM_ARG(a10)\
1966 __ASM_ARG(a9)\
1967 __ASM_ARG(a8)\
1968 __ASM_ARG(a7)\
1969 __ASM_ARG(a6)\
1970 __ASM_ARG(a5)\
1971 __ASM_ARG(a4)\
1972 __ASM_ARG(a3)\
1973 __ASM_ARG(a2)\
1974 __ASM_ARG(a1)\
1975 __ASM_POSTFIX_U(t,n,10)\
1976 __AROS_UFHA(a1),\
1977 __AROS_UFHA(a2),\
1978 __AROS_UFHA(a3),\
1979 __AROS_UFHA(a4),\
1980 __AROS_UFHA(a5),\
1981 __AROS_UFHA(a6),\
1982 __AROS_UFHA(a7),\
1983 __AROS_UFHA(a8),\
1984 __AROS_UFHA(a9),\
1985 __AROS_UFHA(a10))
1987 #define AROS_UFH11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) \
1988 t n ();\
1989 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
1990 __AROS_UFPA(a1),\
1991 __AROS_UFPA(a2),\
1992 __AROS_UFPA(a3),\
1993 __AROS_UFPA(a4),\
1994 __AROS_UFPA(a5),\
1995 __AROS_UFPA(a6),\
1996 __AROS_UFPA(a7),\
1997 __AROS_UFPA(a8),\
1998 __AROS_UFPA(a9),\
1999 __AROS_UFPA(a10),\
2000 __AROS_UFPA(a11)) __attribute__((unused));\
2001 __ASM_PREFIX_U(n)\
2002 __ASM_ARG(a11)\
2003 __ASM_ARG(a10)\
2004 __ASM_ARG(a9)\
2005 __ASM_ARG(a8)\
2006 __ASM_ARG(a7)\
2007 __ASM_ARG(a6)\
2008 __ASM_ARG(a5)\
2009 __ASM_ARG(a4)\
2010 __ASM_ARG(a3)\
2011 __ASM_ARG(a2)\
2012 __ASM_ARG(a1)\
2013 __ASM_POSTFIX_U(t,n,11)\
2014 __AROS_UFHA(a1),\
2015 __AROS_UFHA(a2),\
2016 __AROS_UFHA(a3),\
2017 __AROS_UFHA(a4),\
2018 __AROS_UFHA(a5),\
2019 __AROS_UFHA(a6),\
2020 __AROS_UFHA(a7),\
2021 __AROS_UFHA(a8),\
2022 __AROS_UFHA(a9),\
2023 __AROS_UFHA(a10),\
2024 __AROS_UFHA(a11))
2026 #define AROS_UFH12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) \
2027 t n ();\
2028 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
2029 __AROS_UFPA(a1),\
2030 __AROS_UFPA(a2),\
2031 __AROS_UFPA(a3),\
2032 __AROS_UFPA(a4),\
2033 __AROS_UFPA(a5),\
2034 __AROS_UFPA(a6),\
2035 __AROS_UFPA(a7),\
2036 __AROS_UFPA(a8),\
2037 __AROS_UFPA(a9),\
2038 __AROS_UFPA(a10),\
2039 __AROS_UFPA(a11),\
2040 __AROS_UFPA(a12)) __attribute__((unused));\
2041 __ASM_PREFIX_U(n)\
2042 __ASM_ARG(a12)\
2043 __ASM_ARG(a11)\
2044 __ASM_ARG(a10)\
2045 __ASM_ARG(a9)\
2046 __ASM_ARG(a8)\
2047 __ASM_ARG(a7)\
2048 __ASM_ARG(a6)\
2049 __ASM_ARG(a5)\
2050 __ASM_ARG(a4)\
2051 __ASM_ARG(a3)\
2052 __ASM_ARG(a2)\
2053 __ASM_ARG(a1)\
2054 __ASM_POSTFIX_U(t,n,12)\
2055 __AROS_UFHA(a1),\
2056 __AROS_UFHA(a2),\
2057 __AROS_UFHA(a3),\
2058 __AROS_UFHA(a4),\
2059 __AROS_UFHA(a5),\
2060 __AROS_UFHA(a6),\
2061 __AROS_UFHA(a7),\
2062 __AROS_UFHA(a8),\
2063 __AROS_UFHA(a9),\
2064 __AROS_UFHA(a10),\
2065 __AROS_UFHA(a11),\
2066 __AROS_UFHA(a12))
2068 #define AROS_UFH13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) \
2069 t n ();\
2070 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
2071 __AROS_UFPA(a1),\
2072 __AROS_UFPA(a2),\
2073 __AROS_UFPA(a3),\
2074 __AROS_UFPA(a4),\
2075 __AROS_UFPA(a5),\
2076 __AROS_UFPA(a6),\
2077 __AROS_UFPA(a7),\
2078 __AROS_UFPA(a8),\
2079 __AROS_UFPA(a9),\
2080 __AROS_UFPA(a10),\
2081 __AROS_UFPA(a11),\
2082 __AROS_UFPA(a12),\
2083 __AROS_UFPA(a13)) __attribute__((unused));\
2084 __ASM_PREFIX_U(n)\
2085 __ASM_(a13)\
2086 __ASM_ARG(a12)\
2087 __ASM_ARG(a11)\
2088 __ASM_ARG(a10)\
2089 __ASM_ARG(a9)\
2090 __ASM_ARG(a8)\
2091 __ASM_ARG(a7)\
2092 __ASM_ARG(a6)\
2093 __ASM_ARG(a5)\
2094 __ASM_ARG(a4)\
2095 __ASM_ARG(a3)\
2096 __ASM_ARG(a2)\
2097 __ASM_ARG(a1)\
2098 __ASM_POSTFIX_U(t,n,13)\
2099 __AROS_UFHA(a1),\
2100 __AROS_UFHA(a2),\
2101 __AROS_UFHA(a3),\
2102 __AROS_UFHA(a4),\
2103 __AROS_UFHA(a5),\
2104 __AROS_UFHA(a6),\
2105 __AROS_UFHA(a7),\
2106 __AROS_UFHA(a8),\
2107 __AROS_UFHA(a9),\
2108 __AROS_UFHA(a10),\
2109 __AROS_UFHA(a11),\
2110 __AROS_UFHA(a12),\
2111 __AROS_UFHA(a13))
2113 #define AROS_UFH14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
2114 t n ();\
2115 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
2116 __AROS_UFPA(a1),\
2117 __AROS_UFPA(a2),\
2118 __AROS_UFPA(a3),\
2119 __AROS_UFPA(a4),\
2120 __AROS_UFPA(a5),\
2121 __AROS_UFPA(a6),\
2122 __AROS_UFPA(a7),\
2123 __AROS_UFPA(a8),\
2124 __AROS_UFPA(a9),\
2125 __AROS_UFPA(a10),\
2126 __AROS_UFPA(a11),\
2127 __AROS_UFPA(a12),\
2128 __AROS_UFPA(a13),\
2129 __AROS_UFPA(a14)) __attribute__((unused));\
2130 __ASM_PREFIX_U(n)\
2131 __ASM_ARG(a14)\
2132 __ASM_ARG(a13)\
2133 __ASM_ARG(a12)\
2134 __ASM_ARG(a11)\
2135 __ASM_ARG(a10)\
2136 __ASM_ARG(a9)\
2137 __ASM_ARG(a8)\
2138 __ASM_ARG(a7)\
2139 __ASM_ARG(a6)\
2140 __ASM_ARG(a5)\
2141 __ASM_ARG(a4)\
2142 __ASM_ARG(a3)\
2143 __ASM_ARG(a2)\
2144 __ASM_ARG(a1)\
2145 __ASM_POSTFIX_U(t,n,14)\
2146 __AROS_UFHA(a1),\
2147 __AROS_UFHA(a2),\
2148 __AROS_UFHA(a3),\
2149 __AROS_UFHA(a4),\
2150 __AROS_UFHA(a5),\
2151 __AROS_UFHA(a6),\
2152 __AROS_UFHA(a7),\
2153 __AROS_UFHA(a8),\
2154 __AROS_UFHA(a9),\
2155 __AROS_UFHA(a10),\
2156 __AROS_UFHA(a11),\
2157 __AROS_UFHA(a12),\
2158 __AROS_UFHA(a13),\
2159 __AROS_UFHA(a14))
2161 #define AROS_UFH15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) \
2162 t n ();\
2163 __AROS_UFP_PREFIX static t AROS_UF_ENTRY_U(n)(\
2164 __AROS_UFPA(a1),\
2165 __AROS_UFPA(a2),\
2166 __AROS_UFPA(a3),\
2167 __AROS_UFPA(a4),\
2168 __AROS_UFPA(a5),\
2169 __AROS_UFPA(a6),\
2170 __AROS_UFPA(a7),\
2171 __AROS_UFPA(a8),\
2172 __AROS_UFPA(a9),\
2173 __AROS_UFPA(a10),\
2174 __AROS_UFPA(a11),\
2175 __AROS_UFPA(a12),\
2176 __AROS_UFPA(a13),\
2177 __AROS_UFPA(a14),\
2178 __AROS_UFPA(a15)) __attribute__((unused));\
2179 __ASM_PREFIX_U(n)\
2180 __ASM_ARG(a15)\
2181 __ASM_ARG(a14)\
2182 __ASM_ARG(a13)\
2183 __ASM_ARG(a12)\
2184 __ASM_ARG(a11)\
2185 __ASM_ARG(a10)\
2186 __ASM_ARG(a9)\
2187 __ASM_ARG(a8)\
2188 __ASM_ARG(a7)\
2189 __ASM_ARG(a6)\
2190 __ASM_ARG(a5)\
2191 __ASM_ARG(a4)\
2192 __ASM_ARG(a3)\
2193 __ASM_ARG(a2)\
2194 __ASM_ARG(a1)\
2195 __ASM_POSTFIX_U(t,n,15)\
2196 __AROS_UFHA(a1),\
2197 __AROS_UFHA(a2),\
2198 __AROS_UFHA(a3),\
2199 __AROS_UFHA(a4),\
2200 __AROS_UFHA(a5),\
2201 __AROS_UFHA(a6),\
2202 __AROS_UFHA(a7),\
2203 __AROS_UFHA(a8),\
2204 __AROS_UFHA(a9),\
2205 __AROS_UFHA(a10),\
2206 __AROS_UFHA(a11),\
2207 __AROS_UFHA(a12),\
2208 __AROS_UFHA(a13),\
2209 __AROS_UFHA(a14),\
2210 __AROS_UFHA(a15))
2212 /* Call a user function */
2214 #define AROS_UFC0(t,n) \
2215 (((__AROS_UFC_PREFIX t(*)(void))n)())
2216 #define __UFC1(t,n,t1,n1,r1) \
2218 long _n1 = (long)(n1);\
2219 long _re;\
2220 __asm__ __volatile__(\
2221 "move.l %%a5,-(%%sp)\n\t"\
2222 "move.l %%a6,-(%%sp)\n\t"\
2223 "move.l %2,%"##r1##"\n\t"\
2224 "jsr (%1)\n\t"\
2225 "move.l (%%sp)+,%%a6\n\t"\
2226 "move.l (%%sp)+,%%a5\n\t"\
2227 "move.l %%d0,%0"\
2228 :"=g"(_re)\
2229 :"ad"(n),"g"(_n1)\
2230 :A0,A1,D0,D1,r1,"cc","memory");\
2231 (t)_re;\
2233 #define AROS_UFC1(t,n,a1) __UFC1(t,n,a1)
2234 #define __UFC2(t,n,t1,n1,r1,t2,n2,r2) \
2236 long _n1 = (long)(n1);\
2237 long _n2 = (long)(n2);\
2238 long _re;\
2239 __asm__ __volatile__(\
2240 "move.l %%a5,-(%%sp)\n\t"\
2241 "move.l %%a6,-(%%sp)\n\t"\
2242 "move.l %2,%"##r1##"\n\t"\
2243 "move.l %3,%"##r2##"\n\t"\
2244 "jsr (%1)\n\t"\
2245 "move.l (%%sp)+,%%a6\n\t"\
2246 "move.l (%%sp)+,%%a5\n\t"\
2247 "move.l %%d0,%0"\
2248 :"=g"(_re)\
2249 :"ad"(n),"g"(_n1),"g"(_n2)\
2250 :A0,A1,D0,D1,r1,r2,"cc","memory");\
2251 (t)_re;\
2253 #define AROS_UFC2(t,n,a1,a2) __UFC2(t,n,a1,a2)
2254 #define __UFC3(t,n,t1,n1,r1,t2,n2,r2,t3,n3,r3) \
2256 long _n1 = (long)(n1);\
2257 long _n2 = (long)(n2);\
2258 long _n3 = (long)(n3);\
2259 long _re;\
2260 __asm__ __volatile__(\
2261 "move.l %%a5,-(%%sp)\n\t"\
2262 "move.l %%a6,-(%%sp)\n\t"\
2263 "move.l %2,%"##r1##"\n\t"\
2264 "move.l %3,%"##r2##"\n\t"\
2265 "move.l %4,%"##r3##"\n\t"\
2266 "jsr (%1)\n\t"\
2267 "move.l (%%sp)+,%%a6\n\t"\
2268 "move.l (%%sp)+,%%a5\n\t"\
2269 "move.l %%d0,%0"\
2270 :"=g"(_re)\
2271 :"ad"(n),"g"(_n1),"g"(_n2),"g"(_n3)\
2272 :A0,A1,D0,D1,r1,r2,r3,"cc","memory");\
2273 (t)_re;\
2275 #define AROS_UFC3(t,n,a1,a2,a3) __UFC3(t,n,a1,a2,a3)
2276 #define __UFC3R(t,n,t1,n1,r1,t2,n2,r2,t3,n3,r3,p,ss) \
2278 long _n1 = (long)(n1);\
2279 long _n2 = (long)(n2);\
2280 long _n3 = (long)(n3);\
2281 long _re;\
2282 __asm__ __volatile__(\
2283 "movem.l %%d2-%%d7/%%a2-%%a6,-(%%sp)\n\t"\
2284 "move.l %3,%"##r1##"\n\t"\
2285 "move.l %4,%"##r2##"\n\t"\
2286 "move.l %5,%"##r3##"\n\t"\
2287 "move.l %%sp,-(%%sp)\n\t"\
2288 "move.l %6,-(%%sp)\n\t"\
2289 "move.l %%sp,%1\n\t"\
2290 "jsr (%2)\n\t"\
2291 "movea.l 4(%%sp),%%sp\n\t"\
2292 "movem.l (%%sp)+,%%d2-%%d7/%%a2-%%a6\n\t"\
2293 "move.l %%d0,%0"\
2294 :"=g"(_re),"=m"(*(APTR *)p)\
2295 :"ad"(n),"g"(_n1),"g"(_n2),"g"(_n3),"g"(ss)\
2296 :A0,A1,D0,D1,r1,r2,r3,"cc","memory");\
2297 (t)_re;\
2299 #define AROS_UFC3R(t,n,a1,a2,a3,p,ss) __UFC3R(t,n,a1,a2,a3,p,ss)
2300 #define __UFC4(t,n,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4) \
2302 long _n1 = (long)(n1);\
2303 long _n2 = (long)(n2);\
2304 long _n3 = (long)(n3);\
2305 long _n4 = (long)(n4);\
2306 long _re;\
2307 __asm__ __volatile__(\
2308 "move.l %%a5,-(%%sp)\n\t"\
2309 "move.l %%a6,-(%%sp)\n\t"\
2310 "move.l %2,%"##r1##"\n\t"\
2311 "move.l %3,%"##r2##"\n\t"\
2312 "move.l %4,%"##r3##"\n\t"\
2313 "move.l %5,%"##r4##"\n\t"\
2314 "jsr (%1)\n\t"\
2315 "move.l (%%sp)+,%%a6\n\t"\
2316 "move.l (%%sp)+,%%a5\n\t"\
2317 "move.l %%d0,%0"\
2318 :"=g"(_re)\
2319 :"ad"(n),"g"(_n1),"g"(_n2),"g"(_n3),\
2320 "g"(_n4)\
2321 :A0,A1,D0,D1,r1,r2,r3,r4,"cc","memory");\
2322 (t)_re;\
2324 #define AROS_UFC4(t,n,a1,a2,a3,a4) __UFC4(t,n,a1,a2,a3,a4)
2325 #define __UFC5(t,n,t1,n1,r1,t2,n2,r2,t3,n3,r3,t4,n4,r4,t5,n5,r5) \
2327 long _n1 = (long)(n1);\
2328 long _n2 = (long)(n2);\
2329 long _n3 = (long)(n3);\
2330 long _n4 = (long)(n4);\
2331 long _n5 = (long)(n5);\
2332 long _re;\
2333 __asm__ __volatile__(\
2334 "move.l %%a5,-(%%sp)\n\t"\
2335 "move.l %%a6,-(%%sp)\n\t"\
2336 "move.l %2,%"##r1##"\n\t"\
2337 "move.l %3,%"##r2##"\n\t"\
2338 "move.l %4,%"##r3##"\n\t"\
2339 "move.l %5,%"##r4##"\n\t"\
2340 "move.l %6,%"##r5##"\n\t"\
2341 "jsr (%1)\n\t"\
2342 "move.l (%%sp)+,%%a6\n\t"\
2343 "move.l (%%sp)+,%%a5\n\t"\
2344 "move.l %%d0,%0"\
2345 :"=g"(_re)\
2346 :"ad"(n),"g"(_n1),"g"(_n2),"g"(_n3),\
2347 "g"(_n4),"g"(_n5)\
2348 :A0,A1,D0,D1,r1,r2,r3,r4,r5,"cc","memory");\
2349 (t)_re;\
2351 #define AROS_UFC5(t,n,a1,a2,a3,a4,a5) __UFC5(t,n,a1,a2,a3,a4,a5)
2353 #else /* UseRegisterArgs */
2355 #define AROS_UFC3R(t,n,a1,a2,a3,p,ss) \
2356 (((__AROS_UFC_PREFIX t(*)(\
2357 __AROS_UFPA(a1),\
2358 __AROS_UFPA(a2),\
2359 __AROS_UFPA(a3)\
2360 ))n)(\
2361 __AROS_UFCA(a1),\
2362 __AROS_UFCA(a2),\
2363 __AROS_UFCA(a3)\
2366 #endif /* UseRegisterArgs */
2368 #endif /* AROS_MACHINE_H */