Implement HlReadTimeStampCounter() routine
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2022-12-27 23:28:27 +01:00
parent f46615f92c
commit fcfa575bff
4 changed files with 47 additions and 0 deletions

View File

@@ -321,6 +321,26 @@ HlReadModelSpecificRegister(IN ULONG Register)
return ((ULONGLONG)High << 32) | Low;
}
/**
* Reads the current value of the CPU's time-stamp counter.
*
* @return This routine returns the current instruction cycle count since the processor was started.
*
* @since XT 1.0
*/
XTCDECL
ULONGLONG
HlReadTimeStampCounter()
{
ULONGLONG Low, High;
asm volatile("rdtsc"
:"=a"(Low),
"=d"(High));
return ((ULONGLONG)High << 32) | Low;
}
/**
* Instructs the processor to set the interrupt flag.
*