2 * Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org.
3 * Distributed under the terms of the MIT License.
10 static uint64_t cv_factor
;
11 static uint64_t cv_factor_nsec
;
15 __x86_setup_system_time(uint64_t cv
, uint64_t cv_nsec
)
18 cv_factor_nsec
= cv_nsec
;
22 static inline uint64_t
26 __asm__("rdtsc" : "=a" (lo
), "=d" (hi
));
27 return lo
| (hi
<< 32);
31 extern "C" [[gnu::optimize("omit-frame-pointer")]] int64_t
34 __uint128_t time
= static_cast<__uint128_t
>(rdtsc()) * cv_factor
;
39 extern "C" [[gnu::optimize("omit-frame-pointer")]] int64_t
42 __uint128_t t
= static_cast<__uint128_t
>(rdtsc()) * cv_factor_nsec
;