|
Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
|
Interrupt Controller Unit (ICU) interface. More...
#include <stdbool.h>#include <stdint.h>

Go to the source code of this file.
Data Structures | |
| struct | handler_data_t |
| Interrupt handler registration entry. More... | |
Typedefs | |
| typedef struct handler_data_t | handler_data_t |
| Interrupt handler registration entry. | |
Functions | |
| void | icu_init (const void *fdt) |
| Initialize the interrupt controller unit. | |
| bool | icu_register_irq (uint32_t irq_num, handler_data_t handler_data) |
| Register a handler for a hardware interrupt source and enable it. | |
| void | icu_unregister_irq (uint32_t irq_num) |
| Unregister a handler for a hardware interrupt source and disable it. | |
| void | icu_handle_irq (void) |
| Top-level IRQ dispatch entry point. | |
Interrupt Controller Unit (ICU) interface.
Provides declarations for early interrupt controller setup and simple interrupt management operations used by the kernel during bootstrap.
| typedef struct handler_data_t handler_data_t |
Interrupt handler registration entry.
Pairs a handler function with its opaque private data pointer. Stored in the dispatch table indexed by INTID. When an interrupt fires, the dispatcher calls handler(private_data) for the corresponding entry.
| void icu_handle_irq | ( | void | ) |
Top-level IRQ dispatch entry point.
Called directly from the EL1 IRQ exception vector. Delegates to the GICv3 handler which acknowledges the interrupt via ICC_IAR1_EL1, dispatches based on INTID, and signals EOI via ICC_EOIR1_EL1.
This indirection layer allows the ICU (Interrupt Controller Unit) interface to remain decoupled from the underlying GIC implementation, making it straightforward to swap in a different interrupt controller without modifying the vector table or exception entry code.
| void icu_init | ( | const void * | fdt | ) |
Initialize the interrupt controller unit.
Performs any platform-specific ICU startup required before the kernel can enable and service hardware interrupts.
| fdt | Pointer to the Flattened Device Tree (FDT) blob, which may be used to discover interrupt controller properties and configuration. |
| bool icu_register_irq | ( | uint32_t | irq_num, |
| handler_data_t | handler_data | ||
| ) |
Register a handler for a hardware interrupt source and enable it.
| irq_num | Physical interrupt irq_num to register. |
| handler_data | Handler function and private data to register. |
| void icu_unregister_irq | ( | uint32_t | irq_num | ) |
Unregister a handler for a hardware interrupt source and disable it.
Disables the interrupt in the GIC and clears the corresponding entry in the dispatch table. After this call the irq_num will no longer fire and any previously registered handler will not be invoked.
| irq_num | Physical interrupt irq_num to unregister. |