| 123 | #include <pthread.h> |
| 124 | |
| 125 | static void cpuid(unsigned leaf, unsigned subleaf, |
| 126 | unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) { |
| 127 | __asm__("movq\t%%rbx,%%rsi\n\t" |
| 128 | "cpuid\n\t" |
| 129 | "xchgq\t%%rbx,%%rsi" |
| 130 | : "=a"(*eax), "=S"(*ebx), "=c"(*ecx), "=d"(*edx) |
| 131 | : "0"(leaf), "2"(subleaf)); |
| 132 | } |
| 133 | |
| 134 | static int pin_cpu(int cpu) { |
| 135 | cpu_set_t mask; |
no outgoing calls
no test coverage detected