diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -364,6 +364,15 @@ 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 rdtsc32(void) { diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -403,6 +403,15 @@ return (rv); } +static __inline uint64_t +rdtscp_aux(uint32_t *aux) +{ + uint64_t rv; + + __asm __volatile("rdtscp" : "=A" (rv), "=c" (*aux)); + return (rv); +} + static __inline uint32_t rdtsc32(void) {