Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/cpufunc.h
Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | |||||
rdtscp(void) | rdtscp(void) | ||||
{ | { | ||||
uint32_t low, high; | uint32_t low, high; | ||||
__asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx"); | __asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx"); | ||||
return (low | ((uint64_t)high << 32)); | return (low | ((uint64_t)high << 32)); | ||||
} | } | ||||
static __inline uint64_t | |||||
rdtscp_aux(uint32_t *aux) | |||||
{ | |||||
uint32_t low, high; | |||||
__asm __volatile("rdtscp" : "=a" (low), "=d" (high), "=c" (*aux)); | |||||
return (low | ((uint64_t)high << 32)); | |||||
} | |||||
static __inline uint32_t | static __inline uint32_t | ||||
rdtsc32(void) | rdtsc32(void) | ||||
{ | { | ||||
uint32_t rv; | uint32_t rv; | ||||
__asm __volatile("rdtsc" : "=a" (rv) : : "edx"); | __asm __volatile("rdtsc" : "=a" (rv) : : "edx"); | ||||
return (rv); | return (rv); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 644 Lines • Show Last 20 Lines |