summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2009-06-08 23:18:06 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2009-06-08 23:18:06 +0000
commita4155bc7189ee7e348c6ab2e5e011eb2cb7f430e (patch)
tree1ebf275a3510ae21bfa6543d3f7be3031ba99c60
parent617d4179805aab4a335d677afde86fb078456334 (diff)
If the machine only has one state enabling the EST driver is pointless,
this might need to be revisted later if its clear that there are machines which only come up with a single state but more may appear after a PPC change but for now we will just not initilize on systems with a single state a boot. Solves a divide by zero panic when using the PDC diff on broken hardware. ok marco@, krw@
-rw-r--r--sys/arch/amd64/amd64/est.c5
-rw-r--r--sys/arch/i386/i386/est.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/est.c b/sys/arch/amd64/amd64/est.c
index 082f89bd05c..6eed7d27070 100644
--- a/sys/arch/amd64/amd64/est.c
+++ b/sys/arch/amd64/amd64/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.12 2009/06/06 23:21:43 gwk Exp $ */
+/* $OpenBSD: est.c,v 1.13 2009/06/08 23:18:05 gwk Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -416,6 +416,9 @@ est_init(struct cpu_info *ci)
if (est_fqlist == NULL)
return;
+ if (est_fqlist->n < 2)
+ return;
+
printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
low = est_fqlist->table[est_fqlist->n - 1].mhz;
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index cadb224ecbf..335155404ce 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.31 2009/06/06 23:21:43 gwk Exp $ */
+/* $OpenBSD: est.c,v 1.32 2009/06/08 23:18:05 gwk Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -1167,6 +1167,9 @@ est_init(const char *cpu_device, int vendor)
if (est_fqlist == NULL)
return;
+ if (est_fqlist->n < 2)
+ return;
+
printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
low = est_fqlist->table[est_fqlist->n - 1].mhz;