diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index 4a734b62dcc2..3170c0e82c82 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.14 2007/03/16 18:52:03 xtraeme Exp $ */ +/* $NetBSD: identcpu.c,v 1.15 2007/03/18 04:41:03 xtraeme Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.14 2007/03/16 18:52:03 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.15 2007/03/18 04:41:03 xtraeme Exp $"); #include "opt_powernow_k8.h" @@ -131,7 +131,7 @@ identifycpu(struct cpu_info *ci) if (CPUID2FAMILY(ci->ci_signature) == 15 && (cpu_model[0] == 'A' || cpu_model[0] == 'O') && powernow_probe(ci)) - k8_powernow_init(); + k8_powernow_init(ci); #endif x86_errata(ci, vendor); diff --git a/sys/arch/i386/i386/identcpu.c b/sys/arch/i386/i386/identcpu.c index 3a0044416bb3..8b0b02fd0fb3 100644 --- a/sys/arch/i386/i386/identcpu.c +++ b/sys/arch/i386/i386/identcpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.60 2007/03/15 00:28:58 xtraeme Exp $ */ +/* $NetBSD: identcpu.c,v 1.61 2007/03/18 04:41:03 xtraeme Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.60 2007/03/15 00:28:58 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.61 2007/03/18 04:41:03 xtraeme Exp $"); #include "opt_cputype.h" #include "opt_enhanced_speedstep.h" @@ -1786,7 +1786,7 @@ identifycpu(struct cpu_info *ci) #endif #ifdef POWERNOW_K8 case 15: - k8_powernow_init(); + k8_powernow_init(ci); break; #endif default: diff --git a/sys/arch/x86/include/powernow.h b/sys/arch/x86/include/powernow.h index f04e5397caf6..a49c3d7eee48 100644 --- a/sys/arch/x86/include/powernow.h +++ b/sys/arch/x86/include/powernow.h @@ -1,4 +1,4 @@ -/* $NetBSD: powernow.h,v 1.6 2006/10/04 13:18:10 cube Exp $ */ +/* $NetBSD: powernow.h,v 1.7 2007/03/18 04:41:03 xtraeme Exp $ */ /*- * Copyright (c) 2004 Martin Végiard. @@ -175,14 +175,14 @@ struct powernow_pst_s { uint8_t n_states; }; -int powernow_probe(struct cpu_info *); +int powernow_probe(struct cpu_info *); /* i386/i386/powernow_k7.c */ void k7_powernow_init(void); void k7_powernow_destroy(void); /* x86/x86/powernow_k8.c */ -void k8_powernow_init(void); +void k8_powernow_init(struct cpu_info *); void k8_powernow_destroy(void); #endif diff --git a/sys/arch/x86/x86/powernow_k8.c b/sys/arch/x86/x86/powernow_k8.c index a3422a347c5f..0601abd190d8 100644 --- a/sys/arch/x86/x86/powernow_k8.c +++ b/sys/arch/x86/x86/powernow_k8.c @@ -1,4 +1,4 @@ -/* $NetBSD: powernow_k8.c,v 1.7 2006/09/03 04:55:30 christos Exp $ */ +/* $NetBSD: powernow_k8.c,v 1.8 2007/03/18 04:41:03 xtraeme Exp $ */ /* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */ /*- @@ -66,7 +66,7 @@ /* AMD POWERNOW K8 driver */ #include -__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.7 2006/09/03 04:55:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.8 2007/03/18 04:41:03 xtraeme Exp $"); #include #include @@ -327,19 +327,16 @@ k8pnow_states(struct powernow_cpu_state *cstate, uint32_t cpusig, } void -k8_powernow_init(void) +k8_powernow_init(struct cpu_info *ci) { uint64_t status; uint32_t maxfid, maxvid, i; const struct sysctlnode *freqnode, *node, *pnownode; struct powernow_cpu_state *cstate; - struct cpu_info *ci; char *cpuname; const char *techname; size_t len; - ci = curcpu(); - freq_names_len = 0; cpuname = ci->ci_dev->dv_xname; diff --git a/sys/lkm/arch/i386/powernow/lkminit_powernow.c b/sys/lkm/arch/i386/powernow/lkminit_powernow.c index a8ca242d37de..8f63ed8aaa10 100644 --- a/sys/lkm/arch/i386/powernow/lkminit_powernow.c +++ b/sys/lkm/arch/i386/powernow/lkminit_powernow.c @@ -1,4 +1,4 @@ -/* $NetBSD: lkminit_powernow.c,v 1.8 2006/10/04 21:47:56 cube Exp $ */ +/* $NetBSD: lkminit_powernow.c,v 1.9 2007/03/18 04:41:03 xtraeme Exp $ */ /* * Derived from: @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lkminit_powernow.c,v 1.8 2006/10/04 21:47:56 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lkminit_powernow.c,v 1.9 2007/03/18 04:41:03 xtraeme Exp $"); #include #include @@ -66,7 +66,6 @@ static uint32_t pn_family = 0; static int powernow_mod_handle(struct lkm_table *lkmtp, int cmd) { - struct cpu_info *ci; int err = 0; /* default = success */ switch (cmd) { @@ -77,14 +76,12 @@ powernow_mod_handle(struct lkm_table *lkmtp, int cmd) if (lkmexists(lkmtp)) return EEXIST; - ci = curcpu(); - if (powernow_probe(ci)) { pn_family = CPUID2FAMILY(ci->ci_signature); if (pn_family == 6) k7_powernow_init(); else if (pn_family == 15) - k8_powernow_init(); + k8_powernow_init(curcpu()); else err = ENODEV; } else