aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-01-21 09:11:19 -0500
committerLen Brown <len.brown@intel.com>2011-02-10 23:58:11 -0500
commit8209e054b6bd0805a25b8c4af971160fa146bf22 (patch)
tree29706b992f75b98266a1f12ffcc760ec7b00ec06
parent6148a47ac3872092d4bc4888838bec6dff16654d (diff)
tools: turbostat: fix bitwise and operand
bug could cause false positive on indicating presence of invarient TSC or APERF support. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--tools/power/x86/turbostat/turbostat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 4c6983de6fd9..a96248f19264 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -892,7 +892,7 @@ void check_cpuid()
892 * this check is valid for both Intel and AMD 892 * this check is valid for both Intel and AMD
893 */ 893 */
894 asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007)); 894 asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007));
895 has_invariant_tsc = edx && (1 << 8); 895 has_invariant_tsc = edx & (1 << 8);
896 896
897 if (!has_invariant_tsc) { 897 if (!has_invariant_tsc) {
898 fprintf(stderr, "No invariant TSC\n"); 898 fprintf(stderr, "No invariant TSC\n");
@@ -905,7 +905,7 @@ void check_cpuid()
905 */ 905 */
906 906
907 asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6)); 907 asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6));
908 has_aperf = ecx && (1 << 0); 908 has_aperf = ecx & (1 << 0);
909 if (!has_aperf) { 909 if (!has_aperf) {
910 fprintf(stderr, "No APERF MSR\n"); 910 fprintf(stderr, "No APERF MSR\n");
911 exit(1); 911 exit(1);