CVSROOT:        /cvs
Module name:    src
Changes by:     chel...@cvs.openbsd.org 2020/09/03 15:38:46

Modified files:
        sys/arch/amd64/amd64: lapic.c 

Log message:
amd64: lapic: refactor timer programming

We reprogram the lapic timer by hand in three separate places.
This is error-prone and difficult to read.

To clean things up, introduce routines for reprogramming the lapic
timer in a given mode.  lapic_timer_oneshot() starts a oneshot
countdown.  lapic_timer_periodic() starts a repeating countdown.

Both of these routines call lapic_timer_start(), wherein we actually
write the lapic registers.

With input from dlg@.

Earlier version eyeballed by mlarkin@.

Suspend/resume tested by gnezdo@.

Reply via email to