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.
Loading...
Searching...
No Matches
Functions
gicv3.h File Reference

ARM GICv3 interrupt controller definitions. More...

#include "icu/icu.h"
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for gicv3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gicv3_init (const void *fdt)
 Initialize the ARM GICv3 interrupt controller.
 
bool gicv3_register_irq (uint32_t irq_num, handler_data_t handler_data)
 Register a handler for a hardware interrupt source and enable it.
 
void gicv3_unregister_irq (uint32_t irq_num)
 Unregister a handler for a hardware interrupt source and disable it.
 
void gicv3_handle_irq (void)
 EL1 IRQ handler.
 

Detailed Description

ARM GICv3 interrupt controller definitions.

Declares the public GICv3 initialization and management API used by the kernel's interrupt controller unit (ICU) layer.

Author
Abhin Parekadan Jose
Date
2026-06-14

Function Documentation

◆ gicv3_handle_irq()

void gicv3_handle_irq ( void  )

EL1 IRQ handler.

Acknowledges the interrupt by reading ICC_IAR1_EL1, dispatches based on INTID, then signals EOI via ICC_EOIR1_EL1.

Must be called with IRQs already masked (hardware does this automatically on exception entry). IRQs are re-enabled on exception return (ERET).

◆ gicv3_init()

void gicv3_init ( const void *  fdt)

Initialize the ARM GICv3 interrupt controller.

Parameters
fdtPointer to the Flattened Device Tree blob used to discover the interrupt controller configuration.

◆ gicv3_register_irq()

bool gicv3_register_irq ( uint32_t  irq_num,
handler_data_t  handler_data 
)

Register a handler for a hardware interrupt source and enable it.

Installs the given handler and private data into the dispatch table for the specified INTID, then configures and enables the interrupt in the GIC. The handler will be invoked with private_data on every subsequent assertion of this interrupt.

Parameters
irq_numPhysical interrupt INTID to register (0-1019).
handler_dataHandler function and private data to register.
Returns
true if the handler was registered and the interrupt enabled successfully, false if the INTID is out of range or GIC configuration failed.

◆ gicv3_unregister_irq()

void gicv3_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 INTID will no longer fire and any previously registered handler will not be invoked.

Parameters
irq_numPhysical interrupt INTID to unregister (0-1019).