⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module timer

Module timer 

Source
Expand description

Architecture-independent timer interface.

Provides the PlatformTimer trait for architecture-agnostic timer access and free functions that delegate to the current platform’s implementation.

§Architecture implementations

  • x86_64: X86_64Timer – PIT-based tick counter and RDTSC timestamp.
  • AArch64: [AArch64Timer] – Generic timer counter (CNTVCT_EL0 / CNTFRQ_EL0).
  • RISC-V: [RiscVTimer] – rdtime instruction via SBI timer.

Structs§

X86_64Timer

Traits§

PlatformTimer
Platform timer abstraction trait.

Functions§

get_ticks
Get current timer tick count (from the software tick counter maintained by each architecture’s interrupt handler).
get_timestamp_ms
Get the current timestamp in milliseconds since boot.
get_timestamp_secs
Get the current timestamp in seconds since boot.
hw_ticks_per_second
Return the hardware timer frequency in Hz.
read_hw_timestamp
Read the hardware timestamp counter directly.
set_hw_timer
Program the next timer interrupt.