18 uint64_t tsc_clock, tsc_start, tsc_now, tsc_wait_ticks;
27 pstate_idx = msr.
lo & 0x07;
34 did = (msr.
lo >> 6) & 0x7;
37 tsc_clock = tsc_base * (fid + 0x10) / (1 <<
did);
40 tsc_wait_ticks = (tsc_clock / 1000000) * us;
44 }
while (tsc_now - tsc_wait_ticks < tsc_start);
static __always_inline msr_t rdmsr(unsigned int index)
unsigned long long uint64_t
static unsigned long long rdtscll(void)