|
|
#define | INTERRUPT_HANDLER(_interrupt) _interrupt##_handler |
| | Compute the interrupt's handler's name.
|
| |
|
#define | INTERRUPT_HANDLER_FUNCTION(_interrupt) interrupt_return_t INTERRUPT_HANDLER(_interrupt)(void *data) |
| | Define an interrupt handler function for a given interrupt You must always use this function when defining an interrupt handler.
|
| |
| #define | interrupts_disabled_scope() |
| | Define a scope inside which irqs are disabled on the current CPU. More...
|
| |
Interrupts
Here are defined the interfaces used to setup and control interrupts.
As interrupts are an architecure-dependent mechanism, the actual definitions for the strucutre are present inside the 'arch' folder. This file only serves as a common entry point for arch-generic code that would need to interact with interrupts.
- Warning
- You should never include the arch specific headers directly
◆ interrupts_disabled_scope
| #define interrupts_disabled_scope |
( |
| ) |
|
Value: for (scope_irq_off_t guard CLEANUP(scope_irq_off_destructor) = \
scope_irq_off_constructor(); \
!guard.done; guard.done = true)
WARNING: As this macro uses a for loop to function, any 'break' directive placed inside it will break out of the guarded scope instead of that of its containing loop.
◆ interrupt_frame
- Note
- This is a only a forward declaration. The actual definition is done inside the arch-specific header.
◆ interrupt_return
| Enumerator |
|---|
| INTERRUPT_HANDLED | Interrupt was handled by the handler.
|
| INTERRUPT_IGNORED | Interrupt was for another handler.
|
◆ interrupts_get_handler()
- Parameters
-
| irq | The interrupt number |
| [out] | pdata | If not NULL, the handler's associated data is stored inside this pointer (optional) |
- Note
- In the case of shared interrupts this function always returns the first installed handler.
- Returns
- The current handler function fo the IRQ
◆ interrupts_install_handler()
- Parameters
-
| irq | The IRQ number to associate the handler with |
| handler | The handler function called when the interrupt occurs |
| data | Data passed to the interrupt handler |
◆ interrupts_install_static_handler()
| error_t interrupts_install_static_handler |
( |
unsigned int |
nr, |
|
|
struct interrupt_handler * |
handler |
|
) |
| |
This function must be used only when configuring an interrupt handler at before the virtual memory subsystem is initialized (INIT_BOOTSTRAP).
The interrupt_handler strcuture is initialized and provided by the caller.
◆ interrupts_restore()
| static void interrupts_restore |
( |
bool |
enabled | ) |
|
|
inlinestatic |
- Parameters
-
| enabled | The previous interrupt state (on/off). |