From 80e370ef722904da576d79bc016251c561ffe09d Mon Sep 17 00:00:00 2001 From: Gordon Willem Klok Date: Sat, 27 May 2006 04:46:13 +0000 Subject: Teach powernow about setperf prioritys, add a setperf_prio to amd64. ok uwe@, "good" tedu@ --- sys/arch/i386/i386/powernow-k7.c | 7 ++++++- sys/arch/i386/i386/powernow-k8.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'sys/arch/i386') 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; } } -- cgit v1.2.3