Minor fixes to comments.
[AROS.git] / rom / exec / addintserver.c
blobb83dee7e05364f0b98137dfec67988738c5864ee
1 /*
2 Copyright © 1995-2011, 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_intern.h"
18 #include "chipset.h"
20 static void krnIRQwrapper(void *data1, void *data2)
22 struct Interrupt *irq = (struct Interrupt *)data1;
24 AROS_INTC1(irq->is_Code, irq->is_Data);
27 /*****************************************************************************
29 NAME */
31 AROS_LH2(void, AddIntServer,
33 /* SYNOPSIS */
34 AROS_LHA(ULONG, intNumber, D0),
35 AROS_LHA(struct Interrupt *, interrupt, A1),
37 /* LOCATION */
38 struct ExecBase *, SysBase, 28, Exec)
40 /* FUNCTION
42 INPUTS
44 RESULT
46 NOTES
47 This function also enables the corresponding chipset interrupt if
48 run on a native Amiga.
50 EXAMPLE
52 BUGS
54 SEE ALSO
56 INTERNALS
58 ******************************************************************************/
60 AROS_LIBFUNC_INIT
62 if (intNumber >= INTB_KERNEL) {
63 interrupt->is_Node.ln_Succ = KrnAddIRQHandler(intNumber - INTB_KERNEL, krnIRQwrapper, interrupt, NULL);
64 return;
67 Disable();
69 Enqueue((struct List *)SysBase->IntVects[intNumber].iv_Data, &interrupt->is_Node);
70 CUSTOM_ENABLE(intNumber);
72 Enable();
74 AROS_LIBFUNC_EXIT
75 } /* AddIntServer */