diff options
author | kato <kato@FreeBSD.org> | 1999-06-24 08:32:52 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1999-06-24 08:32:52 +0000 |
commit | 2dc95534a1633adba8c3af9f18fcd4877cb67e83 (patch) | |
tree | 2da9d45173ca046026d04ec8a41b4ae3993613d8 /sys/pc98/cbus/clock.c | |
parent | 093c06a9f5d45f379ae742eb9f967b3a8afe7e0c (diff) | |
download | FreeBSD-src-2dc95534a1633adba8c3af9f18fcd4877cb67e83.zip FreeBSD-src-2dc95534a1633adba8c3af9f18fcd4877cb67e83.tar.gz |
Sync with sys/i386/isa/clock.c revision 1.137.
Diffstat (limited to 'sys/pc98/cbus/clock.c')
-rw-r--r-- | sys/pc98/cbus/clock.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 7422b91..4dcd6a6 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.69 1999/05/10 09:05:01 kato Exp $ + * $Id: clock.c,v 1.70 1999/06/01 12:32:54 kato Exp $ */ /* @@ -775,6 +775,7 @@ fail: static u_int calibrate_clocks(void) { + u_int64_t old_tsc; u_int count, prev_count, tot_count; int sec, start_sec, timeout; @@ -813,7 +814,7 @@ calibrate_clocks(void) tot_count = 0; if (tsc_present) - wrmsr(0x10, 0LL); /* XXX 0x10 is the MSR for the TSC */ + old_tsc = rdtsc(); /* * Wait for the mc146818A seconds counter to change. Read the i8254 @@ -848,7 +849,7 @@ calibrate_clocks(void) * similar to those for the i8254 clock. */ if (tsc_present) - tsc_freq = rdtsc(); + tsc_freq = rdtsc() - old_tsc; if (bootverbose) { if (tsc_present) @@ -963,9 +964,10 @@ startrtclock() * clock failed. Do a less accurate calibration relative * to the i8254 clock. */ - wrmsr(0x10, 0LL); /* XXX */ + u_int64_t old_tsc = rdtsc(); + DELAY(1000000); - tsc_freq = rdtsc(); + tsc_freq = rdtsc() - old_tsc; #ifdef CLK_USE_TSC_CALIBRATION if (bootverbose) printf("TSC clock: %u Hz (Method B)\n", tsc_freq); |