kvmclock: initial implementation

This commit is contained in:
Matheus
2024-09-29 11:21:46 -03:00
parent 11f76ab01d
commit fdd203d1a7
3 changed files with 118 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
#ifndef _TSC_H
#define _TSC_H
static inline uint64_t rdtsc_serialized(void) {
uint32_t high;
uint32_t low;
asm volatile("cpuid; rdtsc;" : "=a"(low), "=d"(high) : : "rbx", "rcx");
return ((uint64_t)high << 32) | low;
}
#endif