summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-10-05 02:13:42 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-10-05 02:13:42 +0000
commitf4ea74ae44424581678e368f2938118d73681379 (patch)
tree5efb1acb832837db2f9070e844f4f13122c87254
parent7c2a603c1b611cefb9dcce153f126b22c3560b2b (diff)
grab the perflevel during init so it's synced with reality.
other drivers to come. ok deraadt@
-rw-r--r--sys/arch/i386/i386/est.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index d17f03e03eb..0c0cdee9173 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.9 2004/07/16 18:14:23 deraadt Exp $ */
+/* $OpenBSD: est.c,v 1.10 2004/10/05 02:13:41 tedu Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -258,6 +258,7 @@ static const struct est_cpu est_cpus[] = {
static const struct fqlist *est_fqlist;
extern int setperf_prio;
+extern int perflevel;
void
est_init(const char *cpu_device)
@@ -268,6 +269,7 @@ est_init(const char *cpu_device)
char *tag;
const struct fqlist *fql;
extern char cpu_brandstr[];
+ int low, high;
if (setperf_prio > 3)
return;
@@ -316,6 +318,9 @@ est_init(const char *cpu_device)
printf(" (not in table)\n");
return;
}
+ low = est_fqlist->table[est_fqlist->n - 1].mhz;
+ high = est_fqlist->table[0].mhz;
+ perflevel = (mhz - low) * 100 / (high - low);
/*
* OK, tell the user the available frequencies.