18 #ifndef FOEDUS_DEBUGGING_RDTSC_HPP_
19 #define FOEDUS_DEBUGGING_RDTSC_HPP_
39 asm volatile(
"rdtsc" :
"=a" (low),
"=d" (high));
40 return (static_cast<uint64_t>(high) << 32) | low;
45 asm volatile(
"isb; mrs %0, cntvct_el0" :
"=r" (ret));
61 uint64_t cycle_error =
get_rdtsc() - cycles;
62 uint64_t cycle_until =
get_rdtsc() + cycles;
65 if (current >= cycle_until || current <= cycle_error) {
73 #endif // FOEDUS_DEBUGGING_RDTSC_HPP_
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
void wait_rdtsc_cycles(uint64_t cycles)
Wait until the given CPU cycles elapse.
uint64_t get_rdtsc()
Returns the current CPU cycle via x86 RDTSC.