]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Added calibration the i8254 and the i586 clocks agains the RTC at boot
authorbde <bde@FreeBSD.org>
Wed, 1 May 1996 08:39:02 +0000 (08:39 +0000)
committerbde <bde@FreeBSD.org>
Wed, 1 May 1996 08:39:02 +0000 (08:39 +0000)
commitca8106a4ee34cb61e26e28ea80d9f6589caa51a6
tree95750958823ac0fa9fa014498439a90f6aa982ee
parent00b2015fb5a605103d9ba4381b6f2884ee87d5f3
Added calibration the i8254 and the i586 clocks agains the RTC at boot
time.  The results are currently ignored unless certain temporary options
are used.

Added sysctls to support reading and writing the clock frequency variables
(not the frequencies themselves).  Writing is supposed to atomically
adjust all related variables.

machdep.c:
Fixed spelling of a function name in a comment so that I can log this
message which should have been with the previous commit.

Initialize `cpu_class' earlier so that it can be used in startrtclock()
instead of in calibrate_cyclecounter() (which no longer exists).

Removed range checking of `cpu'.  It is always initialized to CPU_XXX
so it is less likely to be out of bounds than most variables.

clock.h:
Removed I586_CYCLECTR().  Use rdtsc() instead.

clock.c:
TIMER_FREQ is now a variable timer_freq that defaults to the old value of
TIMER_FREQ.  #define'ing TIMER_FREQ should still work and may be the best
way of setting the frequency.

Calibration involves counting cycles while watching the RTC for one second.
This gives values correct to within (a few ppm) + (the innaccuracy of the
RTC) on my systems.
sys/amd64/amd64/machdep.c
sys/amd64/amd64/tsc.c
sys/amd64/include/clock.h
sys/amd64/isa/clock.c
sys/i386/i386/machdep.c
sys/i386/i386/tsc.c
sys/i386/include/clock.h
sys/i386/isa/clock.c
sys/isa/atrtc.c