cpufunc: add rdtscp for x86
This commit is contained in:
parent
60f18ad0b4
commit
155046394a
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user