Clock/timer interface

Here are the clock and timer interface callouts:

The kernel uses these callouts to deal with the hardware timer chip.

The timer_load() callout is responsible for stuffing the divisor value passed by the kernel into the timer/counter chip. Since the kernel doesn't know the characteristics of the timer chip, it's up to the timer_load() callout to take the passed value and validate it. The kernel will then use the new value in any internal calculations it performs. You can access the new value in the qtime_entry element of the system page as well as through the ClockPeriod() function call.

The timer_reload() callout is called after the timer chip generates an interrupt. It's used in two cases:

The timer_value() callout is used to return the value of the timer chip's internal count as a delta from the last interrupt. This is used on processors that don't have a high-precision counter built into the CPU (e.g. 80486).