Skip to main content

Module apic

Module apic 

Source
Expand description

Local APIC (Advanced Programmable Interrupt Controller) driver

Provides MMIO-based access to the Local APIC registers. The Local APIC base address is discovered via ACPI MADT and accessed through the HHDM (Higher Half Direct Map).

Constants§

IPI_RESCHED_VECTOR
Vector used for cross-CPU reschedule IPIs.
IPI_TLB_SHOOTDOWN_VECTOR
Vector used for TLB shootdown IPIs.
LVT_TIMER_MASKED
LVT Timer: masked (bit 16)
LVT_TIMER_PERIODIC
LVT Timer: periodic mode (bit 17)
LVT_TIMER_VECTOR
Dedicated Local APIC timer interrupt vector (aligned with Theseus-style setup).
REG_ESR
Error Status Register
REG_ICR_HIGH
Interrupt Command Register (high)
REG_ICR_LOW
Interrupt Command Register (low)
REG_LVT_TIMER
LVT Timer Register
REG_TIMER_CURRENT
Timer Current Count Register
REG_TIMER_DIVIDE
Timer Divide Configuration Register
REG_TIMER_INIT
Timer Initial Count Register

Functions§

eoi
Send End-of-Interrupt to the Local APIC
init
Initialize the Local APIC.
init_ap
Initialize per-core Local APIC state on Application Processors.
is_initialized
Check if the Local APIC has been initialized
is_present
Check if APIC is present via CPUID
is_x2apic_enabled
Returns true when Local APIC is running in x2APIC mode.
is_x2apic_supported
Check if x2APIC is supported via CPUID
lapic_id
Get the current Local APIC ID.
lapic_phys
Return the physical base address of the LAPIC MMIO region, or 0 if not yet initialized.
read_reg
Read a Local APIC register
send_ipi_raw
Send an IPI with a pre-built ICR low value to a specific APIC destination.
send_resched_ipi
Send a “reschedule now” IPI to the CPU identified by target_apic_id.
write_reg
Write a Local APIC register