From d6d7c226bbe8013c708fa2481f119e11de1725e5 Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Fri, 10 Aug 2012 04:58:39 +0000 Subject: [PATCH] exec.library: Use the new AROS_UFIx() macros Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@45436 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/m68k-mac/exec/cause.c | 48 ++++++++------------------------------------- arch/m68k-mac/exec/core.c | 1 - rom/exec/addintserver.c | 13 ++---------- rom/exec/cause.c | 24 ++++++----------------- rom/exec/doresetcallbacks.c | 9 +++------ rom/exec/exec_init.c | 4 ++-- rom/exec/intservers.c | 42 ++++++++++++--------------------------- rom/exec/intservers.h | 28 +++++--------------------- 8 files changed, 38 insertions(+), 131 deletions(-) rewrite rom/exec/intservers.h (96%) diff --git a/arch/m68k-mac/exec/cause.c b/arch/m68k-mac/exec/cause.c index 390ab0036a..5e338694ca 100644 --- a/arch/m68k-mac/exec/cause.c +++ b/arch/m68k-mac/exec/cause.c @@ -69,13 +69,7 @@ AROS_LH1(void, Cause, if (iv->iv_Code) { - AROS_UFC5(void, iv->iv_Code, - AROS_UFCA(ULONG, 0, D1), - AROS_UFCA(ULONG, 0, A0), - AROS_UFCA(APTR, NULL, A1), - AROS_UFCA(APTR, iv->iv_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6) - ); + AROS_UFIC1(iv->iv_Code, iv->iv_Data); } } } @@ -109,29 +103,8 @@ extern void RestoreRegs(struct Task *task, struct pt_regs *regs); if (iv->iv_Code) { - /* Call it. I call with all these parameters for a reason. - - In my `Amiga ROM Kernel Reference Manual: Libraries and - Devices' (the 1.3 version), interrupt servers are called - with the following 5 parameters. - - D1 - Mask of INTENAR and INTREQR - A0 - 0xDFF000 (base of custom chips) - A1 - Interrupt Data - A5 - Interrupt Code vector - A6 - SysBase - - It is quite possible that some code uses all of these, so - I must supply them here. Obviously I will dummy some of these - though. - */ - AROS_UFC5(void, iv->iv_Code, - AROS_UFCA(ULONG, 0, D1), - AROS_UFCA(ULONG, 0, A0), - AROS_UFCA(APTR, regs, A1), - AROS_UFCA(APTR, iv->iv_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6) - ); + /* Call it. */ + AROS_UFIC1(iv->iv_Code, regs); } /* Has an interrupt told us to dispatch when leaving */ @@ -197,12 +170,7 @@ extern void RestoreRegs(struct Task *task, struct pt_regs *regs); in the kernel. */ -AROS_UFH5(void, SoftIntDispatch, - AROS_UFHA(ULONG, intReady, D1), - AROS_UFHA(struct Custom *, custom, A0), - AROS_UFHA(IPTR, intData, A1), - AROS_UFHA(IPTR, intCode, A5), - AROS_UFHA(struct ExecBase *, SysBase, A6)) +AROS_UFIH0(SoftIntDispatch) { AROS_USERFUNC_INIT @@ -224,16 +192,16 @@ AROS_UFH5(void, SoftIntDispatch, intr->is_Node.ln_Type = NT_INTERRUPT; /* Call the software interrupt. */ - AROS_UFC3(void, intr->is_Code, - AROS_UFCA(APTR, intr->is_Data, A1), - AROS_UFCA(APTR, intr->is_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6)); + AROS_UFIC1(intr->is_Code, intr->is_Data); } } /* We now re-enable software interrupts. */ softblock = 0; } + + return FALSE; + AROS_USERFUNC_EXIT } diff --git a/arch/m68k-mac/exec/core.c b/arch/m68k-mac/exec/core.c index 8ce724e0cd..917f7e82ea 100644 --- a/arch/m68k-mac/exec/core.c +++ b/arch/m68k-mac/exec/core.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/rom/exec/addintserver.c b/rom/exec/addintserver.c index 58925c32e1..b5b3999429 100644 --- a/rom/exec/addintserver.c +++ b/rom/exec/addintserver.c @@ -20,17 +20,8 @@ static void krnIRQwrapper(void *data1, void *data2) { struct Interrupt *irq = (struct Interrupt *)data1; -#ifdef __mc68000 - struct Custom *custom = (APTR)(IPTR)0xdff000; -#else - struct Custom *custom = 0; -#endif - - AROS_UFC4(int, irq->is_Code, - AROS_UFCA(struct Custom *, custom, A0), - AROS_UFCA(APTR, irq->is_Data, A1), - AROS_UFCA(APTR, irq->is_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6)); + + AROS_UFIC1(irq->is_Code, irq->is_Data); } /***************************************************************************** diff --git a/rom/exec/cause.c b/rom/exec/cause.c index 55158291c1..2a4c68bf63 100644 --- a/rom/exec/cause.c +++ b/rom/exec/cause.c @@ -47,15 +47,9 @@ The software interrupt is called with the following prototype: - AROS_UFH3(void, YourIntCode, - AROS_UFHA(APTR, interruptData, A1), - AROS_UFHA(APTR, interruptCode, A5), - AROS_UFHA(struct ExecBase *, SysBase, A6)) + AROS_UFIC1(YourIntCode, APTR, interruptData) - The interruptData is the value of the is_Data field, interruptCode - is the value of the is_Code field - it is included for historical - and compatibility reasons. You can ignore the value of interruptCode, - but you must declare it. + The interruptData is the value of the is_Data field. INPUTS softint - The interrupt you wish to schedule. When setting up @@ -135,12 +129,7 @@ This procedure could be more efficient. */ -AROS_UFH5(void, SoftIntDispatch, - AROS_UFHA(ULONG, intReady, D1), - AROS_UFHA(volatile struct Custom *, custom, A0), - AROS_UFHA(IPTR, intData, A1), - AROS_UFHA(ULONG_FUNC, intCode, A5), - AROS_UFHA(struct ExecBase *, SysBase, A6)) +AROS_UFIH0(SoftIntDispatch) { AROS_USERFUNC_INIT @@ -178,10 +167,7 @@ AROS_UFH5(void, SoftIntDispatch, KrnSti(); /* Call the software interrupt. */ - AROS_UFC3NR(void, intr->is_Code, - AROS_UFCA(APTR, intr->is_Data, A1), - AROS_UFCA(APTR, intr->is_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6)); + AROS_UFIC1(intr->is_Code, intr->is_Data); /* Get out and start loop *all* over again *from scratch*! */ break; @@ -205,5 +191,7 @@ AROS_UFH5(void, SoftIntDispatch, /* re-enable soft ints */ CUSTOM_ENABLE(INTB_SOFTINT); + return FALSE; + AROS_USERFUNC_EXIT } diff --git a/rom/exec/doresetcallbacks.c b/rom/exec/doresetcallbacks.c index 137f2bc2fd..ccdebf5bae 100644 --- a/rom/exec/doresetcallbacks.c +++ b/rom/exec/doresetcallbacks.c @@ -17,16 +17,13 @@ For improved safety callbacks are called in a Disable()d state. This function does not need to Enable(). */ -void Exec_DoResetCallbacks(struct IntExecBase *SysBase) +void Exec_DoResetCallbacks(struct IntExecBase *IntSysBase) { struct Interrupt *i; Disable(); - for (i = (struct Interrupt *)SysBase->ResetHandlers.lh_Head; i->is_Node.ln_Succ; + for (i = (struct Interrupt *)IntSysBase->ResetHandlers.lh_Head; i->is_Node.ln_Succ; i = (struct Interrupt *)i->is_Node.ln_Succ) - AROS_UFC3NR(void, i->is_Code, - AROS_UFCA(APTR, i->is_Data, A1), - AROS_UFCA(APTR, i->is_Code, A5), - AROS_UFCA(struct ExecBase *, &SysBase->pub, A6)); + AROS_UFIC1(i->is_Code, i->is_Data); } diff --git a/rom/exec/exec_init.c b/rom/exec/exec_init.c index 7ea9d687a7..44e0163fa3 100644 --- a/rom/exec/exec_init.c +++ b/rom/exec/exec_init.c @@ -223,9 +223,9 @@ AROS_UFH3S(struct ExecBase *, GM_UNIQUENAME(init), sil = (struct SoftIntList *)((struct Interrupt *)is + 1); if (i == INTB_VERTB) - is->is_Code = &VBlankServer; + is->is_Code = (VOID_FUNC)VBlankServer; else - is->is_Code = &IntServer; + is->is_Code = (VOID_FUNC)IntServer; is->is_Data = sil; NEWLIST((struct List *)sil); SetIntVector(i,is); diff --git a/rom/exec/intservers.c b/rom/exec/intservers.c index d783cc32a3..b686a04b6c 100644 --- a/rom/exec/intservers.c +++ b/rom/exec/intservers.c @@ -16,42 +16,29 @@ * to replace it... TODO: this can be done after merging exec_init.c from * i386 and PPC native. */ -AROS_UFH5(void, IntServer, - AROS_UFHA(ULONG, intMask, D0), - AROS_UFHA(struct Custom *, custom, A0), - AROS_UFHA(struct List *, intList, A1), - AROS_UFHA(APTR, intCode, A5), - AROS_UFHA(struct ExecBase *, SysBase, A6)) +AROS_UFIH3(IntServer, struct List *, intList, intMask, custom) { AROS_USERFUNC_INIT struct Interrupt * irq; + BOOL ret = FALSE; - ForeachNode(intList, irq) - { - if( AROS_UFC4(int, irq->is_Code, - AROS_UFCA(struct Custom *, custom, A0), - AROS_UFCA(APTR, irq->is_Data, A1), - AROS_UFCA(APTR, irq->is_Code, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6) - )) -#ifdef __mc68000 - ; -#else - break; + ForeachNode(intList, irq) { + if (AROS_UFIC3(irq->is_Code, irq->is_Data, intMask, custom)) { +#ifndef __mc68000 + ret = TRUE; + break; #endif + } } + return ret; + AROS_USERFUNC_EXIT } /* VBlankServer. The same as general purpose IntServer but also counts task's quantum */ -AROS_UFH5(void, VBlankServer, - AROS_UFHA(ULONG, intMask, D1), - AROS_UFHA(struct Custom *, custom, A0), - AROS_UFHA(struct List *, intList, A1), - AROS_UFHA(APTR, intCode, A5), - AROS_UFHA(struct ExecBase *, SysBase, A6)) +AROS_UFIH3(VBlankServer, struct List *, intList, intMask, custom) { AROS_USERFUNC_INIT @@ -63,12 +50,7 @@ AROS_UFH5(void, VBlankServer, } /* Chain to the generic routine */ - AROS_UFC5NR(void, IntServer, - AROS_UFCA(ULONG, intMask, D1), - AROS_UFCA(struct Custom *, custom, A0), - AROS_UFCA(struct List *, intList, A1), - AROS_UFCA(APTR, intCode, A5), - AROS_UFCA(struct ExecBase *, SysBase, A6)); + return AROS_UFIC3(IntServer, intList, intMask, custom); AROS_USERFUNC_EXIT } diff --git a/rom/exec/intservers.h b/rom/exec/intservers.h dissimilarity index 96% index d29d1e8cd8..59a9f05b05 100644 --- a/rom/exec/intservers.h +++ b/rom/exec/intservers.h @@ -1,23 +1,5 @@ -#include - -AROS_UFP5(void, IntServer, - AROS_UFPA(ULONG, intMask, D0), - AROS_UFPA(struct Custom *, custom, A0), - AROS_UFPA(struct List *, intList, A1), - AROS_UFPA(APTR, intCode, A5), - AROS_UFPA(struct ExecBase *, SysBase, A6)); - -AROS_UFP5(void, VBlankServer, - AROS_UFPA(ULONG, intMask, D0), - AROS_UFPA(struct Custom *, custom, A0), - AROS_UFPA(struct List *, intList, A1), - AROS_UFPA(APTR, intCode, A5), - AROS_UFPA(struct ExecBase *, SysBase, A6)); - -/* Implementation is in cause.c */ -AROS_UFP5(void, SoftIntDispatch, - AROS_UFPA(ULONG, intReady, D1), - AROS_UFPA(volatile struct Custom *, custom, A0), - AROS_UFPA(IPTR, intData, A1), - AROS_UFPA(ULONG_FUNC, intCode, A5), - AROS_UFPA(struct ExecBase *, SysBase, A6)); +#include + +AROS_UFIP(IntServer); +AROS_UFIP(VBlankServer); +AROS_UFIP(SoftIntDispatch); -- 2.11.4.GIT