Skip to main content

Module timer

Module timer 

Source
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.