Current-Users archive

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

Re: kernel/cpuctl: AMD power features lost?



On Fri, 30 May 2008, Thomas Klausner wrote:

Something was lost here :)
Not sure if the page colors are interesting, but it'd be good to have
the power management features back.

The power management features are broken due to a problem with the
bitmask_snprintf() buffer. Apply the attached patch (I've submitted this as part of a much larger patch to cpuctl in PR bin/38722)

----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul%whooppee.com@localhost   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette%juniper.net@localhost |
----------------------------------------------------------------------
Index: src/sys/arch/x86/include/cacheinfo.h
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/include/cacheinfo.h,v
retrieving revision 1.6
diff -u -p -r1.6 cacheinfo.h
--- src/sys/arch/x86/include/cacheinfo.h        11 May 2008 21:19:17 -0000      
1.6
+++ src/sys/arch/x86/include/cacheinfo.h        22 May 2008 13:36:21 -0000
@@ -1927,13 +1753,18 @@ powernow_probe(struct cpu_info *ci)
 powernow_probe(struct cpu_info *ci)
 {
        uint32_t regs[4];
-       char line[80];
+       char *line;
 
        x86_cpuid(0x80000000, regs);
 
@@ -1936,8 +1773,11 @@ powernow_probe(struct cpu_info *ci)
                return;
        x86_cpuid(0x80000007, regs);
 
-       bitmask_snprintf(regs[3], "\20\6STC\5TM\4TTP\3VID\2FID\1TS", line,
-           sizeof(line));
+       line = malloc(MAXPATHLEN);
+       bitmask_snprintf(regs[3], "\20\11TscInv\10HwPState\7Clk100MHz"
+                                 "\6STC\5TM\4TTP\3VID\2FID\1TS", line,
+                        MAXPATHLEN);
        aprint_normal_dev(ci->ci_dev, "AMD Power Management features: %s\n",
            line);
+       free(line);
 }


Home | Main Index | Thread Index | Old Index