aboutsummaryrefslogtreecommitdiff
path: root/sys/isa/atrtc.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>1999-06-24 03:48:25 +0000
committerBrian Feldman <green@FreeBSD.org>1999-06-24 03:48:25 +0000
commit9840e7cb5ae7b41b788449d406f97f49698d2e54 (patch)
tree32afef16bc2b016964ab05da8b8f5b3cb06f0c03 /sys/isa/atrtc.c
parent7ab6ba975dd979fbd79b77c5d0ee8a33b9129fb1 (diff)
downloadsrc-9840e7cb5ae7b41b788449d406f97f49698d2e54.tar.gz
src-9840e7cb5ae7b41b788449d406f97f49698d2e54.zip
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
Notes
Notes: svn path=/head/; revision=48160
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r--sys/isa/atrtc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index 6b787b80b80b..9fb163fa8643 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);