diff options
author | green <green@FreeBSD.org> | 1999-06-24 03:48:25 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 1999-06-24 03:48:25 +0000 |
commit | a680ffebc32e02a7e7e5325a75c57734ed7d5c69 (patch) | |
tree | c3f8b828e0a7fb927f7be47b9fb98dd325ac0ad0 /sys/isa/atrtc.c | |
parent | 3a4d99ff1175a4f4432208a45899e8066db6e98a (diff) | |
download | FreeBSD-src-a680ffebc32e02a7e7e5325a75c57734ed7d5c69.zip FreeBSD-src-a680ffebc32e02a7e7e5325a75c57734ed7d5c69.tar.gz |
This commit gives support for the Rise mP6 CPU. It has two changes:
1. Rise is recognized in identdcpu.c.
2. The TSC is not written to. A workaround for the CPU bug is being
applied to clock.c (the bug being that the mP6 has TSC enabled
in its CPUID-capabilities, but it only supports reading it. If we
try to write to it (MSR 16), a GPF occurs.) The new behavior is that
FreeBSD will _not_ zero the TSC. Instead, we do a bit of 64-bit
arithmetic.
Reviewed by: msmith
Obtained from: unfurl & msmith
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r-- | sys/isa/atrtc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 6b787b8..9fb163f 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $ + * $Id: clock.c,v 1.136 1999/05/31 18:35:59 dfr Exp $ */ /* @@ -585,6 +585,7 @@ readrtc(int port) static u_int calibrate_clocks(void) { + u_int64_t old_tsc; u_int count, prev_count, tot_count; int sec, start_sec, timeout; @@ -623,7 +624,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 @@ -658,7 +659,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) @@ -762,9 +763,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); |