ZXFoundation™ 26h2
Loading...
Searching...
No Matches
zxfoundation.sys.timer.types Module Reference

Data Structures

struct  zxfoundation::sys::timer::kernel_timer
 Kernel timer descriptor. More...
struct  zxfoundation::sys::timer::timer_heap
 Fixed-capacity binary min-heap of kernel_timer pointers. More...

Enumerations

enum class  timer_mode : u8 { oneshot = 0 , periodic = 1 }
 Timer operating mode.

Typedefs

using zxfoundation::sys::timer::timer_fn = auto (*)(void* data) noexcept -> void
 Timer callback signature.

Functions

 kernel_timer () noexcept=default
 Default constructor.
 kernel_timer (const kernel_timer &)=delete
 kernel_timer (kernel_timer &&)=delete
auto operator= (const kernel_timer &)=delete
auto operator= (kernel_timer &&)=delete
auto operator= (const timer_heap &)=delete
auto operator= (timer_heap &&)=delete
 timer_heap () noexcept=default
 Default constructor.
 timer_heap (const timer_heap &)=delete
 timer_heap (timer_heap &&)=delete

Variables

u8 _pad [5] {}
 Pad to nice 8-byte alignment.
bool armed {false}
 true if currently in a CPU's heap.
timer_fn callback {nullptr}
 Expiry callback.
u32 count {0}
 Number of active entries.
u16 cpu {0}
 CPU this timer is enqueued on.
void * data {nullptr}
 Callback context.
u64 deadline_tod {0}
 Absolute TOD deadline (hardware clock units).
kernel_timerentries [TIMER_HEAP_CAPACITY] {}
 Heap-ordered array of timer pointers.
constexpr u16 zxfoundation::sys::timer::EXT_CODE_CLK_COMP = 0x1004
 EXT interrupt code for the clock comparator.
constexpr u16 zxfoundation::sys::timer::EXT_CODE_CPU_TIMER = 0x1005
 EXT interrupt code for the CPU timer (PoP §6-12).
u64 interval_tod {0}
 Re-arm interval for periodic timers (TOD units).
timer_mode mode {timer_mode::oneshot}
 Oneshot or periodic.
constexpr u64 zxfoundation::sys::timer::TICK_INTERVAL_NS = 10'000'000ULL
 Tick interval: 10 ms expressed in nanoseconds.
constexpr u64 zxfoundation::sys::timer::TICK_INTERVAL_TOD = 40'960'000ULL
 Tick interval: 10 ms expressed in TOD clock units.
constexpr u32 zxfoundation::sys::timer::TIMER_HEAP_CAPACITY = 256
 Maximum number of timers in a single CPU's min-heap.

Files

file  zxfoundation/sys/timer.zcomponent/types.cxxm