Indentation fix, cleanup.
[AROS.git] / rom / exec / addintserver.c
blobfb11c200041042dd09066f295b9353eb0692d83e
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add interrupt client to chain of interrupt servers
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <aros/libcall.h>
11 #include <exec/execbase.h>
12 #include <exec/interrupts.h>
13 #include <hardware/intbits.h>
14 #include <proto/exec.h>
15 #include <proto/kernel.h>
17 #include "exec_debug.h"
18 #include "exec_intern.h"
19 #include "chipset.h"
21 static void krnIRQwrapper(void *data1, void *data2)
23 struct Interrupt *irq = (struct Interrupt *)data1;
24 struct ExecBase *SysBase = (struct ExecBase *)data2;
26 AROS_INTC1(irq->is_Code, irq->is_Data);
29 /*****************************************************************************
31 NAME */
33 AROS_LH2(void, AddIntServer,
35 /* SYNOPSIS */
36 AROS_LHA(ULONG, intNumber, D0),
37 AROS_LHA(struct Interrupt *, interrupt, A1),
39 /* LOCATION */
40 struct ExecBase *, SysBase, 28, Exec)
42 /* FUNCTION
44 INPUTS
46 RESULT
48 NOTES
49 This function also enables the corresponding chipset interrupt if
50 run on a native Amiga.
52 EXAMPLE
54 BUGS
56 SEE ALSO
58 INTERNALS
60 ******************************************************************************/
62 AROS_LIBFUNC_INIT
64 ExecLog(SysBase, EXECDEBUGF_EXCEPTHANDLER, "AddIntServer: Int %d, Interrupt %p\n", intNumber, interrupt);
66 if (intNumber >= INTB_KERNEL) {
67 /* N.B. ln_Succ is being re-purposed/abused here */
68 interrupt->is_Node.ln_Succ = KrnAddIRQHandler(intNumber - INTB_KERNEL, krnIRQwrapper, interrupt, SysBase);
69 return;
72 Disable();
74 Enqueue((struct List *)SysBase->IntVects[intNumber].iv_Data, &interrupt->is_Node);
75 CUSTOM_ENABLE(intNumber);
77 Enable();
79 AROS_LIBFUNC_EXIT
80 } /* AddIntServer */