Port the SB128 code to AROS.
[AROS.git] / rom / kernel / remirqhandler.c
blob885575912e5ffb543dc4034a7ebaa83cdee2fe77
1 #include <aros/kernel.h>
2 #include <aros/libcall.h>
3 #include <proto/exec.h>
5 #include <kernel_base.h>
6 #include <kernel_debug.h>
7 #include <kernel_cpu.h>
8 #include <kernel_interrupts.h>
9 #include <kernel_memory.h>
11 /* We use own implementation of bug(), so we don't need aros/debug.h */
12 #define D(x)
14 /*****************************************************************************
16 NAME */
17 #include <proto/kernel.h>
19 AROS_LH1(void, KrnRemIRQHandler,
21 /* SYNOPSIS */
22 AROS_LHA(void *, handle, A0),
24 /* LOCATION */
25 struct KernelBase *, KernelBase, 8, Kernel)
27 /* FUNCTION
28 Remove previously installed hardware IRQ handler
30 INPUTS
31 handle - an opaque handler returned by KrnAddIRQHandler()
32 function
34 RESULT
35 None
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 ******************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct IntrNode *h = handle;
52 uint8_t irq = h->in_nr;
54 if (h && (h->in_type == it_interrupt))
56 (void)goSuper();
58 Disable();
59 REMOVE(h);
60 if (IsListEmpty(&KernelBase->kb_Interrupts[irq]))
62 ictl_disable_irq(irq, KernelBase);
64 Enable();
66 krnFreeMem(h, sizeof(struct IntrNode));
68 goUser();
71 AROS_LIBFUNC_EXIT