From 382d4cc16cdbc0e859a1604a62481331521f94af Mon Sep 17 00:00:00 2001 From: verhaegs Date: Mon, 31 Oct 2011 22:39:46 +0000 Subject: [PATCH] Reverted altstack implementation and related libbase code. This reverts following commits: r41077, r41078, r41079, r41081, r41085, r41086, r41119, r41120, r41130, r41555 git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@42166 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-unix/exec/newstackswap.c | 14 +- arch/all-unix/kernel/kernel_startup.c | 26 +- arch/arm-all/clib/longjmp.s | 9 +- arch/arm-all/clib/vfork_longjmp.s | 7 - arch/i386-all/clib/longjmp.s | 6 - arch/i386-all/clib/setjmp.s | 11 +- arch/i386-all/clib/vfork.s | 2 +- arch/i386-all/clib/vfork_longjmp.s | 6 - arch/i386-all/exec/newstackswap.c | 8 +- arch/i386-all/include/aros/cpu.h | 16 +- arch/m68k-all/arossupport/aros_thunk.s | 128 -- arch/m68k-all/arossupport/mmakefile.src | 14 - arch/m68k-all/clib/longjmp.s | 25 +- arch/m68k-all/clib/setjmp.s | 18 +- arch/m68k-all/clib/vfork.s | 18 +- arch/m68k-all/exec/newstackswap.S | 34 +- arch/m68k-all/include/aros/cpu.h | 20 - arch/m68k-amiga/boot/start.c | 1 - arch/m68k-amiga/c/newstackswap.s | 31 +- arch/ppc-all/clib/longjmp.s | 1 - arch/ppc-all/clib/setjmp.s | 1 - arch/ppc-all/clib/vfork.s | 1 - arch/ppc-all/clib/vfork_longjmp.s | 1 - arch/ppc-all/exec/newstackswap.c | 7 +- arch/x86_64-all/arosssupport/aros_thunk.s | 134 -- arch/x86_64-all/arosssupport/mmakefile.src | 14 - arch/x86_64-all/clib/longjmp.s | 14 +- arch/x86_64-all/clib/setjmp.s | 7 - arch/x86_64-all/clib/vfork.s | 4 +- arch/x86_64-all/clib/vfork_longjmp.s | 12 +- arch/x86_64-all/exec/newstackswap.c | 6 +- arch/x86_64-all/include/aros/cpu.h | 16 +- compiler/arossupport/aros_altstack.c | 254 --- compiler/arossupport/aros_relbase.c | 94 -- compiler/arossupport/include/altstack.h | 93 -- .../include/{libcall_base.h => libcall.h} | 518 +++++- compiler/arossupport/include/libcall_baserel.h | 1686 -------------------- compiler/arossupport/include/relbase.h | 86 - compiler/arossupport/kprintf.c | 8 - compiler/arossupport/mmakefile.src | 2 - compiler/clib/__arosc_privdata.h | 1 - compiler/clib/__exitfunc.c | 5 +- compiler/clib/__exitfunc.h | 5 +- compiler/clib/__vfork.c | 4 - compiler/clib/arosc.conf | 8 +- compiler/clib/atexit.c | 3 +- compiler/clib/include/setjmp.h | 11 +- compiler/clib/mmakefile.src | 4 +- compiler/clib/on_exit.c | 3 +- compiler/startup/startup.c | 1 - rom/exec/newaddtask.c | 4 - rom/exec/newstackswap.c | 3 +- test/altstack.c | 32 - test/clib/jmpbuf.c | 3 +- test/mmakefile.src | 1 - tools/genmodule/config.c | 5 +- tools/genmodule/config.h | 5 +- tools/genmodule/writeincdefines.c | 14 +- tools/genmodule/writeincinline.c | 11 +- tools/genmodule/writestart.c | 66 +- tools/genmodule/writestubs.c | 1 - 61 files changed, 591 insertions(+), 2952 deletions(-) delete mode 100644 arch/m68k-all/arossupport/aros_thunk.s delete mode 100644 arch/m68k-all/arossupport/mmakefile.src delete mode 100644 arch/x86_64-all/arosssupport/aros_thunk.s delete mode 100644 arch/x86_64-all/arosssupport/mmakefile.src delete mode 100644 compiler/arossupport/aros_altstack.c delete mode 100644 compiler/arossupport/aros_relbase.c delete mode 100644 compiler/arossupport/include/altstack.h rename compiler/arossupport/include/{libcall_base.h => libcall.h} (64%) delete mode 100644 compiler/arossupport/include/libcall_baserel.h delete mode 100644 compiler/arossupport/include/relbase.h delete mode 100644 test/altstack.c diff --git a/arch/all-unix/exec/newstackswap.c b/arch/all-unix/exec/newstackswap.c index 83eb296857..d9cee285d1 100644 --- a/arch/all-unix/exec/newstackswap.c +++ b/arch/all-unix/exec/newstackswap.c @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -24,13 +23,8 @@ #include #include -static void trampoline(struct Task *me, IPTR (*func)(), IPTR *ret, IPTR *args, IPTR oldtop) +static void trampoline(IPTR (*func)(), IPTR *ret, IPTR *args) { - /* Init the environment for libbase passing if necessary */ - aros_init_altstack(me); - /* Set new top to old top */ - aros_set_altstack(me, oldtop); - /* this was called from NewStackSwap() which also called Disable */ Enable(); @@ -60,7 +54,7 @@ AROS_LH3(IPTR, NewStackSwap, AROS_LIBFUNC_INIT struct Task *me = FindTask(NULL); - IPTR ret, oldtop; + IPTR ret; volatile APTR splower, spupper; ucontext_t ucx, ucx_return; @@ -85,9 +79,7 @@ AROS_LH3(IPTR, NewStackSwap, D(bug("[NewStackSwap] Prepared stack: 0x%p - 0x%p (size %u bytes)\n", sss->stk_Lower, sss->stk_Pointer, ucx.uc_stack.ss_size)); - /* Remember old stack top */ - oldtop = aros_get_altstack(me); - PD(SysBase).SysIFace->makecontext(&ucx, (void *(*)()) trampoline, 5, me, entry, &ret, args->Args, oldtop); + PD(SysBase).SysIFace->makecontext(&ucx, (void *(*)()) trampoline, 3, entry, &ret, args->Args); AROS_HOST_BARRIER DB2(bug("[NewStackSwap] Prepared context, doing stack swap\n")); diff --git a/arch/all-unix/kernel/kernel_startup.c b/arch/all-unix/kernel/kernel_startup.c index d5161daf42..224fe8adf2 100644 --- a/arch/all-unix/kernel/kernel_startup.c +++ b/arch/all-unix/kernel/kernel_startup.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -91,10 +90,10 @@ int __startup startup(struct TagItem *msg, ULONG magic) unsigned int i; struct MemHeader *bootmh; struct TagItem *tag; + const struct TagItem *tstate = msg; struct HostInterface *hif = NULL; struct mb_mmap *mmap = NULL; UWORD *ranges[] = {NULL, NULL, (UWORD *)-1}; - const struct TagItem *tstate = msg; /* This bails out if the user started us from within AROS command line, as common executable */ if (magic != AROS_BOOT_MAGIC) @@ -127,7 +126,7 @@ int __startup startup(struct TagItem *msg, ULONG magic) } /* Set globals only AFTER __clear_bss() */ - BootMsg = msg; + BootMsg = msg; HostIFace = hif; /* If there's no proper HostIFace, we can't even say anything */ @@ -203,22 +202,11 @@ int __startup startup(struct TagItem *msg, ULONG magic) /* Create SysBase. After this we can use basic exec services, like memory allocation, lists, etc */ D(bug("[Kernel] calling krnPrepareExecBase(), mh_First = %p\n", bootmh->mh_First)); - krnPrepareExecBase(ranges, bootmh, msg); - - /* - * Set up correct stack borders and altstack. - * Now our boot task can call relbase libraries. - * In fact on hosted we don't know real stack limits, but - * we know it's at least of AROS_STACKSIZE bytes long. For existing architectures - * this seems to be true. - * TODO: 1. Under UNIX it's possible to call getrlimits() to learn about stack limits. - * 2. The whole altstack thing can prove unfeasible. At least currently it failed - * as a system-wide ABI. Alternative stack is not interrupt-safe, while AROS - * libraries may be (and at least several are). - */ - SysBase->ThisTask->tc_SPLower = _stack - AROS_STACKSIZE; - SysBase->ThisTask->tc_SPUpper = _stack; - aros_init_altstack(SysBase->ThisTask); + if (!krnPrepareExecBase(ranges, bootmh, msg)) + { + bug("[Kernel] Unable to create ExecBase!\n"); + return -1; + } D(bug("[Kernel] SysBase=%p, mh_First=%p\n", SysBase, bootmh->mh_First)); diff --git a/arch/arm-all/clib/longjmp.s b/arch/arm-all/clib/longjmp.s index 034183b042..c0364fb12b 100644 --- a/arch/arm-all/clib/longjmp.s +++ b/arch/arm-all/clib/longjmp.s @@ -22,11 +22,4 @@ AROS_CDEFNAME(longjmp): fldmiad ip!, {d8-d15} /* Restore VFP registers - we assume they are available! */ ldr r1, [ip], #4 /* restore VFP status reg */ fmxr fpscr, r1 - ldr r1, [ip], #4 /* restore *(SysBase->ThisTask->tc_SPLower) */ - ldr r2, 1f - ldr r2, [r2] - ldr r2, [r2, ThisTask] - ldr r2, [r2, tc_SPLower] - str r1, [r2] - bx lr /* Done! */ -1: .word SysBase + bx lr /* Done! */ diff --git a/arch/arm-all/clib/vfork_longjmp.s b/arch/arm-all/clib/vfork_longjmp.s index 274d7ba6e8..8c7c0ced72 100644 --- a/arch/arm-all/clib/vfork_longjmp.s +++ b/arch/arm-all/clib/vfork_longjmp.s @@ -22,11 +22,4 @@ AROS_CDEFNAME(vfork_longjmp): fldmiad ip!, {d8-d15} /* Restore VFP registers - we assume they are available! */ ldr r1, [ip], #4 /* restore VFP status reg */ fmxr fpscr, r1 - ldr r1, [ip], #4 /* restore *(SysBase->ThisTask->tc_SPLower) */ - ldr r2, 1f - ldr r2, [r2] - ldr r2, [r2, ThisTask] - ldr r2, [r2, tc_SPLower] - str r1, [r2] bx lr /* Done! */ -1: .word SysBase diff --git a/arch/i386-all/clib/longjmp.s b/arch/i386-all/clib/longjmp.s index 7d29f48906..c7db03668e 100644 --- a/arch/i386-all/clib/longjmp.s +++ b/arch/i386-all/clib/longjmp.s @@ -92,12 +92,6 @@ AROS_CDEFNAME(longjmp): pushl %ebx /* Save return value on new stack */ - /* Restore *(SysBase->ThisTask->tc_SPLower) */ - movl SysBase,%ebx - movl ThisTask(%ebx),%ebx - movl tc_SPLower(%ebx),%ebx - movl 32(%eax),%edx - movl %edx,(%ebx) /* Restore all registers */ movl 4(%eax),%ebx /* %ebx */ movl 8(%eax),%ecx /* %ecx */ diff --git a/arch/i386-all/clib/setjmp.s b/arch/i386-all/clib/setjmp.s index fd2dd19778..694c7249a3 100644 --- a/arch/i386-all/clib/setjmp.s +++ b/arch/i386-all/clib/setjmp.s @@ -82,15 +82,8 @@ AROS_CDEFNAME(setjmp): movl %ebp,24(%eax) /* %ebp */ movl %esp,28(%eax) /* %esp */ - pushl %ebx /* Remember ebx */ - - /* Save *(SysBase->ThisTask->tc_SPLower) */ - movl SysBase,%ebx - movl ThisTask(%ebx),%ebx - movl tc_SPLower(%ebx),%ebx - movl (%ebx),%ebx - movl %ebx,32(%eax) - + pushl %ebx + movl retaddr+4(%esp), %ebx /* Save return address (%esp has changed) */ movl %ebx,0(%eax) diff --git a/arch/i386-all/clib/vfork.s b/arch/i386-all/clib/vfork.s index 9b11be77e1..7ab0feeb1e 100644 --- a/arch/i386-all/clib/vfork.s +++ b/arch/i386-all/clib/vfork.s @@ -11,7 +11,7 @@ _ALIGNMENT .globl AROS_CDEFNAME(vfork) _FUNCTION(AROS_CDEFNAME(vfork)) - .set bufsize, 9*4 + .set bufsize, 8*4 .set stack, 7*4 AROS_CDEFNAME(vfork): diff --git a/arch/i386-all/clib/vfork_longjmp.s b/arch/i386-all/clib/vfork_longjmp.s index 2ad1692b68..3585ad8ebe 100644 --- a/arch/i386-all/clib/vfork_longjmp.s +++ b/arch/i386-all/clib/vfork_longjmp.s @@ -33,12 +33,6 @@ AROS_CDEFNAME(vfork_longjmp): pushl %ebx /* Save return value on new stack */ - /* Restore *(SysBase->ThisTask->tc_SPLower) */ - movl SysBase,%ebx - movl ThisTask(%ebx),%ebx - movl tc_SPLower(%ebx),%ebx - movl 32(%eax),%edx - movl %edx,(%ebx) /* Restore all registers */ movl 4(%eax),%ebx /* %ebx */ movl 8(%eax),%ecx /* %ecx */ diff --git a/arch/i386-all/exec/newstackswap.c b/arch/i386-all/exec/newstackswap.c index ebe96e8ab6..e65f7d1a03 100644 --- a/arch/i386-all/exec/newstackswap.c +++ b/arch/i386-all/exec/newstackswap.c @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -26,7 +25,7 @@ AROS_LH3(IPTR, NewStackSwap, volatile IPTR *sp = sss->stk_Pointer; volatile APTR splower = t->tc_SPLower; volatile APTR spupper = t->tc_SPUpper; - IPTR ret, oldtop; + IPTR ret; BYTE i; /* Put arguments on stack in appropriate order */ @@ -51,14 +50,9 @@ AROS_LH3(IPTR, NewStackSwap, D(bug("[NewStackSwap] SP 0x%p, entry point 0x%p\n", sp, entry)); Disable(); - /* Remember top of the old stack */ - oldtop = aros_get_altstack((struct Task *)t); /* Change limits. The rest is done in asm below */ t->tc_SPLower = sss->stk_Lower; t->tc_SPUpper = sss->stk_Upper; - aros_init_altstack((struct Task *)t); - /* Set new top to old top */ - aros_set_altstack((struct Task *)t, oldtop); asm volatile ( diff --git a/arch/i386-all/include/aros/cpu.h b/arch/i386-all/include/aros/cpu.h index 292a692e23..0f6219f284 100644 --- a/arch/i386-all/include/aros/cpu.h +++ b/arch/i386-all/include/aros/cpu.h @@ -94,21 +94,7 @@ struct JumpVec Internals: a dummy function is used that will generate some unused junk code but otherwise we can't pass input arguments - to the asm statement. - - Some asm trickery performed: - - function return address is top of stack, - leave it there to use as argument for aros_push2_relbase - - libbase is other argument to aros_push2_relbase - - call aros_push2_relbase - - put libbase back in %eax - - remove libbase and return address from stack - - Call lvo vector - - push return value on stack - - call aros_pop2_relbase, - return value will be old return address - - pull return value from stack - - jmp to old return address + to the asm statement */ #define __AROS_LIBFUNCSTUB(fname, libbasename, lvo) \ void __ ## fname ## _ ## libbasename ## _wrapper(void) \ diff --git a/arch/m68k-all/arossupport/aros_thunk.s b/arch/m68k-all/arossupport/aros_thunk.s deleted file mode 100644 index 574338d46e..0000000000 --- a/arch/m68k-all/arossupport/aros_thunk.s +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2011, The AROS Development Team. All rights reserved. - * Author: Jason S. McMullan - * - * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1 - */ - -/****************************************************************************** - - NAME - - aros_thunk_relbase - - FUNCTION - Save the current relbase, and call the function at the LVO - specified. - - INPUTS - - RESULT - None - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - -******************************************************************************/ - - -#include "aros/m68k/asm.h" - - .text - .balign 4 - - .globl aros_thunk_libfunc - - // %sp(+12..) - Arguments to called function - // %sp@(0) - Return address - // D0 - New base address - // D1 - LVO offset - -aros_thunk_libfunc: - movem.l %d0-%d1/%a6,%sp@- - - // Get task's tc_SPLower - move.l SysBase, %a6 - sub.l %a1,%a1 - jsr %a6@(FindTask) - move.l %d0,%a6 - move.l %a6@(tc_SPLower),%a6 - - // Get relstack pointer - move.l %a6@,%a0 // %a0 is now relstack pointer - - // A0 - Relstack pointer - // A6 - Relstack pointer pointer - // SP - New libbase - // Offset of LVO - // Old A6 - // Return address - // arguments to LVO to call -aros_thunk_common: - movem.l %sp@+,%d0-%d1/%a1 - addq.l #4,%a0 - move.l %a1,%a0@+ // Save old A6 off-stack - move.l %sp@+,%a0@+ // Save return address off-stack - move.l %d0,%a0@ // Save new libbase - move.l %a0,%a6@ // Adjust relstack pointer - - add.l %d0,%d1 // Get LVO address - - move.l %d1,%a1 - jsr %a1@ // Call routine - movem.l %d0-%d1,%sp@- // Save returned values - clr.l %d0 - move.l %a6@,%a0 // %a0 is now relstack pointer again - movem.l %a0@(-8),%d0-%d1/%a1 // Get saved values - subq.l #8,%a0 // Adjust relstack pointer - subq.l #4,%a0 // Adjust relstack pointer - movem.l %a0,%a6@ // Save relstack pointer - move.l %d0,%a6 // Restore A6 - move.l %d1,%a1 // A1 is the return address - movem.l %sp@+,%d0-%d1 // Restore values - jmp %a1@ // Return - - - - .globl aros_thunk_rellibfunc - - // %sp(+12..) - Arguments to called function - // %sp@(0) - Return address - // D0 - Offset from current libbase to new libbase - // D1 - LVO index from new libbase - -aros_thunk_rellibfunc: - // Save old A6, D0, and D1 - movem.l %d0-%d1/%a6,%sp@- - - // Get task's tc_SPLower - move.l SysBase, %a6 - sub.l %a1,%a1 - jsr %a6@(FindTask) - move.l %d0,%a6 - move.l %a6@(tc_SPLower),%a6 - - // Retrieve current libbase into D0 - move.l %a6@,%a0 - move.l %a0@,%d0 - - // Calculate new sysbase and LVO function to call - add.l %d0,%sp@ // New libbase - - // A0 - Relstack pointer - // A6 - Relstack pointer pointer - // @SP - New libbase - // Offset of LVO - // Old A6 - // Return address - // arguments to LVO to call - jmp aros_thunk_common diff --git a/arch/m68k-all/arossupport/mmakefile.src b/arch/m68k-all/arossupport/mmakefile.src deleted file mode 100644 index 33d26c677b..0000000000 --- a/arch/m68k-all/arossupport/mmakefile.src +++ /dev/null @@ -1,14 +0,0 @@ -# $Id$ -include $(TOP)/config/make.cfg - -USER_AFLAGS := -I$(GENINCDIR) - -%build_archspecific \ - mainmmake=linklibs-arossupport maindir=compiler/arossupport \ - arch=m68k \ - asmfiles="aros_thunk" - -#MM- linklibs-arossupport-m68k : includes-asm_h-m68k - -%common - diff --git a/arch/m68k-all/clib/longjmp.s b/arch/m68k-all/clib/longjmp.s index 97a500275f..f488b6b9db 100644 --- a/arch/m68k-all/clib/longjmp.s +++ b/arch/m68k-all/clib/longjmp.s @@ -27,28 +27,8 @@ longjmp: moveq.l #1,%d0 /* make sure it isn't 0 */ .okret: move.l 48(%a0),%sp /* restore sp */ - move.l %a0@+,%sp@ /* set return address */ - movem.l %a0@,%d2-%d7/%a2-%a6 /* restore all registers except scratch and sp */ - lea.l %a0@(48), %a0 /* skip sp, %a0 is now old RelBase */ - - /* Save %d0 and %a0@ for later */ - move.l %d0,%sp@- - move.l %a0@,%d0 - move.l %d0,%sp@- - - /* a1 = FindTask(NULL)->tc_SPLower */ - move.l SysBase,%a6 - sub.l %a1, %a1 - jsr %a6@(FindTask) - move.l %d0, %a1 - move.l %a1@(tc_SPLower),%a1 - - /* %a1@ = %a0@ */ - move.l %sp@+,%d0 - move.l %d0,%a1@ - - /* Restore %d0 */ - move.l %sp@+, %d0 + move.l (%a0)+,(%sp) /* set return address */ + movem.l (%a0),%d2-%d7/%a2-%a6 /* restore all registers except scratch and sp */ rts /* @@ -68,5 +48,4 @@ longjmp: [10] 40 a5 [11] 44 a6 [12] 48 old sp - [13] 52 *(ULONG *)(FindTask(NULL)->tc_SPLower) */ diff --git a/arch/m68k-all/clib/setjmp.s b/arch/m68k-all/clib/setjmp.s index e9e311c861..17b04176cc 100644 --- a/arch/m68k-all/clib/setjmp.s +++ b/arch/m68k-all/clib/setjmp.s @@ -20,21 +20,8 @@ setjmp: * Note the slightly different register save order. */ move.l 4(%sp),%a0 /* get address of jmp_buf */ - move.l (%sp),%a0@+ /* store return address */ - movem.l %d2-%d7/%a2-%a6/%sp,%a0@ /* store all registers except scratch */ - lea.l %a0@(12*4),%a0 - move.l %a0,%sp@- /* Save A0 for later */ - - /* D0 = *(ULONG *)(FindTask(NULL)->tc_SPLower) */ - move.l SysBase,%a6 - sub.l %a1, %a1 - jsr %a6@(FindTask) - move.l %d0, %a0 - move.l %a0@(tc_SPLower),%a0 - move.l %a0@,%d0 - - move.l %sp@+,%a0 /* Restore A0 from stack */ - move.l %d0,%a0@+ /* Put RelBase index into jmp_buf */ + move.l (%sp),(%a0)+ /* store return address */ + movem.l %d2-%d7/%a2-%a6/%sp,(%a0) /* store all registers except scratch */ moveq.l #0,%d0 /* return 0 */ rts @@ -55,5 +42,4 @@ setjmp: [10] 40 a5 [11] 44 a6 [12] 48 old sp - [13] 52 *(ULONG *)(FindTask(NULL)->tc_SPLower) */ diff --git a/arch/m68k-all/clib/vfork.s b/arch/m68k-all/clib/vfork.s index 99cd1db886..be09216551 100644 --- a/arch/m68k-all/clib/vfork.s +++ b/arch/m68k-all/clib/vfork.s @@ -31,26 +31,12 @@ [10] 40 a5 [11] 44 a6 [12] 48 old sp - [13] 52 *(ULONG *)(FindTask(NULL)->tc_SPLower) */ .set bufsize, 4*13 AROS_CDEFNAME(vfork): - move.l %sp@,%a0 /* Return address */ + move.l %sp@,%a0 /* Return address -> a0 */ movem.l %d2-%d7/%a2-%a6/%sp,%sp@- /* Registers */ - move.l %a0,%sp@- - - move.l %sp,%sp@- /* Save SP for later */ - - /* D0 = *(ULONG *)(FindTask(NULL)->tc_SPLower) */ - move.l SysBase,%a6 - sub.l %a1, %a1 - jsr %a6@(FindTask) - move.l %d0, %a0 - move.l %a0@(tc_SPLower),%a0 - move.l %a0@,%d0 - - move.l %sp@+,%a0 /* Restore A0 from stack */ - move.l %d0,%a0@(13*4) /* Put RelBase index into jmp_buf */ + move.l %a0,%sp@- /* Return address -> jmp_buf[0] */ move.l %sp,%sp@- /* Push jmp_buf (sp) address */ jsr __vfork /* __vfork call won't return */ diff --git a/arch/m68k-all/exec/newstackswap.S b/arch/m68k-all/exec/newstackswap.S index 6e85f8f5ab..b0f906298a 100644 --- a/arch/m68k-all/exec/newstackswap.S +++ b/arch/m68k-all/exec/newstackswap.S @@ -58,39 +58,15 @@ AROS_SLIB_ENTRY(NewStackSwap,Exec,134): /* Stackswap will clobber %d0, %d1, %a0, and %a1, * so we need to save %a0/%a1 in %a3/%a4 - * also save %d2 to use the altstack top, and - * %a5 will hold the current Task. */ - movem.l %d2/%a3-%a5,%sp@- + movem.l %a3/%a4,%sp@- move.l %a0,%a3 move.l %a1,%a4 - // Get current task pointer, save in A5 - sub.l %a1,%a1 - jsr %a6@(FindTask) - move.l %d0,%a5 - - // Remember old stack top, save in D2 - move.l %a5,%sp@- - jsr aros_get_altstack /* SP: task */ - addq.l #4,%sp - move.l %d0,%d2 - - move.l %a3,%a0 jsr %a6@(StackSwap) - // Initialize alternative stack - move.l %a5,%sp@- - jsr aros_init_altstack /* SP: task */ - - // Set new top to old top */ - move.l %d2,%sp@ - move.l %a5,%sp@- - jsr aros_set_altstack /* SP: task, value */ - - // Put the C arguments on the stack, overwrite first two - move.l %a2@(7*4),%sp@(1*4) - move.l %a2@(6*4),%sp@(0*4) + move.l %a2@(7*4),%sp@- // Put the C arguments on the stack + move.l %a2@(6*4),%sp@- move.l %a2@(5*4),%sp@- move.l %a2@(4*4),%sp@- move.l %a2@(3*4),%sp@- @@ -107,7 +83,7 @@ AROS_SLIB_ENTRY(NewStackSwap,Exec,134): jsr %a6@(StackSwap) move.l %a4,%d0 - /* Now we can restore %d2/%a3-%a5 + /* Now we can restore %a3/%a4 */ - movem.l %sp@+,%d2/%a3-%a5 + movem.l %sp@+,%a3/%a4 rts diff --git a/arch/m68k-all/include/aros/cpu.h b/arch/m68k-all/include/aros/cpu.h index 2e5fdd74ff..7166815613 100644 --- a/arch/m68k-all/include/aros/cpu.h +++ b/arch/m68k-all/include/aros/cpu.h @@ -103,20 +103,6 @@ do \ Internals: a dummy function is used that will generate some unused junk code but otherwise we can't pass input arguments to the asm statement - - Some asm trickery performed: - - function return address is top of stack, - leave it there to use as argument for aros_push2_relbase - - libbase is other argument to aros_push2_relbase - - call aros_push2_relbase - - put libbase back in %eax - - remove libbase and return address from stack - - Call lvo vector - - push return value on stack - - call aros_pop2_relbase, - return value will be old return address - - pull return value from stack - - jmp to old return address */ #define __AROS_LIBFUNCSTUB(fname, libbasename, lvo) \ void __ ## fname ## _ ## libbasename ## _wrapper(void) \ @@ -127,7 +113,6 @@ do \ "\tmove.l " #libbasename ",%%a1\n" \ "\tjmp %%a1@(%c0)\n" \ : : "i" ((-lvo*LIB_VECTSIZE)) \ - : \ ); \ } #define AROS_LIBFUNCSTUB(fname, libbasename, lvo) \ @@ -283,11 +268,6 @@ extern void aros_not_implemented (); /* Call a libary function which requires the libbase */ #include -#define AROS_LC_CALL(t,x,bn) ERROR IN DEFINITIONS - AROS_LC_CALL -#define AROS_LC_CALLNR(x,bn) ERROR IN DEFINITIONS - AROS_LC_CALLNR -#define AROS_LC_CALLI(t,x,bn) ERROR IN DEFINITIONS - AROS_LC_CALLI -#define AROS_LC_CALLINR(x,bn) ERROR IN DEFINITIONS - AROS_LC_CALLNR - #define AROS_LHQUAD1(t,n,a1,bt,bn,o,s) \ AROS_LH2(t,n, \ AROS_LHA(ULONG, __AROS_LTAQUAD1(a1), __AROS_LRAQUAD1(a1)), \ diff --git a/arch/m68k-amiga/boot/start.c b/arch/m68k-amiga/boot/start.c index 0720d62d71..42bcc2815f 100644 --- a/arch/m68k-amiga/boot/start.c +++ b/arch/m68k-amiga/boot/start.c @@ -818,7 +818,6 @@ void exec_boot(ULONG *membanks, ULONG *cpupcr) SysBase->ThisTask->tc_SPUpper = &usp[size]; SysBase->ThisTask->tc_SPLower = usp; - aros_init_altstack(SysBase->ThisTask); /* Leave supervisor mode, switch power led on */ asm volatile ( diff --git a/arch/m68k-amiga/c/newstackswap.s b/arch/m68k-amiga/c/newstackswap.s index ad34bbe507..0d86412b06 100644 --- a/arch/m68k-amiga/c/newstackswap.s +++ b/arch/m68k-amiga/c/newstackswap.s @@ -58,35 +58,16 @@ myNewStackSwap: /* Stackswap will clobber %d0, %d1, %a0, and %a1, * so we need to save %a0/%a1 in %a3/%a4 - * also save %a5 to use locally */ - movem.l %a3/%a4/%a5,%sp@- + movem.l %a3/%a4,%sp@- move.l %a0,%a3 move.l %a1,%a4 - // Get current task pointer - sub.l %a1,%a1 - jsr %a6@(FindTask) - move.l %d0,%sp@- - - // Remember old stack top - jsr aros_get_altstack - move.l %d0,%a5 - jsr %a6@(StackSwap) - // Initialize alternative stack - jsr aros_init_altstack - - // Set new top to old top */ - move.l %sp@,%sp@- - move.l %a5,%sp@(1*4) - jsr aros_set_altstack - - // Put the C arguments on the stack, overwrite first three - move.l %a2@(7*4),%sp@(2*4) - move.l %a2@(6*4),%sp@(1*4) - move.l %a2@(5*4),%sp@(0*4) + move.l %a2@(7*4),%sp@- // Put the C arguments on the stack + move.l %a2@(6*4),%sp@- + move.l %a2@(5*4),%sp@- move.l %a2@(4*4),%sp@- move.l %a2@(3*4),%sp@- move.l %a2@(2*4),%sp@- @@ -102,7 +83,7 @@ myNewStackSwap: jsr %a6@(StackSwap) move.l %a4,%d0 - /* Now we can restore %a3/%a4/%a5 + /* Now we can restore %a3/%a4 */ - movem.l %sp@+,%a3/%a4/%a5 + movem.l %sp@+,%a3/%a4 rts diff --git a/arch/ppc-all/clib/longjmp.s b/arch/ppc-all/clib/longjmp.s index 1815cc070e..223761382b 100644 --- a/arch/ppc-all/clib/longjmp.s +++ b/arch/ppc-all/clib/longjmp.s @@ -114,5 +114,4 @@ okret: lwz %r31, 84(3) lfd %f31,224(3) mr %r3,%r4 -#error restore *(SysBase->ThisTask->tc_SPLower) blr diff --git a/arch/ppc-all/clib/setjmp.s b/arch/ppc-all/clib/setjmp.s index 849ce380d9..cb149b38cb 100644 --- a/arch/ppc-all/clib/setjmp.s +++ b/arch/ppc-all/clib/setjmp.s @@ -55,7 +55,6 @@ HISTORY 12.10.1999 Code rewritten according to glibc ******************************************************************************/ -#error need to be update to store *(SysBase->ThisTask->tc_SPLower) #include "aros/ppc/asm.h" diff --git a/arch/ppc-all/clib/vfork.s b/arch/ppc-all/clib/vfork.s index 631b326fdf..61a49d9e34 100644 --- a/arch/ppc-all/clib/vfork.s +++ b/arch/ppc-all/clib/vfork.s @@ -39,7 +39,6 @@ _ALIGNMENT .globl AROS_CDEFNAME(vfork) _FUNCTION(AROS_CDEFNAME(vfork)) -#error jmpbuf size has changed ! .set bufsize, 60*4 .set retaddr, 2*4 .set stack, 0*4 diff --git a/arch/ppc-all/clib/vfork_longjmp.s b/arch/ppc-all/clib/vfork_longjmp.s index 2cc8533aec..b9ae05b1f4 100644 --- a/arch/ppc-all/clib/vfork_longjmp.s +++ b/arch/ppc-all/clib/vfork_longjmp.s @@ -57,5 +57,4 @@ AROS_CDEFNAME(vfork_longjmp): lwz %r31,((3+17)*4)(%r3) lfd %f31,((22+17*2)*4)(%r3) mr %r3,%r4 -#error restore *(SysBase->ThisTask->tc_SPLower) blr diff --git a/arch/ppc-all/exec/newstackswap.c b/arch/ppc-all/exec/newstackswap.c index 74ceec2fc9..be1b33165e 100644 --- a/arch/ppc-all/exec/newstackswap.c +++ b/arch/ppc-all/exec/newstackswap.c @@ -10,7 +10,6 @@ NAME */ #include -#include #include #include @@ -62,7 +61,6 @@ ULONG *sp; ULONG *src; ULONG *dst; - IPTR oldtop; /* Get the real stack pointer */ asm volatile ("mr %0,%1":"=r"(sp):"r"(real_sp)); @@ -87,11 +85,8 @@ D(bug("In NewStackSwap() entry=%lx, *entry=%lx\n", (IPTR)entry, (IPTR)*entry)); D(bug("[sss] %08x %08x %08x\n", sss->stk_Lower, sss->stk_Pointer, sss->stk_Upper)); - - oldtop = aros_get_altstack(SysBase->ThisTask); + StackSwap(sss); - aros_init_altstack(SysBase->ThisTask); - aros_set_altstack(SyaBase->ThisTask, oldtop); D(bug("[sss] %08x %08x %08x\n", sss->stk_Lower, sss->stk_Pointer, sss->stk_Upper)); diff --git a/arch/x86_64-all/arosssupport/aros_thunk.s b/arch/x86_64-all/arosssupport/aros_thunk.s deleted file mode 100644 index e31ad964b7..0000000000 --- a/arch/x86_64-all/arosssupport/aros_thunk.s +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2011, The AROS Development Team. All rights reserved. - * Author: Jason S. McMullan - * - * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1 - */ - -/****************************************************************************** - - NAME - - aros_thunk_relbase - - FUNCTION - Save the current relbase, and call the function at the LVO - specified. - - INPUTS - - RESULT - None - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - - HISTORY - -******************************************************************************/ - - -#include "aros/x86_64/asm.h" - - // Don't change %rsp just store extra data at a negative offset from - // the pointer -#define LIBBASE -8 -#define FUNCVEC -16 -#define R13STORE -24 -#define TMP -32 - - .text - .balign 4 - - .globl aros_thunk_libfunc - - // %rsp(+12..) - Arguments to called function - // %rsp@(0) - Return address - // r10 - New base address - // r11 - LVO offset - -aros_thunk_libfunc: - movq %r13,R13STORE(%rsp) - movq %r10,LIBBASE(%rsp) - addq %r10,%r11 - movq %r11,FUNCVEC(%rsp) - - // Get task's tc_SPLower - movq SysBase(%rip), %r13 - movq ThisTask(%r13),%r13 - movq tc_SPLower(%r13),%r13 - - // Get relstack pointer - movq (%r13),%r10 // %r10 is now relstack pointer - - // r10 - Relstack pointer - // r13 - Relstack pointer pointer - // rsp+LIBBASE - LIBBASE - // rsp+FUNCVEC - function address - // rsp+R13STORE - old r13 value - // rsp - Return address -aros_thunk_common: - addq $24,(%r13) // Adjust relstack pointer - movq LIBBASE(%rsp),%r11 // Set new libbase - movq %r11,24(%r10) - - movq R13STORE(%rsp),%r11 // Save old r13 off-stack - movq %r11,8(%r10) - popq %r11 // Save return address off-stack - movq %r11,16(%r10) - - // !! Retrurn address popped from stack -> -8 offset - movq FUNCVEC-8(%rsp),%r11 - call *(%r11) // Call routine - - // NOTE: Don't clobber %rdx - it can be a return value also - subq $24,(%r13) // Adjust relstack pointer - movq (%r13),%r10 // %r10 is now relstack pointer again - movq 16(%r10),%r11 // %r11 is the old return address - movq 8(%r10),%r13 // Restore r13 - jmp *%r11 // Return - - .globl aros_thunk_rellibfunc - - // %rsp(+12..) - Arguments to called function - // %rsp@(0) - Return address - // r10 - Offset from current libbase to new libbase - // r11 - LVO index from new libbase - -aros_thunk_rellibfunc: - // Save old r13 - movq %r13,R13STORE(%rsp) - // Save offset - movq %r10,TMP(%rsp) - // Already set LVO offset to FUNCVEC - movq %r11,FUNCVEC(%rsp) - - // Get task's tc_SPLower - movq SysBase(%rip), %r13 - movq ThisTask(%r13),%r13 - movq tc_SPLower(%r13),%r13 - - // Retrieve current libbase in r11 - movq (%r13),%r10 - movq (%r10),%r11 - - // Calculate new sysbase and LVO function to call - addq TMP(%rsp),%r11 // New libbase pointer - movq (%r11),%r11 // New libbase - movq %r11,LIBBASE(%rsp) - addq %r11,FUNCVEC(%rsp) - - // r10 - Relstack pointer - // r13 - Relstack pointer pointer - // rsp+LIBBASE - LIBBASE - // rsp+FUNCVEC - function address - // rsp+R13STORE - old r13 value - // rsp - Return address - jmp aros_thunk_common diff --git a/arch/x86_64-all/arosssupport/mmakefile.src b/arch/x86_64-all/arosssupport/mmakefile.src deleted file mode 100644 index 18229a5c95..0000000000 --- a/arch/x86_64-all/arosssupport/mmakefile.src +++ /dev/null @@ -1,14 +0,0 @@ -# $Id$ -include $(TOP)/config/make.cfg - -USER_AFLAGS := -I$(GENINCDIR) - -%build_archspecific \ - mainmmake=linklibs-arossupport maindir=compiler/arossupport \ - arch=x86_64 \ - asmfiles="aros_thunk" - -#MM- linklibs-arossupport-x86_64 : includes-asm_h-x86_64 - -%common - diff --git a/arch/x86_64-all/clib/longjmp.s b/arch/x86_64-all/clib/longjmp.s index e3cb76d237..e36295a687 100644 --- a/arch/x86_64-all/clib/longjmp.s +++ b/arch/x86_64-all/clib/longjmp.s @@ -18,24 +18,14 @@ .set val, env+8 AROS_CDEFNAME(longjmp): + + mov %rdi, %rax /* Make sure return value is not 0 */ cmp $0,%rsi jne 1f mov $1,%rsi 1: - - /* Get the location of the bottom of the stack */ - mov SysBase(%rip),%rax - mov ThisTask(%rax),%rax - mov tc_SPLower(%rax),%rax - - /* Restore top of altstack */ - mov 128(%rdi),%rcx - mov %rcx,0(%rax) - - mov %rdi, %rax - /* Restore stack pointer and all registers from env */ mov 120(%rax),%rsp /* Restore original stack */ diff --git a/arch/x86_64-all/clib/setjmp.s b/arch/x86_64-all/clib/setjmp.s index e6781fba3c..3c64f4a7ce 100644 --- a/arch/x86_64-all/clib/setjmp.s +++ b/arch/x86_64-all/clib/setjmp.s @@ -31,13 +31,6 @@ AROS_CDEFNAME(setjmp): mov %r15,112(%rdi) mov %rsp,120(%rdi) /* %esp */ - /* Save top of altstack */ - mov SysBase(%rip),%rax - mov ThisTask(%rax),%rax - mov tc_SPLower(%rax),%rax - mov 0(%rax),%rax - mov %rax,128(%rdi) - mov retaddr(%rsp),%rax /* Save return address (%esp has changed) */ mov %rax,0(%rdi) diff --git a/arch/x86_64-all/clib/vfork.s b/arch/x86_64-all/clib/vfork.s index e3f48e3a24..ace6886d29 100644 --- a/arch/x86_64-all/clib/vfork.s +++ b/arch/x86_64-all/clib/vfork.s @@ -12,8 +12,8 @@ _ALIGNMENT .globl AROS_CDEFNAME(vfork) _FUNCTION(AROS_CDEFNAME(vfork)) - .set bufsize, 17*8 - .set stack, 16*8 + .set bufsize, 16*8 + .set stack, 15*8 AROS_CDEFNAME(vfork): lea (-bufsize)(%rsp), %rsp /* _JMPLEN + 1 longs on the stack diff --git a/arch/x86_64-all/clib/vfork_longjmp.s b/arch/x86_64-all/clib/vfork_longjmp.s index f830ab55e6..875b220bbc 100644 --- a/arch/x86_64-all/clib/vfork_longjmp.s +++ b/arch/x86_64-all/clib/vfork_longjmp.s @@ -18,17 +18,7 @@ .set val, env+8 AROS_CDEFNAME(vfork_longjmp): - /* Get the location of the bottom of the stack */ - mov SysBase(%rip),%rax - mov ThisTask(%rax),%rax - mov tc_SPLower(%rax),%rax - - /* Restore the altstack pointer */ - mov 128(%rdi),%rcx - mov %rcx,0(%rax) - - mov %rdi, %rax - + mov %rdi, %rax /* Restore stack pointer and all registers from env */ mov 120(%rax),%rsp /* Restore original stack */ diff --git a/arch/x86_64-all/exec/newstackswap.c b/arch/x86_64-all/exec/newstackswap.c index 4385d5637e..b8420d0fc3 100644 --- a/arch/x86_64-all/exec/newstackswap.c +++ b/arch/x86_64-all/exec/newstackswap.c @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -26,7 +25,7 @@ AROS_LH3(IPTR, NewStackSwap, volatile IPTR *sp = sss->stk_Pointer; volatile APTR splower = t->tc_SPLower; volatile APTR spupper = t->tc_SPUpper; - IPTR ret, oldtop; + IPTR ret; /* Only last two arguments are put to stack in x86-64 */ _PUSH(sp, args->Args[7]); @@ -47,12 +46,9 @@ AROS_LH3(IPTR, NewStackSwap, D(bug("[NewStackSwap] SP 0x%p, entry point 0x%p\n", sp, entry)); Disable(); - oldtop = aros_get_altstack((struct Task *)t); /* Change limits. The rest is done in asm below */ t->tc_SPLower = sss->stk_Lower; t->tc_SPUpper = sss->stk_Upper; - aros_init_altstack((struct Task *)t); - aros_set_altstack((struct Task *)t,oldtop); asm volatile( /* Save original RSP */ diff --git a/arch/x86_64-all/include/aros/cpu.h b/arch/x86_64-all/include/aros/cpu.h index 5ed4eb20b4..827436355e 100644 --- a/arch/x86_64-all/include/aros/cpu.h +++ b/arch/x86_64-all/include/aros/cpu.h @@ -118,21 +118,7 @@ struct JumpVec Internals: a dummy function is used that will generate some unused junk code but otherwise we can't pass input arguments - to the asm statement. - - Some asm trickery performed: - - function return address is top of stack, - leave it there to use as argument for aros_push2_relbase - - libbase is other argument to aros_push2_relbase - - call aros_push2_relbase - - put libbase back in %eax - - remove libbase and return address from stack - - Call lvo vector - - push return value on stack - - call aros_pop2_relbase, - return value will be old return address - - pull return value from stack - - jmp to old return address + to the asm statement */ #define __AROS_LIBFUNCSTUB(fname, libbasename, lvo) \ void __ ## fname ## _ ## libbasename ## _wrapper(void) \ diff --git a/compiler/arossupport/aros_altstack.c b/compiler/arossupport/aros_altstack.c deleted file mode 100644 index 03b57352c8..0000000000 --- a/compiler/arossupport/aros_altstack.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright © 2011, The AROS Development Team. All rights reserved. - * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1 - * - * $Id$ -*/ - -#define __AROS_ALTSTACK_NODEFINE__ -#include - -#define DEBUG 0 -#include - -/***************************************************************************** - - NAME -#include */ - - void aros_init_altstack( - -/* SYNOPSIS */ - struct Task * t) - -/* FUNCTION - Initialize alternative stack - - INPUTS - t - Task to initialize - - RESULT - - - - NOTES - This function is normally executed by the OS for task started with - NewAddTask or when using NewStackSwap to run code with a new stack. - So normally used programs should not need to call this function. - - EXAMPLE - - BUGS - - SEE ALSO - aros_set_altstack(), aros_get_altstack(), - aros_push_altstack(), aros_pop_altstack() - - INTERNALS - -******************************************************************************/ -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - - stackarray[0] = (IPTR)&stackarray[2]; - stackarray[1] = AROS_ALTSTACK_ID; -} - - -/***************************************************************************** - - NAME -#include */ - - IPTR aros_set_altstack( - -/* SYNOPSIS */ - struct Task * t, IPTR value) - -/* FUNCTION - Replace current top of the stack with a new value. - - INPUTS - t - Task with alternative stack - value - Value to replace old value on top of the stack - - RESULT - The old value that was on top of the stack. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - aros_init_altstack(), aros_get_altstack(), - aros_push_altstack(), aros_pop_altstack() - - INTERNALS - -******************************************************************************/ -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - IPTR *stacktop = (IPTR *)stackarray[0]; - - D( - if (stackarray[1] != AROS_ALTSTACK_ID) - bug("[aros_set_altstack]: Error! Altstack ID overwritten!\n"); - - if (AROS_GET_SP <= (unsigned char *)stacktop) - bug("[aros_set_altstack]: Error! Stack pointer below top of alternative stack!\n"); - ) - - IPTR ret = *stacktop; - - *stacktop = value; - - return ret; -} - - -/***************************************************************************** - - NAME -#include */ - - IPTR aros_get_altstack( - -/* SYNOPSIS */ - struct Task * t) - -/* FUNCTION - Get top value from alternative stack - - INPUTS - t - Task with alternative stack - - RESULT - Top value of alternative stack - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - aros_init_altstack(), aros_set_altstack(), - aros_push_altstack(), aros_pop_altstack() - - INTERNALS - -******************************************************************************/ -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - IPTR *stacktop = (IPTR *)stackarray[0]; - - D( - if (stackarray[1] != AROS_ALTSTACK_ID) - bug("[aros_get_altstack]: Error! Altstack ID overwritten!\n"); - - if (AROS_GET_SP <= (unsigned char *)stacktop) - bug("[aros_get_altstack]: Error! Stack pointer below top of alternative stack!\n"); - ) - - return *stacktop; -} - - -/***************************************************************************** - - NAME -#include */ - - void aros_push_altstack( - -/* SYNOPSIS */ - struct Task * t, IPTR value) - -/* FUNCTION - Push a value on alternative stack. - - INPUTS - t - Task with alternative stack - value - Value to push on the alternative stack - - RESULT - - - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - aros_init_altstack(), aros_set_altstack(), aros_get_altstack(), - aros_pop_altstack() - - INTERNALS - -******************************************************************************/ -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - IPTR **stacktopptr = (IPTR **)stackarray; - - D( - if (stackarray[1] != AROS_ALTSTACK_ID) - bug("[aros_push_altstack]: Error! Altstack ID overwritten!\n"); - ) - - *(++(*stacktopptr)) = value; - - D( - if (AROS_GET_SP <= (unsigned char *)(*stacktopptr)) - bug("[aros_push_altstack]: Error! Stack pointer below top of alternative stack!\n"); - ) -} - - -/***************************************************************************** - - NAME -#include */ - - IPTR aros_pop_altstack( - -/* SYNOPSIS */ - struct Task * t) - -/* FUNCTION - Pop value from alternative stack. - - INPUTS - t - Task with alternative stack - - RESULT - Old top value that has been popped from the stack. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - aros_init_altstack(), aros_set_altstack(), aros_get_altstack(), - aros_push_altstack() - - INTERNALS - -******************************************************************************/ -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - IPTR **stacktopptr = (IPTR **)stackarray; - - D( - if (stackarray[1] != AROS_ALTSTACK_ID) - bug("[aros_pop_altstack]: Error! Altstack ID overwritten!\n"); - - if (AROS_GET_SP <= (unsigned char *)(*stacktopptr)) - bug("[aros_pop_altstack]: Error! Stack pointer below top of alternative stack!\n"); - ) - - return *((*stacktopptr)--); -} diff --git a/compiler/arossupport/aros_relbase.c b/compiler/arossupport/aros_relbase.c deleted file mode 100644 index 987398e7c6..0000000000 --- a/compiler/arossupport/aros_relbase.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011, The AROS Development Team. All rights reserved. - * Author: Jason S. McMullan - * - * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1 - */ - -#include - -#include -#include - -#define DEBUG 0 -#include - -/* In order to avoid infinite recursive call of aros_set_relbase - no shared library functions may be called from these functions. - On some platforms they may call aros_set_relbase. -*/ - -void *aros_get_relbase(void) -{ - void *ret; - - DB2(bug("aros_get_relbase()... ")); - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - ret = (void *)aros_get_altstack(SysBase->ThisTask); - - DB2(bug("0x%p\n", ret)); - return ret; -} - -void *aros_set_relbase(void *libbase) -{ - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - return (void *)aros_set_altstack(SysBase->ThisTask,(IPTR)libbase); -} - -void aros_push_relbase(void *libbase) -{ - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - aros_push_altstack(SysBase->ThisTask,(IPTR)libbase); -} - -void aros_push2_relbase(void *libbase, void *ptr) -{ - DB2(bug("aros_push2_relbase(0x%p, 0x%p)\n", libbase, ptr)); - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - aros_push_altstack(SysBase->ThisTask,(IPTR)ptr); - aros_push_altstack(SysBase->ThisTask,(IPTR)libbase); -} - -void *aros_pop_relbase(void) -{ - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - return (void *)aros_pop_altstack(SysBase->ThisTask); -} - -void *aros_pop2_relbase(void) -{ - void *ret; - - DB2(bug("aros_pop2_relbase()... ")); - D( - if (SysBase->ThisTask == NULL) - bug("[aros_get_relbase]: Error! SysBase->ThisTask==NULL\n"); - ) - - aros_pop_altstack(SysBase->ThisTask); - ret = (void *)aros_pop_altstack(SysBase->ThisTask); - - DB2(bug("0x%p\n", ret)); - return ret; -} diff --git a/compiler/arossupport/include/altstack.h b/compiler/arossupport/include/altstack.h deleted file mode 100644 index e8cdbf0395..0000000000 --- a/compiler/arossupport/include/altstack.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright © 2011, The AROS Development Team. All rights reserved. - $Id$ -*/ - -#ifndef AROS_ALTSTACK_H -#define AROS_ALTSTACK_H - -/****************************************************************************** - - MODUL - $Id$ - - DESCRIPTION - In this file an AROS extension is given for an alternative stack. - This stack can be used in stub function without interfering will - function argument passing. - - SEE ALSO - aros_init_altstack(), aros_set_altstack(), aros_get_altstack(), - aros_push_altstack(), aros_pop_altstack() - -******************************************************************************/ - -#include -#include -#include - -#define AROS_ALTSTACK_ID ((IPTR)AROS_MAKE_ID('A','S','T','K')) - -__BEGIN_DECLS - -void aros_init_altstack(struct Task *); -IPTR aros_set_altstack(struct Task *, IPTR); -IPTR aros_get_altstack(struct Task *); -void aros_push_altstack(struct Task *, IPTR); -IPTR aros_pop_altstack(struct Task *); - -__END_DECLS - -#ifndef AROS_ALTSTACK_DEBUG - -/* Remark: inline altstack implementation has to be kept in sync - with non inline implementation in arossupport/altstack.c -*/ -static inline void __aros_init_altstack_inline(struct Task *t) -{ - IPTR *stackarray = (IPTR *)t->tc_SPLower; - - stackarray[0] = (IPTR)&stackarray[2]; - stackarray[1] = AROS_ALTSTACK_ID; -} - -static inline IPTR __aros_set_altstack_inline(struct Task *t, IPTR value) -{ - IPTR *stacktop = *((IPTR **)t->tc_SPLower); - IPTR ret = *stacktop; - - *stacktop = value; - - return ret; -} - -static inline IPTR __aros_get_altstack_inline(struct Task *t) -{ - return **((IPTR **)t->tc_SPLower); -} - -static inline void __aros_push_altstack_inline(struct Task *t, IPTR value) -{ - IPTR **stackptr = (IPTR **)t->tc_SPLower; - - *(++(*stackptr)) = value; -} - -static inline IPTR __aros_pop_altstack_inline(struct Task *t) -{ - IPTR **stackptr = (IPTR **)t->tc_SPLower; - - return *((*stackptr)--); -} - -#ifndef __AROS_ALTSTACK_NODEFINE__ -#define aros_init_altstack(t) __aros_init_altstack_inline(t) -#define aros_set_altstack(t,v) __aros_set_altstack_inline(t,v) -#define aros_get_altstack(t) __aros_get_altstack_inline(t) -#define aros_push_altstack(t,v) __aros_push_altstack_inline(t,v) -#define aros_altstacl_pop(t) __aros_pop_altstack(t) -#endif /* !__AROS_ALTSTACK_NODFINE__ */ - -#endif /* !AROS_ALTSTACK_DEBUG */ - -#endif /* AROS_ALTSTACK_H */ diff --git a/compiler/arossupport/include/libcall_base.h b/compiler/arossupport/include/libcall.h similarity index 64% rename from compiler/arossupport/include/libcall_base.h rename to compiler/arossupport/include/libcall.h index 1a6e214199..fd0d9ec397 100644 --- a/compiler/arossupport/include/libcall_base.h +++ b/compiler/arossupport/include/libcall.h @@ -1,10 +1,100 @@ /* Copyright © 1995-2011, The AROS Development Team. All rights reserved. $Id$ +*/ + +#ifndef AROS_LIBCALL_H +#define AROS_LIBCALL_H + +/****************************************************************************** + + MODUL + $Id$ + + DESCRIPTION + Some macros to build functions with registerized parameters on the + different compilers around. Usage: + + AROS_LH(type, name, + [AROS_LHA(type1, name1, reg1),] ... + libtype, libvariable, lvo, basename + ) + { + AROS_LIBFUNC_INIT + \* Function starts here. *\ + AROS_LIBFUNC_EXIT + } + + - Number of arguments of the function (not including the + library base). + + - 'I' means: Function ignores library base. + This is useful to get rid of warnings about unused arguments. + + type - Returntype of the function. - Desc: Macros for calling regular library functions with explicit base passing - Lang: english + name - Name of the function. A underscore '_' is prepended so that + following functions jump over the base vector and don't call + the function directly. + + type, name, reg - Type, name and register for the + arguments. Register names are written uppercase because they + are preprocessor symbols. + + Example: Define an Exec-compatible RemHead function. + + AROS_LH1I(struct Node *, RemHead, + struct List *, list, A0, + struct ExecBase, SysBase, 43, Exec) + { + // No ";" !! + AROS_LIBFUNC_INIT + + struct Node *node; + + node=list->lh_Head; + if(node->ln_Succ==NULL) + return NULL; + Remove(node); + return node; + + // after return !! + AROS_LIBFUNC_EXIT + } + +******************************************************************************/ + +/* System-Specific things */ +#ifndef AROS_SYSTEM_H +# include +#endif + +#ifndef __typedef_VOID_FUNC +#define __typedef_VOID_FUNC +typedef void (*VOID_FUNC)(); +#endif +#ifndef __typedef_LONG_FUNC +#define __typedef_LONG_FUNC +typedef int (*LONG_FUNC)(); +#endif +#ifndef __typedef_ULONG_FUNC +#define __typedef_ULONG_FUNC +typedef unsigned int (*ULONG_FUNC)(); +#endif + +/* Declare all macros which the systems' libcall didn't */ +#ifndef __AROS_SLIB_ENTRY +# define __AROS_SLIB_ENTRY(n,s,o) s ## _ ## o ## _ ## n +#endif +#ifndef AROS_SLIB_ENTRY +/* + This is to allow the C preprocessor to expand n and s before they are + maybe concatenated (the CPP first evaluates a ## b and the tries + to expand ab instead of expanding a and b and then concatenating the + results */ +# define AROS_SLIB_ENTRY(n,s,o) __AROS_SLIB_ENTRY(n,s,o) +#endif #ifndef __AROS_CPU_SPECIFIC_LH /* Library functions which need the libbase */ @@ -191,6 +281,175 @@ __AROS_LHA(a14),\ __AROS_LHA(a15),\ __AROS_LH_BASE(bt,bn)) { + +/* Library functions which don't need the libbase */ +#define AROS_LH0I(t,n,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(void) { +#define AROS_LH1I(t,n,a1,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1)\ + ) { +#define AROS_LH2I(t,n,a1,a2,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2)\ + ) { +#define AROS_LH3I(t,n,a1,a2,a3,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3)\ + ) { +#define AROS_LH4I(t,n,a1,a2,a3,a4,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4)\ + ) { +#define AROS_LH5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5)\ + ) { +#define AROS_LH6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6)\ + ) { +#define AROS_LH7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7)\ + ) { +#define AROS_LH8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8)\ + ) { +#define AROS_LH9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9)\ + ) { +#define AROS_LH10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10)\ + ) { +#define AROS_LH11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10),\ + __AROS_LHA(a11)\ + ) { +#define AROS_LH12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10),\ + __AROS_LHA(a11),\ + __AROS_LHA(a12)\ + ) { +#define AROS_LH13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10),\ + __AROS_LHA(a11),\ + __AROS_LHA(a12),\ + __AROS_LHA(a13)\ + ) { +#define AROS_LH14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10),\ + __AROS_LHA(a11),\ + __AROS_LHA(a12),\ + __AROS_LHA(a13),\ + __AROS_LHA(a14)\ + ) { +#define AROS_LH15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ + __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ + __AROS_LHA(a1),\ + __AROS_LHA(a2),\ + __AROS_LHA(a3),\ + __AROS_LHA(a4),\ + __AROS_LHA(a5),\ + __AROS_LHA(a6),\ + __AROS_LHA(a7),\ + __AROS_LHA(a8),\ + __AROS_LHA(a9),\ + __AROS_LHA(a10),\ + __AROS_LHA(a11),\ + __AROS_LHA(a12),\ + __AROS_LHA(a13),\ + __AROS_LHA(a14),\ + __AROS_LHA(a15)\ + ) { #endif /* !__AROS_CPU_SPECIFIC_LH */ @@ -867,6 +1126,46 @@ #endif #endif /* !__AROS_CPU_SPECIFIC_LC */ +#ifndef __AROS_CPU_SPECIFIC_LP +# define AROS_LPQUAD1(t,n,a1,bt,bn,o,s) \ +t n(__AROS_LPAQUAD(a1)) +# define AROS_LPQUAD2(t,n,a1,a2,bt,bn,o,s) \ +t n(__AROS_LPAQUAD(a1),__AROS_LPAQUAD(a2)) + +# define AROS_LP0(t,n,bt,bn,o,s) \ +t n(void) +# define AROS_LP1(t,n,a1,bt,bn,o,s) \ +t n(__AROS_LPA(a1)) +# define AROS_LP2(t,n,a1,a2,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2)) +# define AROS_LP3(t,n,a1,a2,a3,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3)) +# define AROS_LP4(t,n,a1,a2,a3,a4,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4)) +# define AROS_LP5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5)) +# define AROS_LP6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6)) +# define AROS_LP7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7)) +# define AROS_LP8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8)) +# define AROS_LP9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9)) +# define AROS_LP10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10)) +# define AROS_LP11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10),__AROS_LPA(a11)) +# define AROS_LP12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10),__AROS_LPA(a11),__AROS_LPA(a12)) +# define AROS_LP13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10),__AROS_LPA(a11),__AROS_LPA(a12),__AROS_LPA(a13)) +# define AROS_LP14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10),__AROS_LPA(a11),__AROS_LPA(a12),__AROS_LPA(a13),__AROS_LPA(a14)) +# define AROS_LP15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ +t n(__AROS_LPA(a1),__AROS_LPA(a2),__AROS_LPA(a3),__AROS_LPA(a4),__AROS_LPA(a5),__AROS_LPA(a6),__AROS_LPA(a7),__AROS_LPA(a8),__AROS_LPA(a9),__AROS_LPA(a10),__AROS_LPA(a11),__AROS_LPA(a12),__AROS_LPA(a13),__AROS_LPA(a14),__AROS_LPA(a15)) +# endif /* !__AROS_CPU_SPECIFIC_LP */ + #ifndef __AROS_CPU_SPECIFIC_LD /* Declarations for library functions which need the libbase */ @@ -1030,4 +1329,219 @@ __AROS_LDA(a13), \ __AROS_LDA(a14), \ __AROS_LDA(a15), __AROS_LD_BASE(bt,bn)) + +/* Declarations for library functions which don't need the libbase */ +# define AROS_LD0I(t,n,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) (void) +# define AROS_LD1I(t,n,a1,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1)) +# define AROS_LD2I(t,n,a1,a2,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2)) +# define AROS_LD3I(t,n,a1,a2,a3,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3)) +# define AROS_LD4I(t,n,a1,a2,a3,a4,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4)) +# define AROS_LD5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5)) +# define AROS_LD6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6)) +# define AROS_LD7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7)) +# define AROS_LD8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8)) +# define AROS_LD9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9)) +# define AROS_LD10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10)) +# define AROS_LD11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10), \ + __AROS_LDA(a11)) +# define AROS_LD12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10), \ + __AROS_LDA(a11), \ + __AROS_LDA(a12)) +# define AROS_LD13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10), \ + __AROS_LDA(a11), \ + __AROS_LDA(a12), \ + __AROS_LDA(a13)) +# define AROS_LD14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10), \ + __AROS_LDA(a11), \ + __AROS_LDA(a12), \ + __AROS_LDA(a13), \ + __AROS_LDA(a14)) +# define AROS_LD15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ + __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ + __AROS_LDA(a1), \ + __AROS_LDA(a2), \ + __AROS_LDA(a3), \ + __AROS_LDA(a4), \ + __AROS_LDA(a5), \ + __AROS_LDA(a6), \ + __AROS_LDA(a7), \ + __AROS_LDA(a8), \ + __AROS_LDA(a9), \ + __AROS_LDA(a10), \ + __AROS_LDA(a11), \ + __AROS_LDA(a12), \ + __AROS_LDA(a13), \ + __AROS_LDA(a14), \ + __AROS_LDA(a15)) #endif /* !__AROS_CPU_SPECIFIC_LD */ + +#define AROS_LHA(type,name,reg) type,name,reg +#define AROS_LPA(type,name,reg) type,name,reg +#define AROS_LCA(type,name,reg) type,name,reg +#define AROS_LDA(type,name,reg) type,name,reg + +#define AROS_LHAQUAD(type,name,reg1,reg2) type,name,reg1,reg2 +#define AROS_LPAQUAD(type,name,reg1,reg2) type,name,reg1,reg2 +#define AROS_LCAQUAD(type,name,reg1,reg2) type,name,reg1,reg2 +#define AROS_LDAQUAD(type,name,reg1,reg2) type,name,reg1,reg2 + +#ifndef AROS_LIBFUNC_INIT +# define AROS_LIBFUNC_INIT { +#endif +#ifndef AROS_LIBFUNC_EXIT +# define AROS_LIBFUNC_EXIT }} +#endif + +/* Tagging of private functions, so that they can be distinguished from + official ones. But they have to compile the same way, so: */ +#define AROS_PLH0 AROS_LH0 +#define AROS_PLH1 AROS_LH1 +#define AROS_PLH2 AROS_LH2 +#define AROS_PLH3 AROS_LH3 +#define AROS_PLH4 AROS_LH4 +#define AROS_PLH5 AROS_LH5 +#define AROS_PLH6 AROS_LH6 +#define AROS_PLH7 AROS_LH7 +#define AROS_PLH8 AROS_LH8 +#define AROS_PLH9 AROS_LH9 +#define AROS_PLH10 AROS_LH10 +#define AROS_PLH11 AROS_LH11 +#define AROS_PLH12 AROS_LH12 +#define AROS_PLH13 AROS_LH13 +#define AROS_PLH14 AROS_LH14 +#define AROS_PLH15 AROS_LH15 + +/* NT stands for No Tags, which means that the functions which are defined with these headers + are not subject to tagcall generation by the script used to generate include files */ +#define AROS_NTLH0 AROS_LH0 +#define AROS_NTLH1 AROS_LH1 +#define AROS_NTLH2 AROS_LH2 +#define AROS_NTLH3 AROS_LH3 +#define AROS_NTLH4 AROS_LH4 +#define AROS_NTLH5 AROS_LH5 +#define AROS_NTLH6 AROS_LH6 +#define AROS_NTLH7 AROS_LH7 +#define AROS_NTLH8 AROS_LH8 +#define AROS_NTLH9 AROS_LH9 +#define AROS_NTLH10 AROS_LH10 +#define AROS_NTLH11 AROS_LH11 +#define AROS_NTLH12 AROS_LH12 +#define AROS_NTLH13 AROS_LH13 +#define AROS_NTLH14 AROS_LH14 +#define AROS_NTLH15 AROS_LH15 + +/****************************************************************************** +***** ENDE aros/libcall.h +******************************************************************************/ + +#endif /* AROS_LIBCALL_H */ diff --git a/compiler/arossupport/include/libcall_baserel.h b/compiler/arossupport/include/libcall_baserel.h deleted file mode 100644 index 7f0d3708d3..0000000000 --- a/compiler/arossupport/include/libcall_baserel.h +++ /dev/null @@ -1,1686 +0,0 @@ -/* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. - $Id$ - - Desc: Macros for calling regular library functions with base-relative - global variables - Lang: english -*/ - -#include - -#ifndef __AROS_CPU_SPECIFIC_LH -/* Library functions which need the libbase */ -#ifndef __AROS_LH_DEFBASE -#define __AROS_LH_DEFBASE(bt,bn) \ - bt __attribute__((__unused__)) bn = (bt)AROS_GET_LIBBASE; -#endif - -#define AROS_LHQUAD1(t,n,a1,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHAQUAD(a1)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LHQUAD2(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHAQUAD(a1),\ - __AROS_LHAQUAD(a2)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH1QUAD1(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHAQUAD(a2)) { \ - __AROS_LH_DEFBASE(bt, bn) - -#define AROS_LH0(t,n,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - void) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH1(t,n,a1,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH2(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH3(t,n,a1,a2,a3,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH4(t,n,a1,a2,a3,a4,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10),\ - __AROS_LHA(a11)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10),\ - __AROS_LHA(a11),\ - __AROS_LHA(a12)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10),\ - __AROS_LHA(a11),\ - __AROS_LHA(a12),\ - __AROS_LHA(a13)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10),\ - __AROS_LHA(a11),\ - __AROS_LHA(a12),\ - __AROS_LHA(a13),\ - __AROS_LHA(a14)) { \ - __AROS_LH_DEFBASE(bt, bn) -#define AROS_LH15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ - __AROS_LH_PREFIX t AROS_SLIB_ENTRY(n,s,o)(\ - __AROS_LHA(a1),\ - __AROS_LHA(a2),\ - __AROS_LHA(a3),\ - __AROS_LHA(a4),\ - __AROS_LHA(a5),\ - __AROS_LHA(a6),\ - __AROS_LHA(a7),\ - __AROS_LHA(a8),\ - __AROS_LHA(a9),\ - __AROS_LHA(a10),\ - __AROS_LHA(a11),\ - __AROS_LHA(a12),\ - __AROS_LHA(a13),\ - __AROS_LHA(a14),\ - __AROS_LHA(a15)) { \ - __AROS_LH_DEFBASE(bt, bn) -#endif /* !__AROS_CPU_SPECIFIC_LH */ - -#ifndef AROS_LC_CALL - -#define AROS_LC_CALL(t,x,bn) \ -({ \ - t _ret; \ - void *old = AROS_SET_LIBBASE(bn); \ - _ret = x; \ - (void)AROS_SET_LIBBASE(old); \ - _ret; \ -}) -#define AROS_LC_CALLNR(x,bn) \ -({ \ - void * old = AROS_SET_LIBBASE(bn); \ - x; \ - (void)AROS_SET_LIBBASE(old); \ -}) - -#endif //AROS_LC_CALL - -/* Call a library function which requires the libbase */ -#ifndef __AROS_CPU_SPECIFIC_LC -# define AROS_LCQUAD1(t,n,a1,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPAQUAD(a1)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCAQUAD(a1))),\ - bn) -#define AROS_LCQUAD2(t,n,a1,a2,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPAQUAD(a1),\ - __AROS_LPAQUAD(a2)))__AROS_GETVECADDR(bn,o))( \ - __AROS_LCAQUAD(a1),\ - __AROS_LCAQUAD(a2))),\ - bn) -#define AROS_LC1QUAD1(t,n,a1,a2,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPAQUAD(a2)))__AROS_GETVECADDR(bn,o))( \ - __AROS_LCA(a1),\ - __AROS_LCAQUAD(a2))),\ - bn) - -#define AROS_LC0(t,n,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(void))__AROS_GETVECADDR(bn,o))()),\ - bn) -#define AROS_LC1(t,n,a1,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1))),\ - bn) -#define AROS_LC2(t,n,a1,a2,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2))),\ - bn) -#define AROS_LC3(t,n,a1,a2,a3,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3))),\ - bn) -#define AROS_LC4(t,n,a1,a2,a3,a4,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4))),\ - bn) -#define AROS_LC5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5))),\ - bn) -#define AROS_LC6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6))),\ - bn) -#define AROS_LC7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7))),\ - bn) -#define AROS_LC8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8))),\ - bn) -#define AROS_LC9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9))),\ - bn) -#define AROS_LC10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10))),\ - bn) -#define AROS_LC11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11))),\ - bn) -#define AROS_LC12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12))),\ - bn) -#define AROS_LC13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13))),\ - bn) -#define AROS_LC14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13),\ - __AROS_LPA(a14)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13),\ - __AROS_LCA(a14))),\ - bn) -#define AROS_LC15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ - AROS_LC_CALL(t, \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13),\ - __AROS_LPA(a14),\ - __AROS_LPA(a15)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13),\ - __AROS_LCA(a14),\ - __AROS_LCA(a15))),\ - bn) - -#define AROS_LC0NR(t,n,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(void))__AROS_GETVECADDR(bn,o))()),\ - bn) -#define AROS_LC1NR(t,n,a1,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1))),\ - bn) -#define AROS_LC2NR(t,n,a1,a2,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2))),\ - bn) -#define AROS_LC3NR(t,n,a1,a2,a3,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3))),\ - bn) -#define AROS_LC4NR(t,n,a1,a2,a3,a4,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4))),\ - bn) -#define AROS_LC5NR(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5))),\ - bn) -#define AROS_LC6NR(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6))),\ - bn) -#define AROS_LC7NR(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7))),\ - bn) -#define AROS_LC8NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8))),\ - bn) -#define AROS_LC9NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9))),\ - bn) -#define AROS_LC10NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10))),\ - bn) -#define AROS_LC11NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11))),\ - bn) -#define AROS_LC12NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12))),\ - bn) -#define AROS_LC13NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13))),\ - bn) -#define AROS_LC14NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13),\ - __AROS_LPA(a14)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13),\ - __AROS_LCA(a14))),\ - bn) -#define AROS_LC15NR(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ - AROS_LC_CALLNR( \ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LPA(a1),\ - __AROS_LPA(a2),\ - __AROS_LPA(a3),\ - __AROS_LPA(a4),\ - __AROS_LPA(a5),\ - __AROS_LPA(a6),\ - __AROS_LPA(a7),\ - __AROS_LPA(a8),\ - __AROS_LPA(a9),\ - __AROS_LPA(a10),\ - __AROS_LPA(a11),\ - __AROS_LPA(a12),\ - __AROS_LPA(a13),\ - __AROS_LPA(a14),\ - __AROS_LPA(a15)))__AROS_GETVECADDR(bn,o))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10),\ - __AROS_LCA(a11),\ - __AROS_LCA(a12),\ - __AROS_LCA(a13),\ - __AROS_LCA(a14),\ - __AROS_LCA(a15))),\ - bn) - - -/* Special calls: Call a library function without the name just by the ADDRESS */ -#ifndef AROS_CALL0 -#define AROS_CALL0(returntype,address,basetype,basename) \ - AROS_LC_CALL(returntype,\ - (((__AROS_LC_PREFIX returntype(*)(void))\ - (void *)(address))()),\ - basename) -#endif - -#ifndef AROS_CALL0NR -#define AROS_CALL0NR(returntype,address,basetype,basename) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX returntype(*)(void))\ - (void *)(address))()),\ - basename) -#endif - -#ifndef AROS_CALL1 -#define AROS_CALL1(t,a,a1,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1)))\ - (void *)(a))(\ - __AROS_LCA(a1))),\ - bn) -#endif - -#ifndef AROS_CALL1NR -#define AROS_CALL1NR(t,a,a1,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1)))\ - (void *)(a))(\ - __AROS_LCA(a1))),\ - bn) -#endif - -#ifndef AROS_CALL2 -#define AROS_CALL2(t,a,a1,a2,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2))),\ - bn) -#endif - -#ifndef AROS_CALL2NR -#define AROS_CALL2NR(t,a,a1,a2,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2))),\ - bn) -#endif - -#ifndef AROS_CALL3 -#define AROS_CALL3(t,a,a1,a2,a3,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3))),\ - bn) -#endif - -#ifndef AROS_CALL3NR -#define AROS_CALL3NR(t,a,a1,a2,a3,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3))),\ - bn) -#endif - -#ifndef AROS_CALL4 -#define AROS_CALL4(t,a,a1,a2,a3,a4,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4))),\ - bn) -#endif - -#ifndef AROS_CALL4NR -#define AROS_CALL4NR(t,a,a1,a2,a3,a4,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4))),\ - bn) -#endif - -#ifndef AROS_CALL5 -#define AROS_CALL5(t,a,a1,a2,a3,a4,a5,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5))),\ - bn) -#endif - -#ifndef AROS_CALL5NR -#define AROS_CALL5NR(t,a,a1,a2,a3,a4,a5,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5))),\ - bn) -#endif - -#ifndef AROS_CALL6 -#define AROS_CALL6(t,a,a1,a2,a3,a4,a5,a6,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6))),\ - bn) -#endif - -#ifndef AROS_CALL6NR -#define AROS_CALL6NR(t,a,a1,a2,a3,a4,a5,a6,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6))),\ - bn) -#endif - -#ifndef AROS_CALL7 -#define AROS_CALL7(t,a,a1,a2,a3,a4,a5,a6,a7,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7))),\ - bn) -#endif - -#ifndef AROS_CALL7NR -#define AROS_CALL7NR(t,a,a1,a2,a3,a4,a5,a6,a7,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7))),\ - bn) -#endif - -#ifndef AROS_CALL8 -#define AROS_CALL8(t,a,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8))),\ - bn) -#endif - -#ifndef AROS_CALL8NR -#define AROS_CALL8NR(t,a,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8))),\ - bn) -#endif - -#ifndef AROS_CALL9 -#define AROS_CALL9(t,a,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8),\ - __AROS_LDA(a9)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9))),\ - bn) -#endif - -#ifndef AROS_CALL9NR -#define AROS_CALL9NR(t,a,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8),\ - __AROS_LDA(a9)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9))),\ - bn) -#endif - -#ifndef AROS_CALL10 -#define AROS_CALL10(t,a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn) \ - AROS_LC_CALL(t,\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8),\ - __AROS_LDA(a9),\ - __AROS_LDA(a10)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10))),\ - bn) -#endif - -#ifndef AROS_CALL10NR -#define AROS_CALL10NR(t,a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn) \ - AROS_LC_CALLNR(\ - (((__AROS_LC_PREFIX t(*)(\ - __AROS_LDA(a1),\ - __AROS_LDA(a2),\ - __AROS_LDA(a3),\ - __AROS_LDA(a4),\ - __AROS_LDA(a5),\ - __AROS_LDA(a6),\ - __AROS_LDA(a7),\ - __AROS_LDA(a8),\ - __AROS_LDA(a9),\ - __AROS_LDA(a10)))\ - (void *)(a))(\ - __AROS_LCA(a1),\ - __AROS_LCA(a2),\ - __AROS_LCA(a3),\ - __AROS_LCA(a4),\ - __AROS_LCA(a5),\ - __AROS_LCA(a6),\ - __AROS_LCA(a7),\ - __AROS_LCA(a8),\ - __AROS_LCA(a9),\ - __AROS_LCA(a10))),\ - bn) -#endif - -/* Special calls: Call a library function without the name just by the OFFSET */ - -#ifndef AROS_LVO_CALL0 -#define AROS_LVO_CALL0(returntype,basetype,basename,offset,system) \ - AROS_CALL0(returntype,__AROS_GETVECADDR(basename,offset),basetype,basename) -#endif - -#ifndef AROS_LVO_CALL0NR -#define AROS_LVO_CALL0NR(returntype,basetype,basename,offset,system) \ - AROS_CALL0NR(returntype,__AROS_GETVECADDR(basename,offset),basetype,basename) -#endif - -#ifndef AROS_LVO_CALL1 -#define AROS_LVO_CALL1(t,a1,bt,bn,o,s) \ - AROS_CALL1(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),bt,bn) -#endif - -#ifndef AROS_LVO_CALL1NR -#define AROS_LVO_CALL1NR(t,a1,bt,bn,o,s) \ - AROS_CALL1NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),bt,bn) -#endif - -#ifndef AROS_LVO_CALL2 -#define AROS_LVO_CALL2(t,a1,a2,bt,bn,o,s) \ - AROS_CALL2(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),bt,bn) -#endif - -#ifndef AROS_LVO_CALL2NR -#define AROS_LVO_CALL2NR(t,a1,a2,bt,bn,o,s) \ - AROS_CALL2NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),bt,bn) -#endif - -#ifndef AROS_LVO_CALL3 -#define AROS_LVO_CALL3(t,a1,a2,a3,bt,bn,o,s) \ - AROS_CALL3(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),bt,bn) -#endif - -#ifndef AROS_LVO_CALL3NR -#define AROS_LVO_CALL3NR(t,a1,a2,a3,bt,bn,o,s) \ - AROS_CALL3NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),bt,bn) -#endif - -#ifndef AROS_LVO_CALL4 -#define AROS_LVO_CALL4(t,a1,a2,a3,a4,bt,bn,o,s) \ - AROS_CALL4(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),bt,bn) -#endif - -#ifndef AROS_LVO_CALL4NR -#define AROS_LVO_CALL4NR(t,a1,a2,a3,a4,bt,bn,o,s) \ - AROS_CALL4NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),bt,bn) -#endif - -#ifndef AROS_LVO_CALL5 -#define AROS_LVO_CALL5(t,a1,a2,a3,a4,a5,bt,bn,o,s) \ - AROS_CALL5(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),bt,bn) -#endif - -#ifndef AROS_LVO_CALL5NR -#define AROS_LVO_CALL5NR(t,a1,a2,a3,a4,a5,bt,bn,o,s) \ - AROS_CALL5NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),bt,bn) -#endif - -#ifndef AROS_LVO_CALL6 -#define AROS_LVO_CALL6(t,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - AROS_CALL6(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),AROS_LCA(a6),bt,bn) -#endif - -#ifndef AROS_LVO_CALL6NR -#define AROS_LVO_CALL6NR(t,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - AROS_CALL6NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),AROS_LCA(a6),bt,bn) -#endif - -#ifndef AROS_LVO_CALL7 -#define AROS_LVO_CALL7(t,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - AROS_CALL7(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),AROS_LCA(a6),AROS_LCA(a7),bt,bn) -#endif - -#ifndef AROS_LVO_CALL7NR -#define AROS_LVO_CALL7NR(t,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - AROS_CALL7NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),AROS_LCA(a6),AROS_LCA(a7),bt,bn) -#endif - -#ifndef AROS_LVO_CALL8 -#define AROS_LVO_CALL8(t,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - AROS_CALL8(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),bt,bn) -#endif - -#ifndef AROS_LVO_CALL8NR -#define AROS_LVO_CALL8NR(t,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - AROS_CALL8NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),bt,bn) -#endif - -#ifndef AROS_LVO_CALL9 -#define AROS_LVO_CALL9(t,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - AROS_CALL9(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),AROS_LCA(a9),bt,bn) -#endif - -#ifndef AROS_LVO_CALL9NR -#define AROS_LVO_CALL9NR(t,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - AROS_CALL9NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),AROS_LCA(a9),bt,bn) -#endif - -#ifndef AROS_LVO_CALL10 -#define AROS_LVO_CALL10(t,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - AROS_CALL10(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCA(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),AROS_LCA(a9),AROS_LCA(a10),bt,bn) -#endif - -#ifndef AROS_LVO_CALL10NR -#define AROS_LVO_CALL10NR(t,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - AROS_CALL10NR(t,__AROS_GETVECADDR(bn,o),AROS_LCA(a1),AROS_LCA(a2),AROS_LCA(a3),AROS_LCA(a4),AROS_LCS(a5),AROS_LCA(a6),AROS_LCA(a7),AROS_LCA(a8),AROS_LCA(a9),AROS_LCA(a10),bt,bn) -#endif -#endif /* !__AROS_CPU_SPECIFIC_LC */ - -#ifndef __AROS_CPU_SPECIFIC_LD -/* Declarations for library functions which need the libbase */ -# define AROS_LDQUAD1(t,n,a1,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDAQUAD(a1)) -# define AROS_LDQUAD2(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDAQUAD(a1), \ - __AROS_LDAQUAD(a2)) - -# define AROS_LD0(t,n,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) (void) -# define AROS_LD1(t,n,a1,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1)) -# define AROS_LD2(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2)) -# define AROS_LD3(t,n,a1,a2,a3,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3)) -# define AROS_LD4(t,n,a1,a2,a3,a4,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4)) -# define AROS_LD5(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5)) -# define AROS_LD6(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6)) -# define AROS_LD7(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7)) -# define AROS_LD8(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8)) -# define AROS_LD9(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9)) -# define AROS_LD10(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10)) -# define AROS_LD11(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11)) -# define AROS_LD12(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12)) -# define AROS_LD13(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13)) -# define AROS_LD14(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13), \ - __AROS_LDA(a14)) -# define AROS_LD15(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13), \ - __AROS_LDA(a14), \ - __AROS_LDA(a15)) - -/* Declarations for library functions which don't need the libbase */ -# define AROS_LD0I(t,n,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) (void) -# define AROS_LD1I(t,n,a1,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1)) -# define AROS_LD2I(t,n,a1,a2,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2)) -# define AROS_LD3I(t,n,a1,a2,a3,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3)) -# define AROS_LD4I(t,n,a1,a2,a3,a4,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4)) -# define AROS_LD5I(t,n,a1,a2,a3,a4,a5,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5)) -# define AROS_LD6I(t,n,a1,a2,a3,a4,a5,a6,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6)) -# define AROS_LD7I(t,n,a1,a2,a3,a4,a5,a6,a7,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7)) -# define AROS_LD8I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8)) -# define AROS_LD9I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9)) -# define AROS_LD10I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10)) -# define AROS_LD11I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11)) -# define AROS_LD12I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12)) -# define AROS_LD13I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13)) -# define AROS_LD14I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13), \ - __AROS_LDA(a14)) -# define AROS_LD15I(t,n,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,bt,bn,o,s) \ - __AROS_LD_PREFIX t AROS_SLIB_ENTRY(n,s,o) ( \ - __AROS_LDA(a1), \ - __AROS_LDA(a2), \ - __AROS_LDA(a3), \ - __AROS_LDA(a4), \ - __AROS_LDA(a5), \ - __AROS_LDA(a6), \ - __AROS_LDA(a7), \ - __AROS_LDA(a8), \ - __AROS_LDA(a9), \ - __AROS_LDA(a10), \ - __AROS_LDA(a11), \ - __AROS_LDA(a12), \ - __AROS_LDA(a13), \ - __AROS_LDA(a14), \ - __AROS_LDA(a15)) -#endif /* !__AROS_CPU_SPECIFIC_LD */ diff --git a/compiler/arossupport/include/relbase.h b/compiler/arossupport/include/relbase.h deleted file mode 100644 index e60bd9d69a..0000000000 --- a/compiler/arossupport/include/relbase.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. - $Id:$ - - Desc: Macros for storing library base on alternative stack - Lang: english -*/ - -#ifndef AROS_RELBASE_H -#define AROS_RELBASE_H - -#include - -/* Declare relbase if asked */ -#if !defined(AROS_GET_RELBASE) || !defined(AROS_SET_RELBASE) - -__BEGIN_DECLS - -void *aros_get_relbase(void); -void *aros_set_relbase(void *libbase); -void aros_push_relbase(void *libbase); -void aros_push2_relbase(void *libbase, void *ptr); -void *aros_pop_relbase(void); -void *aros_pop2_relbase(void); - -__END_DECLS - -/* Uncomment next define to get debug output for relbase calls - */ -//#define AROS_RELBASE_DEBUG 1 - -/* Also use debug version if we may not define global SysBase */ -#if !defined(AROS_RELBASE_DEBUG) && !defined(__NOLIBBASE__) && !defined(__EXEC_NOLIBBASE__) - -#include -#include - -#include - -extern struct ExecBase *SysBase; - -static inline void *__aros_get_relbase_inline(void) -{ - return (void *)aros_get_altstack(SysBase->ThisTask); -} - -static inline void *__aros_set_relbase_inline(void *libbase) -{ - return (void *)aros_set_altstack(SysBase->ThisTask, (IPTR)libbase); -} - -static inline void __aros_push_relbase_inline(void *libbase) -{ - aros_push_altstack(SysBase->ThisTask, (IPTR)libbase); -} - -static inline void *__aros_pop_relbase_inline(void) -{ - return (void *)aros_pop_altstack(SysBase->ThisTask); -} - -#define AROS_GET_RELBASE __aros_get_relbase_inline() -#define AROS_SET_RELBASE(x) __aros_set_relbase_inline(x) -#define AROS_PUSH_RELBASE(x) __aros_push_relbase_inline(x) -#define AROS_POP_RELBASE __aros_pop_relbase_inline() - -#else /* AROS_RELBASE_DEBUG || __NOLIBBASE__ || __EXEC_NOLIBBASE__ */ - -#define AROS_GET_RELBASE aros_get_relbase() -#define AROS_SET_RELBASE(x) aros_set_relbase(x) -#define AROS_PUSH_RELBASE(x) aros_push_relbase(x) -#define AROS_POP_RELBASE aros_pop_relbase() - -#endif /* !AROS_RELBASE_DEBUG && !__NOLIBBASE__ && !__EXEC_NOLIBBASE__ */ - -#endif /* !AROS_GET_RELBASE || !AROS_SET_RELBASE */ - -/* If AROS_GET_LIBBASE/AROS_SET_LIBBASE use relbase by defining them as resp. - * AROS_GET_RELBASE/AROS_SET_RELBASE - */ -#ifndef AROS_GET_LIBBASE -#define AROS_GET_LIBBASE AROS_GET_RELBASE -#define AROS_SET_LIBBASE(x) AROS_SET_RELBASE(x) -#endif - -#endif diff --git a/compiler/arossupport/kprintf.c b/compiler/arossupport/kprintf.c index c50c0bbaca..1d03a3188c 100644 --- a/compiler/arossupport/kprintf.c +++ b/compiler/arossupport/kprintf.c @@ -94,10 +94,6 @@ static inline int atoi(const char *c) va_list ap; int result; - /* Don't try to call RawPutChar if SysBase is not initialized */ - if (!SysBase) - return 0; - va_start (ap, fmt); result = vkprintf (fmt, ap); va_end (ap); @@ -116,10 +112,6 @@ int vkprintf (const UBYTE * fmt, va_list args) unsigned long val; long lval = 0; - /* Don't try to call RawPutChar if SysBase is not initialized */ - if (!SysBase) - return 0; - if (!fmt) { RawPutChars ("(null)", 6); diff --git a/compiler/arossupport/mmakefile.src b/compiler/arossupport/mmakefile.src index b4baea6c89..314b3714cc 100644 --- a/compiler/arossupport/mmakefile.src +++ b/compiler/arossupport/mmakefile.src @@ -5,8 +5,6 @@ include $(TOP)/config/make.cfg FILES := \ - aros_altstack \ - aros_relbase \ calcchecksum \ clonerastport \ createbstr \ diff --git a/compiler/clib/__arosc_privdata.h b/compiler/clib/__arosc_privdata.h index bbe3b5abec..41d230014b 100644 --- a/compiler/clib/__arosc_privdata.h +++ b/compiler/clib/__arosc_privdata.h @@ -1,7 +1,6 @@ #ifndef ___AROSC_PRIVDATA_H #define ___AROSC_PRIVDATA_H -#include #include #include #include diff --git a/compiler/clib/__exitfunc.c b/compiler/clib/__exitfunc.c index 95d01d468e..652db1cdd8 100644 --- a/compiler/clib/__exitfunc.c +++ b/compiler/clib/__exitfunc.c @@ -35,8 +35,6 @@ void __callexitfuncs(void) (aen = (struct AtExitNode *) REMHEAD((struct List *) &aroscbase->acb_atexit_list)) ) { - int _error = __arosc_startup_error; - void *oldrelbase = AROS_SET_RELBASE(aen->relbase); switch (aen->node.ln_Type) { case AEN_VOID: @@ -44,10 +42,9 @@ void __callexitfuncs(void) break; case AEN_PTR: - aen->func.fptr(_error, aen->ptr); + aen->func.fptr(__arosc_startup_error, aen->ptr); break; } - AROS_SET_RELBASE(oldrelbase); } } diff --git a/compiler/clib/__exitfunc.h b/compiler/clib/__exitfunc.h index ec6541a24f..88267aec22 100644 --- a/compiler/clib/__exitfunc.h +++ b/compiler/clib/__exitfunc.h @@ -2,13 +2,12 @@ #define ___EXITFUNC_H /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2002, The AROS Development Team. All rights reserved. $Id$ */ #include #include -#include struct AtExitNode { @@ -18,7 +17,7 @@ struct AtExitNode void (*fvoid)(void); void (*fptr)(int, void *); } func; - void *ptr, *relbase; + void *ptr; }; #define AEN_VOID 0 diff --git a/compiler/clib/__vfork.c b/compiler/clib/__vfork.c index eed811d8cf..4344d976f6 100644 --- a/compiler/clib/__vfork.c +++ b/compiler/clib/__vfork.c @@ -74,8 +74,6 @@ LONG launcher() aroscbase->acb_flags |= VFORK_PARENT; - oldbase = AROS_SET_LIBBASE(aroscbase); - udata->child_aroscbase = aroscbase; aroscbase->acb_parent_does_upath = pbase->acb_doupath; @@ -151,8 +149,6 @@ LONG launcher() FreeSignal(child_signal); } - AROS_SET_LIBBASE(oldbase); - CloseLibrary((struct Library *)aroscbase); return 0; diff --git a/compiler/clib/arosc.conf b/compiler/clib/arosc.conf index 19c34bc126..b43c63486c 100644 --- a/compiler/clib/arosc.conf +++ b/compiler/clib/arosc.conf @@ -7,7 +7,6 @@ options pertaskbase ##begin cdef struct arosc_userdata; -struct AtExitNode; #define _STDIO_H_NOMACRO #include #include @@ -154,8 +153,7 @@ struct tm *gmtime(const time_t *) void perror(const char *s) char *ctime(const time_t *) clock_t clock(void) -#int atexit(void (*func)(void)) -.skip 1 +int atexit(void (*func)(void)) int pipe(int filedes[2]) int fcntl(int fd, int cmd, ...) double difftime(time_t, time_t) @@ -185,8 +183,7 @@ void __assert (const char *, const char *, unsigned int) lldiv_t lldiv(long long int numer, long long int denom) long long int strtoll(const char * restrict nptr, char ** restrict endptr, int base) unsigned long long int strtoull(const char * restrict nptr, char ** restrict endptr, int base) -#int on_exit(void (*func)(int, void *), void *) -.skip 1 +int on_exit(void (*func)(int, void *), void *) pid_t getpid(void) FILE *popen(const char *, const char *) int stcd_l(const char * in, long * lvalue) @@ -321,5 +318,4 @@ speed_t cfgetospeed(const struct termios *__termios_p) int cfsetispeed(struct termios *__termios_p, speed_t speed) int cfsetospeed(struct termios *__termios_p, speed_t speed) struct arosc_userdata *__get_arosc_userdata(void) -int __addexitfunc(struct AtExitNode *aen); ##end functionlist diff --git a/compiler/clib/atexit.c b/compiler/clib/atexit.c index 1babc8cd55..6598d9690e 100644 --- a/compiler/clib/atexit.c +++ b/compiler/clib/atexit.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2001, The AROS Development Team. All rights reserved. $Id$ */ @@ -43,7 +43,6 @@ aen->node.ln_Type = AEN_VOID; aen->func.fvoid = func; - aen->relbase = AROS_GET_RELBASE; return __addexitfunc(aen); } diff --git a/compiler/clib/include/setjmp.h b/compiler/clib/include/setjmp.h index cc2a46b16d..f429dc21db 100644 --- a/compiler/clib/include/setjmp.h +++ b/compiler/clib/include/setjmp.h @@ -11,17 +11,16 @@ #include -/* Room for registers and one extra for *(SysBase->ThisTask->tc_SPLower) */ #ifdef __mc68000__ -# define _JMPLEN 12+1 +# define _JMPLEN 12 #elif __i386__ -# define _JMPLEN 7+1 +# define _JMPLEN 7 #elif __x86_64__ -# define _JMPLEN 15+1 +# define _JMPLEN 15 #elif __powerpc__ -# define _JMPLEN 58+1 +# define _JMPLEN 58 #elif __arm__ -# define _JMPLEN 63+1 +# define _JMPLEN 63 #endif typedef struct __jmp_buf diff --git a/compiler/clib/mmakefile.src b/compiler/clib/mmakefile.src index 4a523569c8..3641cc0e67 100644 --- a/compiler/clib/mmakefile.src +++ b/compiler/clib/mmakefile.src @@ -23,7 +23,6 @@ COMMON := \ __alloca \ __filesystem_support \ __isinf \ - atexit \ bcmp \ bcopy \ bzero \ @@ -41,7 +40,6 @@ COMMON := \ memcpy \ memmove \ memset \ - on_exit \ putchar \ stccpy \ stpblk \ @@ -108,6 +106,7 @@ SHARED := \ access \ asctime \ asctime_r \ + atexit \ atof \ atoi \ atol \ @@ -257,6 +256,7 @@ SHARED := \ mrand48 \ nanosleep \ nrand48 \ + on_exit \ open \ opendir \ pathconf \ diff --git a/compiler/clib/on_exit.c b/compiler/clib/on_exit.c index ffcdc75481..f436c08dbf 100644 --- a/compiler/clib/on_exit.c +++ b/compiler/clib/on_exit.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2002, The AROS Development Team. All rights reserved. $Id$ */ @@ -41,7 +41,6 @@ aen->node.ln_Type = AEN_PTR; aen->func.fptr = func; aen->ptr = arg; - aen->relbase = AROS_GET_RELBASE; return __addexitfunc(aen); } diff --git a/compiler/startup/startup.c b/compiler/startup/startup.c index d23d7aad95..c686bf24ae 100644 --- a/compiler/startup/startup.c +++ b/compiler/startup/startup.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/rom/exec/newaddtask.c b/rom/exec/newaddtask.c index bdbad05965..7aed39bea4 100644 --- a/rom/exec/newaddtask.c +++ b/rom/exec/newaddtask.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "etask.h" @@ -151,9 +150,6 @@ if (task->tc_SPReg==NULL) task->tc_SPReg = (UBYTE *)(task->tc_SPUpper) - SP_OFFSET; - /* Initialize alternative stack */ - aros_init_altstack(task); - #ifdef AROS_STACKALIGN if ((IPTR)task->tc_SPReg & (AROS_STACKALIGN - 1)) { diff --git a/rom/exec/newstackswap.c b/rom/exec/newstackswap.c index 732ab70812..5cf8555702 100644 --- a/rom/exec/newstackswap.c +++ b/rom/exec/newstackswap.c @@ -37,12 +37,11 @@ running on a new stack. NOTES - The end of the stack will be initialized for an alternative stack - overwriting possible available data there. EXAMPLE BUGS + Do not attempt to pass in a prebuilt stack - it will be erased. SEE ALSO StackSwap() diff --git a/test/altstack.c b/test/altstack.c deleted file mode 100644 index 0c35881982..0000000000 --- a/test/altstack.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright © 1995-2002, The AROS Development Team. All rights reserved. - $Id$ - - Test for altstack from arossupport -*/ - -#include -#include -#include - -int main(void) -{ - struct Task *t = FindTask(NULL); - IPTR v; - - aros_set_altstack(t, 1); - - assert(aros_get_altstack(t) == (IPTR)1); - - aros_push_altstack(t, 2); - - assert(aros_get_altstack(t) == (IPTR)2); - - v = aros_pop_altstack(t); - - assert(v == (IPTR)2); - - assert(aros_get_altstack(t) == (IPTR)1); - - return 0; -} diff --git a/test/clib/jmpbuf.c b/test/clib/jmpbuf.c index 3aa36a61b6..d791d37a11 100644 --- a/test/clib/jmpbuf.c +++ b/test/clib/jmpbuf.c @@ -1,4 +1,3 @@ -#include #include #include @@ -41,7 +40,7 @@ int main(void) me = FindTask(NULL); printf("Task 0x%p (%s), stack 0x%p - 0x%p\n", me, me->tc_Node.ln_Name, me->tc_SPLower, me->tc_SPUpper); - printf("Function at 0x%p, altstack 0x%p\n", main, *((void **)me->tc_SPLower)); + printf("Function at 0x%p%p\n", main); printf("Buffer at 0x%p (%u bytes)\n", buf, (unsigned int)sizeof(buf)); HexDump((const UBYTE *)buf, sizeof(buf)); diff --git a/test/mmakefile.src b/test/mmakefile.src index 3917a20f17..7a57d564db 100644 --- a/test/mmakefile.src +++ b/test/mmakefile.src @@ -91,7 +91,6 @@ COMMONTESTFILES := \ versionlib \ runtests \ fsresource \ - altstack \ taskstorage HOSTEDTESTFILES := \ diff --git a/tools/genmodule/config.c b/tools/genmodule/config.c index 70bb6a7579..c7e3799479 100644 --- a/tools/genmodule/config.c +++ b/tools/genmodule/config.c @@ -756,7 +756,7 @@ static void readsectionconfig(struct config *cfg, struct classinfo *cl, int incl "noautolib", "noexpunge", "noresident", "peropenerbase", "pertaskbase", "includes", "noincludes", "nostubs", "autoinit", "noautoinit", "resautoinit", "noopenclose", - "selfinit", "baserel" + "selfinit" }; const unsigned int optionnums = sizeof(optionnames)/sizeof(char *); int optionnum; @@ -834,9 +834,6 @@ static void readsectionconfig(struct config *cfg, struct classinfo *cl, int incl exitfileerror(20, "option resautoinit and selfinit are incompatible\n"); cfg->options |= OPTION_SELFINIT; break; - case 14: /* baserel */ - cfg->options |= OPTION_BASEREL; - break; } while (isspace(*s)) s++; } while(*s !='\0'); diff --git a/tools/genmodule/config.h b/tools/genmodule/config.h index da915d0369..5b947a92e2 100644 --- a/tools/genmodule/config.h +++ b/tools/genmodule/config.h @@ -21,7 +21,7 @@ enum modtype { UNSPECIFIED, LIBRARY, MCC, MUI, MCP, DEVICE, RESOURCE, IMAGE, GAD enum optionbit { BIT_NOAUTOLIB, BIT_NOEXPUNGE, BIT_NORESIDENT, BIT_DUPBASE, BIT_PERTASKBASE, BIT_INCLUDES, BIT_NOINCLUDES, BIT_STUBS, BIT_NOSTUBS, BIT_AUTOINIT, BIT_NOAUTOINIT, - BIT_RESAUTOINIT, BIT_NOOPENCLOSE, BIT_SELFINIT, BIT_BASEREL + BIT_RESAUTOINIT, BIT_NOOPENCLOSE, BIT_SELFINIT }; enum optionflags { @@ -38,8 +38,7 @@ enum optionflags OPTION_NOAUTOINIT = 1<modulenameupper, cfg->modulenameupper, banner, cfg->modulename); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - "#define AROS_BASEREL_LIBRARY\n"); - fprintf(out, + "\n" "#include \n" "#include \n" "#include \n" "#include \n" "\n" "__BEGIN_DECLS\n" - "\n" + "\n", + cfg->modulenameupper, cfg->modulenameupper, banner, cfg->modulename ); freeBanner(banner); @@ -391,8 +387,8 @@ writedefinestack(FILE *out, struct functionhead *funclistit, struct config *cfg) { struct functionarg *arglistit; - /* Only if no baserel. define can't handle libbase passing */ - if (cfg->options & (OPTION_BASEREL | OPTION_PERTASKBASE)) + /* Only if no peropener or pertask base */ + if (cfg->options & OPTION_DUPBASE) return; fprintf(out, "#define %s ((%s (*)(", funclistit->name, funclistit->type); diff --git a/tools/genmodule/writeincinline.c b/tools/genmodule/writeincinline.c index bcbd12496a..1c25adc0c5 100644 --- a/tools/genmodule/writeincinline.c +++ b/tools/genmodule/writeincinline.c @@ -35,18 +35,13 @@ void writeincinline(struct config *cfg) "/*\n" " Desc: Inline function for %s\n" "*/\n" - "\n", - cfg->modulenameupper, cfg->modulenameupper, banner, cfg->modulename - ); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - "#define AROS_BASEREL_LIBRARY\n"); - fprintf(out, + "\n" "#include \n" "#include \n" "#include \n" "#include \n" - "\n" + "\n", + cfg->modulenameupper, cfg->modulenameupper, banner, cfg->modulename ); freeBanner(banner); diff --git a/tools/genmodule/writestart.c b/tools/genmodule/writestart.c index 46dfda0695..a84167e712 100644 --- a/tools/genmodule/writestart.c +++ b/tools/genmodule/writestart.c @@ -135,8 +135,6 @@ static void writedecl(FILE *out, struct config *cfg) "\n", cfg->modulename ); - if (cfg->options & OPTION_BASEREL) - fprintf(out, "#include \n"); /* Write out declaration section provided in the config file */ for (linelistit = cfg->cdeflines; linelistit != NULL; linelistit = linelistit->next) @@ -768,8 +766,6 @@ static void writeinitlib(FILE *out, struct config *cfg) } } - if (cfg->options & OPTION_BASEREL) - fprintf(out, " void *oldbase = AROS_SET_LIBBASE(lh);\n"); if (cfg->options & OPTION_DUPBASE) fprintf(out, " __baseslot = AllocTaskStorageSlot();\n" @@ -825,8 +821,6 @@ static void writeinitlib(FILE *out, struct config *cfg) fprintf(out, " set_call_libfuncs(SETNAME(CLASSESEXPUNGE), -1, 0, lh);\n"); if (!(cfg->options & OPTION_NOAUTOLIB)) fprintf(out, " set_close_libraries();\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, " (void)AROS_SET_LIBBASE(oldbase);\n"); if (cfg->modtype != HANDLER) { @@ -877,9 +871,6 @@ static void writeinitlib(FILE *out, struct config *cfg) if (cfg->handlerlist) fprintf(out, " GM_UNIQUENAME(InitHandler)();\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " (void)AROS_SET_LIBBASE(oldbase);\n"); fprintf(out, " return lh;\n" " }\n" @@ -1040,29 +1031,16 @@ static void writeopenlib(FILE *out, struct config *cfg) " tslib->taskopencount = 1;\n" " __GM_SetTSBase((LIBBASETYPEPTR)newlib);\n" ); - - if (cfg->options & OPTION_BASEREL) - fprintf(out, + fprintf(out, "\n" - " void *oldbase = AROS_SET_LIBBASE(newlib);"); - fprintf(out, - "\n" " if (!(set_open_rellibraries(newlib)\n" " && set_call_libfuncs(SETNAME(OPENLIB), 1, 1, newlib)\n" " )\n" " )\n" - " {\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " (void)AROS_SET_LIBBASE(oldbase);\n"); - fprintf(out, + " {\n" " __freebase(newlib);\n" " return NULL;\n" - " }\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " (void)AROS_SET_LIBBASE(oldbase);\n"); - fprintf(out, + " }\n" "\n" " ((struct Library *)lh)->lib_OpenCnt++;\n" " ((struct Library *)lh)->lib_Flags &= ~LIBF_DELEXP;\n" @@ -1121,24 +1099,13 @@ static void writecloselib(FILE *out, struct config *cfg) " AROS_LIBFUNC_INIT\n" "\n" ); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " void *oldbase = AROS_SET_LIBBASE(lh);\n" - "\n" - ); if (cfg->modtype == DEVICE) - { fprintf(out, " if (!set_call_devfuncs(SETNAME(CLOSEDEV), -1, 1, lh, ioreq, 0, 0))\n" - " {\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " (void)AROS_SET_LIBBASE(oldbase);\n"); - fprintf(out, + " {\n" " return BNULL;\n" " }\n" ); - } if (!(cfg->options & OPTION_DUPBASE)) { fprintf(out, @@ -1169,18 +1136,13 @@ static void writecloselib(FILE *out, struct config *cfg) ); } if (!(cfg->options & OPTION_NOEXPUNGE)) - { fprintf(out, " if\n" " (\n" " (((struct Library *)lh)->lib_OpenCnt == 0)\n" " && (((struct Library *)lh)->lib_Flags & LIBF_DELEXP)\n" " )\n" - " {\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " (void)AROS_SET_LIBBASE(oldbase);\n"); - fprintf(out, + " {\n" " return AROS_LC1(BPTR, GM_UNIQUENAME(ExpungeLib),\n" " AROS_LCA(LIBBASETYPEPTR, lh, D0),\n" " LIBBASETYPEPTR, lh, 3, %s\n" @@ -1188,13 +1150,8 @@ static void writecloselib(FILE *out, struct config *cfg) " }\n", cfg->basename ); - } - if (cfg->options & OPTION_BASEREL) - fprintf(out, - "\n" - " (void)AROS_SET_LIBBASE(oldbase);"); fprintf(out, - "\n" + "\n" " return BNULL;\n" "\n" " AROS_LIBFUNC_EXIT\n" @@ -1225,12 +1182,7 @@ static void writeexpungelib(FILE *out, struct config *cfg) " if ( ((struct Library *)lh)->lib_OpenCnt == 0 )\n" " {\n" " BPTR seglist = GM_SEGLIST_FIELD(lh);\n" - "\n"); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - " void *oldbase = AROS_SET_LIBBASE(lh);\n" - "\n"); - fprintf(out, + "\n" " if(!set_call_libfuncs(SETNAME(EXPUNGELIB), -1, 1, lh))\n" " {\n" " ((struct Library *)lh)->lib_Flags |= LIBF_DELEXP;\n" @@ -1250,10 +1202,6 @@ static void writeexpungelib(FILE *out, struct config *cfg) " CloseLibrary((struct Library *)GM_OOPBASE_FIELD(lh));\n" "#endif\n" ); - if (cfg->options & OPTION_BASEREL) - fprintf(out, - "\n" - " (void)AROS_SET_LIBBASE(oldbase);"); if (cfg->options & OPTION_PERTASKBASE) fprintf(out, " FreeTaskStorageSlot(__tsslot);\n" diff --git a/tools/genmodule/writestubs.c b/tools/genmodule/writestubs.c index ebdf1aa87c..e7e52522d8 100644 --- a/tools/genmodule/writestubs.c +++ b/tools/genmodule/writestubs.c @@ -31,7 +31,6 @@ void writestubs(struct config *cfg, int is_rel) "%s" "#define NOLIBINLINE\n" "#define NOLIBDEFINES\n" - "#define AROS_BASEREL_LIBRARY\n" "void *__comp_get_relbase(void);\n" "#ifndef __%s_NOLIBBASE__\n" "/* Do not include the libbase */\n" -- 2.11.4.GIT