|
|
#define | INTERRUPT_HANDLER(_interrupt) _interrupt##_handler |
| | Compute the interrupt's handler's name.
|
| |
|
#define | INTERRUPT_HANDLER_FUNCTION(_interrupt) u32 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...
|
| |
|
| typedef struct interrupt_frame | interrupt_frame |
| | Frame passed onto the interrupt handlers when triggering an interrupt. More...
|
| |
|
typedef u32(* | interrupt_handler) (void *) |
| | Function pointer to an interrupt handler.
|
| |
|
| void | interrupts_set_handler (u8 irq, interrupt_handler, void *) |
| | Dynamically set an interrupt handler. More...
|
| |
| interrupt_handler | interrupts_get_handler (u8 irq, void **) |
| | Retreive the current handler for a given IRQ. More...
|
| |
|
static bool | interrupts_has_been_installed (u8 irq) |
| | Return wether a custom interrupt has been installed for the given vector.
|
| |
|
const char * | interrupts_to_str (u8 nr) |
| | Returns the name of an interrupt from its vector number.
|
| |
|
static void | interrupts_disable (void) |
| | Disable interrupts on the current CPU.
|
| |
|
static void | interrupts_enable (void) |
| | Enable interrupts on the current CPU.
|
| |
| static void | interrupts_restore (bool enabled) |
| | Restore the previous interrupt state. 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.
◆ interrupts_get_handler()
- Parameters
-
| irq | The interrupt number |
| [out] | pdata | If not NULL, the handler's associated data is stored inside this pointer (optional) |
- Returns
- The current handler function fo the IRQ
◆ interrupts_restore()
| static void interrupts_restore |
( |
bool |
enabled | ) |
|
|
inlinestatic |
- Parameters
-
| enabled | The previous interrupt state (on/off). |
◆ interrupts_set_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 |
@info If data is NULL, the kernel will pass a pointer to the interrupt frame (interrup_frame) when calling the handler instead