summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-09-22 23:02:24 +0000
committerpeter <peter@FreeBSD.org>2003-09-22 23:02:24 +0000
commitc84d9c49c6280a7917ff6ac20db85d5aaf08a757 (patch)
tree451d2ed3647eb62e26bcc6c88e3eccd0aba54760
parent8e309595b17be145649211aa7c810f8c63d1df47 (diff)
downloadFreeBSD-src-c84d9c49c6280a7917ff6ac20db85d5aaf08a757.zip
FreeBSD-src-c84d9c49c6280a7917ff6ac20db85d5aaf08a757.tar.gz
MFi386 machdep.c rev 1.201, clock.c 1.201, clock.h 1.45 by phk: Dont
initialize a TSC timecounter until we know if it is broke or not. XXX I think there is a bug in the i386 code here. init_TSC_tc() comes after: if (statclock_disable) return; ie: if you turn off the statclock interrupt, you dont get the TSC either.
-rw-r--r--sys/amd64/amd64/tsc.c7
-rw-r--r--sys/amd64/include/clock.h1
-rw-r--r--sys/amd64/isa/clock.c2
3 files changed, 10 insertions, 0 deletions
diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c
index 80c3d1b..699042f 100644
--- a/sys/amd64/amd64/tsc.c
+++ b/sys/amd64/amd64/tsc.c
@@ -78,6 +78,13 @@ init_TSC(void)
if (bootverbose)
printf("TSC clock: %lu Hz\n", tsc_freq);
+ return;
+}
+
+void
+init_TSC_tc(void)
+{
+
if (tsc_freq != 0 && !tsc_is_broken) {
tsc_timecounter.tc_frequency = tsc_freq;
tc_init(&tsc_timecounter);
diff --git a/sys/amd64/include/clock.h b/sys/amd64/include/clock.h
index 511780f..24d5bc0 100644
--- a/sys/amd64/include/clock.h
+++ b/sys/amd64/include/clock.h
@@ -37,6 +37,7 @@ int release_timer2(void);
int rtcin(int val);
int sysbeep(int pitch, int period);
void init_TSC(void);
+void init_TSC_tc(void);
#endif /* _KERNEL */
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index c88e488..527b285 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -896,6 +896,8 @@ cpu_initclocks()
intr_restore(crit);
writertc(RTC_STATUSB, rtc_statusb);
+
+ init_TSC_tc();
}
void
OpenPOWER on IntegriCloud