Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Remove the amd_powernow_probe() function ...



details:   https://anonhg.NetBSD.org/src/rev/805d80b406d6
branches:  trunk
changeset: 586795:805d80b406d6
user:      xtraeme <xtraeme%NetBSD.org@localhost>
date:      Mon Jan 02 20:55:42 2006 +0000

description:
Remove the amd_powernow_probe() function introduced in the powernow
patch. Now we check for powernow capable cpus only if it's AMD and
family 6 (in the amd_family6_setup() function).

Fixes the panic reported by Steven M. Bellovin (tested by him too).

diffstat:

 sys/arch/i386/i386/identcpu.c |  36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)

diffs (76 lines):

diff -r 6fdd63281263 -r 805d80b406d6 sys/arch/i386/i386/identcpu.c
--- a/sys/arch/i386/i386/identcpu.c     Mon Jan 02 20:51:09 2006 +0000
+++ b/sys/arch/i386/i386/identcpu.c     Mon Jan 02 20:55:42 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: identcpu.c,v 1.25 2005/12/31 17:55:55 xtraeme Exp $    */
+/*     $NetBSD: identcpu.c,v 1.26 2006/01/02 20:55:42 xtraeme Exp $    */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.25 2005/12/31 17:55:55 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.26 2006/01/02 20:55:42 xtraeme Exp $");
 
 #include "opt_cputype.h"
 #include "opt_enhanced_speedstep.h"
@@ -131,7 +131,6 @@
 };
 
 u_int cpu_serial[3];
-u_int amd_powernow_probe(struct cpu_info *);
 char cpu_brand_string[49];
 static char amd_brand_name[48];
 
@@ -882,6 +881,16 @@
                ci->ci_feature_flags |= descs[3];
        }
 
+#ifdef POWERNOW_K7
+       if (lfunc >= 0x80000007) {
+               CPUID(0x80000007, descs[0], descs[1], descs[2], descs[3]);
+               if ((descs[3] & 0x06)) {
+                       if ((ci->ci_signature & 0xF00) == 0x600)
+                               pnowk7_init(ci);
+               }
+       }
+#endif
+
        if (*cpu_brand_string == '\0')
                return;
        
@@ -915,20 +924,6 @@
        }
 }
 
-u_int
-amd_powernow_probe(struct cpu_info *ci)
-{
-       u_int32_t       eax, ebx, ecx, edx;
-
-       CPUID(0x80000007, eax, ebx, ecx, edx);
-
-       /* checking for Freq ID control (FID) and Voltage ID control (VID) */
-       if ((edx & (0x2 | 0x4)) > 0)
-               return 1;
-
-       return 0;
-}
-
 /*
  * Transmeta Crusoe LongRun Support by Tamotsu Hattori.
  * Port from FreeBSD-current(August, 2001) to NetBSD by tshiozak.
@@ -1445,11 +1440,4 @@
                            cpuname);
        }
 #endif /* ENHANCED_SPEEDSTEP */
-
-#ifdef POWERNOW_K7
-       if (amd_powernow_probe (ci)) {
-               pnowk7_init(ci);
-       }
-#endif /* POWERNOW_K7 */
-
 }



Home | Main Index | Thread Index | Old Index