How it fits into hb68k: a timer driver provides only mechanism. The clock code in hb68k/clock.c owns the policy and calls the driver through four functions in a small table (struct clock_if):
-
Function When it’s called What it does
-
clk_init once, late in boot establishes the interrupt at IPL_SCHED
-
clk_arm(interval_us) once, right after init starts periodic interrupts, e.g. every 10 000 µs for 100 Hz
-
clk_intr at the start of every tick acknowledges the interrupt, and reloads if needed