* This function is used to seralize machine instructions so that no * instructions that appear after it in the current thread can run before any * instructions that appear before it. * * It is useful for putting around rdpmc instructions (to pinpoint cache * misses) as well as before rdtsc instructions, to prevent time pollution from * instructions supposed to be executing before the timer s
| 135 | * instructions supposed to be executing before the timer starts. |
| 136 | */ |
| 137 | static FORCE_INLINE |
| 138 | void serialize() { |
| 139 | uint32_t eax, ebx, ecx, edx; |
| 140 | __asm volatile("cpuid" |
| 141 | : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) |
| 142 | : "a" (1U)); |
| 143 | } |
| 144 | |
| 145 | |
| 146 | /** |