Interface for interrupt controller drivers.
More...
|
| #define | PBL_INTC_STATE_DEFINE(sym, _num_irqs) |
| | Define the class state of interrupt controller sym, for the driver's define macro.
|
| |
| #define | PBL_INTC_INIT(sym, _name, _init, _parent, _ops) |
| | Initializer for the struct pbl_intc of controller sym.
|
| |
Interface for interrupt controller drivers.
A driver embeds a struct pbl_intc in its instance, sets it up with PBL_INTC_STATE_DEFINE() and PBL_INTC_INIT(), implements the struct pbl_intc_ops the class calls, and calls pbl_intc_dispatch() for each pending line.
◆ pbl_intc_line
| Data Fields |
|
void * |
arg |
Handler argument. |
|
pbl_intc_handler_t |
handler |
Handler, NULL if the line is free. |
◆ pbl_intc
| Data Fields |
|
struct pbl_device |
dev |
Device. |
|
uint32_t * |
enabled |
Enabled lines, one bit each. |
|
struct pbl_intc_line * |
lines |
State of each line. |
|
uint16_t |
num_irqs |
Number of lines. |
|
const struct pbl_intc_ops * |
ops |
Driver operations. |
◆ PBL_INTC_INIT
| #define PBL_INTC_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.lines = sym##_intc_lines, \
.enabled = sym##_intc_enabled, \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
const struct pbl_device_class pbl_intc_class
Class of the interrupt controllers.
#define PBL_ARRAY_SIZE(array)
Get the number of elements of an array.
Definition size.h:40
Initializer for the struct pbl_intc of controller sym.
- Parameters
-
| sym | Symbol of the controller instance, with its state defined by PBL_INTC_STATE_DEFINE(). |
| _name | Name. |
| _init | Device init function, or NULL. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_INTC_STATE_DEFINE
| #define PBL_INTC_STATE_DEFINE |
( |
|
sym, |
|
|
|
_num_irqs |
|
) |
| |
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Runtime state of a line.
Definition driver.h:45
#define PBL_DIV_ROUND_UP(num, denom)
Divide, rounding up for positive results.
Definition math.h:85
Define the class state of interrupt controller sym, for the driver's define macro.
- Parameters
-
| sym | Symbol of the controller instance. |
| _num_irqs | Number of lines. |
◆ pbl_intc_dispatch()
| void pbl_intc_dispatch |
( |
const struct pbl_intc * |
intc, |
|
|
uint32_t |
hwirq |
|
) |
| |
Run the handler of a pending line.
A line without a handler is disabled.
- Parameters
-
| intc | Controller. |
| hwirq | Pending line. |
◆ pbl_intc_class
Class of the interrupt controllers.