x86: cpufunc: Add rdtscp_aux()
Add a variant of 'rdtscp()' that retains and returns the 'IA32_TSC_AUX' value read by 'rdtscp'. Sponsored By: Juniper Networks, Inc. Sponsored By: Klara, Inc. Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D31415
This commit is contained in:
parent
0d71cea832
commit
908e277230
@ -364,6 +364,15 @@ rdtscp(void)
|
||||
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)
|
||||
{
|
||||
|
@ -403,6 +403,15 @@ rdtscp(void)
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user