cpufunc: add rdtscp for x86

This commit is contained in:
Matt Macy 2018-06-07 00:54:11 +00:00
parent 60f18ad0b4
commit 155046394a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334746
2 changed files with 18 additions and 0 deletions

View File

@ -386,6 +386,15 @@ rdtsc(void)
return (low | ((uint64_t)high << 32));
}
static __inline uint64_t
rdtscp(void)
{
uint32_t low, high;
__asm __volatile("rdtscp" : "=a" (low), "=d" (high));
return (low | ((uint64_t)high << 32));
}
static __inline uint32_t
rdtsc32(void)
{

View File

@ -368,6 +368,15 @@ rdtsc(void)
return (rv);
}
static __inline uint64_t
rdtscp(void)
{
uint64_t rv;
__asm __volatile("rdtscp" : "=A" (rv));
return (rv);
}
static __inline uint32_t
rdtsc32(void)
{