Skip to main content

Module timer

Module timer 

Source
Expand description

x86_64 system-timer glue backed by the local-APIC timer.

someboot owns only the TSC counter (frequency, current tick, stability); everything that arms the system timer lives inside the local APIC, so this module brings the local APIC up per CPU, calibrates the APIC-timer fallback ratio, and arms one-shot deadlines. It replaces the someboot::timer arming contract for x86_64 the same way the GIC lives in somehal on aarch64: the interrupt-controller driver is consumed here, not by the boot layer.

Enums§

CounterStability
Hardware counter contract exposed to the platform scheduler clock.

Functions§

cancel_oneshot
Masks the source before clearing its comparator.
duration_to_ticks
Convert Duration to ticks.
elapsed
Get the elapsed time since boot.
enable
Brings up the local APIC and leaves its timer masked and non-firing.
freq
Get the timer frequency in Hz.
irq_disable
Masks the timer interrupt.
irq_enable
Unmasks the timer interrupt.
irq_is_enabled
Returns whether the timer interrupt is currently unmasked.
requires_irq_quiesce
LAPIC one-shot expiry consumes an edge without leaving a level asserted.
resume_oneshot_at_ticks
Makes the source observable before installing a fresh comparator.
scheduler_clock_stability
Reports whether scheduler users may sample the raw counter on any CPU.
set_next_event_at_ticks
Arms a one-shot at an absolute TSC-domain deadline.
since_boot
ticks
Get the current timer tick count.
ticks_to_duration
Convert ticks to Duration.