2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Add interrupt client to chain of interrupt servers
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"
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 /*****************************************************************************
33 AROS_LH2(void, AddIntServer
,
36 AROS_LHA(ULONG
, intNumber
, D0
),
37 AROS_LHA(struct Interrupt
*, interrupt
, A1
),
40 struct ExecBase
*, SysBase
, 28, Exec
)
49 This function also enables the corresponding chipset interrupt if
50 run on a native Amiga.
60 ******************************************************************************/
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
);
74 Enqueue((struct List
*)SysBase
->IntVects
[intNumber
].iv_Data
, &interrupt
->is_Node
);
75 CUSTOM_ENABLE(intNumber
);