summaryrefslogtreecommitdiff
path: root/sys
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
parentc40422dc16d579f595b132adf02f91ebe4dc58cb (diff)
Teach powernow about setperf prioritys, add a setperf_prio to amd64.
ok uwe@, "good" tedu@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c5
-rw-r--r--sys/arch/amd64/amd64/powernow-k8.c7
-rw-r--r--sys/arch/i386/i386/powernow-k7.c7
-rw-r--r--sys/arch/i386/i386/powernow-k8.c7
4 files changed, 22 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index d75e33dffb6..211f3f07d18 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.48 2006/05/20 22:38:52 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.49 2006/05/27 04:46:12 gwk Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -146,6 +146,9 @@
/* the following is used externally (sysctl_hw) */
char machine[] = MACHINE;
+/* the following is used externally for concurrent handlers */
+int setperf_prio = 0;
+
#ifdef CPURESET_DELAY
int cpureset_delay = CPURESET_DELAY;
#else
diff --git a/sys/arch/amd64/amd64/powernow-k8.c b/sys/arch/amd64/amd64/powernow-k8.c
index 1b33af371f3..0399a3b145e 100644
--- a/sys/arch/amd64/amd64/powernow-k8.c
+++ b/sys/arch/amd64/amd64/powernow-k8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k8.c,v 1.5 2006/04/18 04:58:41 gwk Exp $ */
+/* $OpenBSD: powernow-k8.c,v 1.6 2006/05/27 04:46:12 gwk Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
* All rights reserved.
@@ -67,6 +67,7 @@
#define BIOS_LEN 0x20000
extern int cpuspeed;
+extern int setperf_prio;
/*
* MSRs and bits used by Powernow technology
@@ -375,6 +376,9 @@ k8_powernow_init(void)
char * techname = NULL;
ci = curcpu();
+ if (setperf_prio > 1)
+ return;
+
cstate = malloc(sizeof(struct k8pnow_cpu_state), M_DEVBUF, M_NOWAIT);
if (!cstate)
return;
@@ -404,6 +408,7 @@ k8_powernow_init(void)
printf(" Mhz\n");
k8pnow_current_state = cstate;
cpu_setperf = k8_powernow_setperf;
+ setperf_prio = 1;
return;
}
}
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;
}
}