1 #ifndef KERNEL_INTERRUPTCONTROLLERS_H
2 #define KERNEL_INTERRUPTCONTROLLERS_H
4 Copyright © 2017, The AROS Development Team. All rights reserved.
10 #ifdef KERNELIRQ_NEEDSCONTROLLERS
13 /* Interrupt controller definitions ... */
18 typedef UWORD icintrid_t
;
20 #define ICINTR_ICID(icintr) ((icintr >> 8) & 0xFF)
21 #define ICINTR_INST(icintr) (icintr & 0xFF)
26 * .ln_Node = "Controller Type" Name - set by the "driver".
27 * .ln_Type = icid_t - value filled in by/returned from krnAddInterruptController.
28 * .ln_Pri = use count - value filled in by/returned from krnAddInterruptController.
33 ULONG ic_Type
; /* IC drivers private "type" */
36 icid_t (*ic_Register
)(struct KernelBase
*); /* one time initialization called during Add */
37 BOOL (*ic_Init
)(struct KernelBase
*, icid_t
); /* */
38 BOOL (*ic_IntrEnable
)(APTR
, icid_t
, icid_t
);
39 BOOL (*ic_IntrDisable
)(APTR
, icid_t
, icid_t
);
40 BOOL (*ic_IntrAck
)(APTR
, icid_t
, icid_t
);
44 * Interrupt controller needs to re-enable
45 * the interrupt after acknowledging/processing
47 #define ICF_ACKENABLE (1 << 0)
49 #define ICF_READY (1 << 30)
50 #define ICF_DISABLED (1 << 31)
52 static inline struct IntrController
*krnGetInterruptController(struct KernelBase
*KernelBase
, icid_t icid
)
54 struct IntrController
*intContr
;
55 ForeachNode(&KernelBase
->kb_ICList
, intContr
)
57 if (intContr
->ic_Node
.ln_Type
== icid
)
65 /* Functions to be called by machine-specific code */
66 icintrid_t
krnAddInterruptController(struct KernelBase
*, struct IntrController
*);
67 struct IntrController
*krnFindInterruptController(struct KernelBase
*, ULONG
);
68 int krnInitInterruptControllers(struct KernelBase
*);
69 BOOL
krnInitInterrupt(struct KernelBase
*, icid_t
, icid_t
, icid_t
);
70 #endif /* KERNELIRQ_NEEDSCONTROLLERS */
71 #endif /* !KERNEL_INTERRUPTCONTROLLERS_H */