Expand description
Timer Implementation
Provides timer functionality for the kernel:
- PIT (Programmable Interval Timer) for legacy fallback
- APIC Timer for modern systems (calibrated via PIT channel 2)
Constants§
- NS_
PER_ TICK - Nanoseconds per timer tick (derived from TIMER_HZ).
- TIMER_
HZ - Kernel timer frequency in Hz.
Functions§
- apic_
ticks_ per_ 10ms - Return the cached calibration value (ticks per 10ms).
- calibrate_
apic_ timer - Calibrate the APIC timer using PIT channel 2 as a reference.
- init_
pit - Initialize the Programmable Interval Timer (PIT)
- is_
apic_ timer_ active - Check if the APIC timer is active
- start_
apic_ timer - Start the APIC timer in periodic mode.
- start_
apic_ timer_ cached - Start the APIC timer using the cached calibration value.
- stop_
pit - Stop PIT channel 0 to prevent phantom interrupts.