0001
0002 #ifndef PERF_CPUID_H
0003 #define PERF_CPUID_H 1
0004
0005
0006 static inline void
0007 cpuid(unsigned int op, unsigned int op2, unsigned int *a, unsigned int *b,
0008 unsigned int *c, unsigned int *d)
0009 {
0010
0011
0012
0013
0014
0015
0016
0017 asm(
0018 #if defined(__x86_64__)
0019 "mov %%rbx, %%rdi\n"
0020 "cpuid\n"
0021 "xchg %%rdi, %%rbx\n"
0022 #else
0023 "pushl %%ebx\n"
0024 "cpuid\n"
0025 "movl %%ebx, %%edi\n"
0026 "popl %%ebx\n"
0027 #endif
0028 : "=a"(*a), "=D"(*b), "=c"(*c), "=d"(*d)
0029 : "a"(op), "2"(op2));
0030 }
0031
0032 void get_cpuid_0(char *vendor, unsigned int *lvl);
0033
0034 #endif