rk: revert to v3.10
[firefly-linux-kernel-4.4.55.git] / tools / power / x86 / turbostat / turbostat.c
index 6a7ee5f21c9bcea5a75ee868852202a04ba5d04a..fe702076ca46cc2d3d02bab818446c9d15f8c392 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #define _GNU_SOURCE
-#include MSRHEADER
+#include <asm/msr.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -35,7 +35,6 @@
 #include <string.h>
 #include <ctype.h>
 #include <sched.h>
-#include <cpuid.h>
 
 char *proc_stat = "/proc/stat";
 unsigned int interval_sec = 5; /* set with -i interval_sec */
@@ -1895,7 +1894,7 @@ void check_cpuid()
 
        eax = ebx = ecx = edx = 0;
 
-       __get_cpuid(0, &max_level, &ebx, &ecx, &edx);
+       asm("cpuid" : "=a" (max_level), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0));
 
        if (ebx == 0x756e6547 && edx == 0x49656e69 && ecx == 0x6c65746e)
                genuine_intel = 1;
@@ -1904,7 +1903,7 @@ void check_cpuid()
                fprintf(stderr, "CPUID(0): %.4s%.4s%.4s ",
                        (char *)&ebx, (char *)&edx, (char *)&ecx);
 
-       __get_cpuid(1, &fms, &ebx, &ecx, &edx);
+       asm("cpuid" : "=a" (fms), "=c" (ecx), "=d" (edx) : "a" (1) : "ebx");
        family = (fms >> 8) & 0xf;
        model = (fms >> 4) & 0xf;
        stepping = fms & 0xf;
@@ -1926,7 +1925,7 @@ void check_cpuid()
         * This check is valid for both Intel and AMD.
         */
        ebx = ecx = edx = 0;
-       __get_cpuid(0x80000000, &max_level, &ebx, &ecx, &edx);
+       asm("cpuid" : "=a" (max_level), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000000));
 
        if (max_level < 0x80000007) {
                fprintf(stderr, "CPUID: no invariant TSC (max_level 0x%x)\n", max_level);
@@ -1937,7 +1936,7 @@ void check_cpuid()
         * Non-Stop TSC is advertised by CPUID.EAX=0x80000007: EDX.bit8
         * this check is valid for both Intel and AMD
         */
-       __get_cpuid(0x80000007, &eax, &ebx, &ecx, &edx);
+       asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007));
        has_invariant_tsc = edx & (1 << 8);
 
        if (!has_invariant_tsc) {
@@ -1950,7 +1949,7 @@ void check_cpuid()
         * this check is valid for both Intel and AMD
         */
 
-       __get_cpuid(0x6, &eax, &ebx, &ecx, &edx);
+       asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6));
        has_aperf = ecx & (1 << 0);
        do_dts = eax & (1 << 0);
        do_ptm = eax & (1 << 6);