summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2006-05-27 04:46:13 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2006-05-27 04:46:13 +0000
commit80e370ef722904da576d79bc016251c561ffe09d (patch)
treec5bc6c77e0e52e453e40dffd0324189ebc5a7e0b /sys/arch/i386
parentc40422dc16d579f595b132adf02f91ebe4dc58cb (diff)
Teach powernow about setperf prioritys, add a setperf_prio to amd64.
ok uwe@, "good" tedu@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/powernow-k7.c7
-rw-r--r--sys/arch/i386/i386/powernow-k8.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c
index 242efaf445d..896b018191e 100644
--- a/sys/arch/i386/i386/powernow-k7.c
+++ b/sys/arch/i386/i386/powernow-k7.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k7.c,v 1.21 2006/05/11 13:21:11 mickey Exp $ */
+/* $OpenBSD: powernow-k7.c,v 1.22 2006/05/27 04:46:12 gwk Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
@@ -151,6 +151,7 @@ struct pst_s {
};
struct k7pnow_cpu_state *k7pnow_current_state;
+extern int setperf_prio;
/*
* Prototypes
@@ -326,6 +327,9 @@ k7_powernow_init(void)
char *techname = NULL;
int i;
+ if (setperf_prio > 1)
+ return;
+
ci = curcpu();
cpuid(0x80000000, regs);
@@ -366,6 +370,7 @@ k7_powernow_init(void)
k7pnow_current_state = cstate;
cpu_setperf = k7_powernow_setperf;
+ setperf_prio = 1;
return;
}
}
diff --git a/sys/arch/i386/i386/powernow-k8.c b/sys/arch/i386/i386/powernow-k8.c
index 6a944f82ae4..47454927d7a 100644
--- a/sys/arch/i386/i386/powernow-k8.c
+++ b/sys/arch/i386/i386/powernow-k8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k8.c,v 1.10 2006/05/11 13:21:12 mickey Exp $ */
+/* $OpenBSD: powernow-k8.c,v 1.11 2006/05/27 04:46:12 gwk Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
@@ -154,6 +154,7 @@ struct pst_s {
};
struct k8pnow_cpu_state *k8pnow_current_state = NULL;
+extern int setperf_prio;
/*
* Prototypes
@@ -381,6 +382,9 @@ k8_powernow_init(void)
ci = curcpu();
+ if (setperf_prio > 1)
+ return;
+
if (k8pnow_current_state)
return;
@@ -421,6 +425,7 @@ k8_powernow_init(void)
printf(" Mhz\n");
k8pnow_current_state = cstate;
cpu_setperf = k8_powernow_setperf;
+ setperf_prio = 1;
return;
}
}