1
0
geforkt von xt-sys/exectos

Implement HlReadTimeStampCounter() routine

Dieser Commit ist enthalten in:
2022-12-27 23:28:27 +01:00
Ursprung f46615f92c
Commit fcfa575bff
4 geänderte Dateien mit 47 neuen und 0 gelöschten Zeilen

Datei anzeigen

@@ -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.
*

Datei anzeigen

@@ -313,6 +313,25 @@ HlReadModelSpecificRegister(IN ULONG Register)
return Value;
}
/**
* 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 Value;
asm volatile("rdtsc"
: "=A"(Value));
return Value;
}
/**
* Instructs the processor to set the interrupt flag.
*