summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/clock.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-07-28 20:22:30 +0000
committermsmith <msmith@FreeBSD.org>1999-07-28 20:22:30 +0000
commit0c579844562c4dba1b1623050a5731fcad5cc4b1 (patch)
tree4b288bc151a1cfab21878f4f6479081718102224 /sys/i386/isa/clock.c
parentfa00e8d616ec94313d874fc986c5a23b405f9325 (diff)
downloadFreeBSD-src-0c579844562c4dba1b1623050a5731fcad5cc4b1.zip
FreeBSD-src-0c579844562c4dba1b1623050a5731fcad5cc4b1.tar.gz
We're called too early to have any idea whether APM is going to be
active or not. The only sane thing we can do here is assume that if APM is supported it might be active at some point, and bail. In reality, even this isn't good enough; regardless of whether we support APM or not, the system may well futz with the CPU's clock speed and throw the TSC off. We need to stop using it for timekeeping except under controlled circumstances. Curse the lack of a dependable high-resolution timer.
Diffstat (limited to 'sys/i386/isa/clock.c')
-rw-r--r--sys/i386/isa/clock.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index ec6ca51..020e983 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.139 1999/07/18 15:19:29 bde Exp $
+ * $Id: clock.c,v 1.140 1999/07/18 18:32:42 bde Exp $
*/
/*
@@ -70,10 +70,7 @@
#include <machine/limits.h>
#include <machine/md_var.h>
#include <machine/psl.h>
-#if NAPM > 0
-#include <machine/apm_bios.h>
-#include <i386/apm/apm_setup.h>
-#endif
+XXX
#ifdef APIC_IO
#include <machine/segments.h>
#endif
@@ -772,17 +769,16 @@ startrtclock()
#if NAPM > 0
/*
- * We can not use the TSC if we found an APM bios. Too many
- * of them lie about their ability&intention to fiddle the CPU
- * clock for us to rely on this. Precise timekeeping on an
- * APM'ed machine is at best a fools pursuit anyway, since
+ * We can not use the TSC if we support APM. Precise timekeeping
+ * on an APM'ed machine is at best a fools pursuit, since
* any and all of the time spent in various SMM code can't
* be reliably accounted for. Reading the RTC is your only
* source of reliable time info. The i8254 looses too of course
* but we need to have some kind of time...
+ * We don't know at this point whether APM is going to be used
+ * or not, nor when it might be activated. Play it safe.
*/
- if (apm_version != APMINI_CANTFIND)
- return;
+ return;
#endif /* NAPM > 0 */
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) {
OpenPOWER on IntegriCloud