Expand description
Local APIC and I/O APIC support for x86_64.
Provides initialization and control of the Local APIC (interrupt delivery to the local CPU) and I/O APIC (external interrupt routing). This module is additive to the existing PIC (8259) setup – the PIC remains as a fallback while the APIC handles advanced interrupt routing.
The Local APIC is memory-mapped at 0xFEE0_0000 (identity-mapped by the bootloader). The I/O APIC is at 0xFEC0_0000 with indirect register access via IOREGSEL/IOWIN.
Register constants and hardware API methods define the complete Local APIC and I/O APIC register set per the Intel SDM. Unused items are retained for hardware reference completeness.
Structs§
- IoApic
- I/O APIC controller.
- Local
Apic - Local APIC controller.
- Redirection
Entry - Redirection table entry – represents a 64-bit I/O APIC routing entry.
Constants§
- APIC_
TIMER_ VECTOR - APIC timer interrupt vector (dedicated, separate from PIC timer at 32).
- SCHED_
WAKE_ VECTOR - Scheduler wake IPI vector – sent to wake a remote CPU from idle to run a task.
- TLB_
SHOOTDOWN_ VECTOR - TLB shootdown IPI vector – sent to remote CPUs to flush stale TLB entries.
Functions§
- calibrate_
timer - Calibrate the APIC timer frequency using the PIT (8254) as a reference.
- init
- Initialize the Local APIC and I/O APIC.
- is_
initialized - Check whether the APIC subsystem has been initialized.
- is_
timer_ active - Check whether the APIC timer is active.
- mask_
irq - Mask an IRQ in the I/O APIC.
- read_id
- Read the Local APIC ID of the current CPU.
- send_
eoi - Send an End-Of-Interrupt to the Local APIC.
- send_
init_ ipi - Send INIT IPI to a target CPU for AP startup sequence.
- send_
ipi - Send an Inter-Processor Interrupt via the Local APIC.
- send_
ipi_ all_ excluding_ self - Broadcast an IPI to all CPUs except self. Used for TLB shootdown.
- send_
startup_ ipi - Send Startup IPI (SIPI) to a target CPU for AP startup sequence.
- set_
irq_ route - Route an external IRQ through the I/O APIC to a specific interrupt vector and destination CPU.
- setup_
timer - Configure the Local APIC timer for periodic interrupts.
- start_
timer - Start the APIC timer in periodic mode at approximately
freq_hzHz. - stop_
timer - Stop the Local APIC timer.
- ticks_
per_ ms - Get calibrated APIC timer ticks per millisecond.
- unmask_
irq - Unmask an IRQ in the I/O APIC.