mirror of https://github.com/acidanthera/audk.git
Handle case when PAL calls 13 or 14 may not be available.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3708 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
055a4a3d79
commit
580ad4a03d
|
@ -152,13 +152,6 @@ GetPerformanceCounterProperties (
|
|||
PAL_CALL_RETURN PalRet;
|
||||
UINT64 BaseFrequence;
|
||||
|
||||
PalRet = PalCallStatic (NULL, 13, 0, 0, 0);
|
||||
ASSERT (PalRet.Status == 0);
|
||||
BaseFrequence = PalRet.r9;
|
||||
|
||||
PalRet = PalCallStatic (NULL, 14, 0, 0, 0);
|
||||
ASSERT (PalRet.Status == 0);
|
||||
|
||||
if (StartValue != NULL) {
|
||||
*StartValue = 0;
|
||||
}
|
||||
|
@ -167,5 +160,16 @@ GetPerformanceCounterProperties (
|
|||
*EndValue = (UINT64)(-1);
|
||||
}
|
||||
|
||||
PalRet = PalCallStatic (NULL, 13, 0, 0, 0);
|
||||
if (PalRet.Status != 0) {
|
||||
return 1000000;
|
||||
}
|
||||
BaseFrequence = PalRet.r9;
|
||||
|
||||
PalRet = PalCallStatic (NULL, 14, 0, 0, 0);
|
||||
if (PalRet.Status != 0) {
|
||||
return 1000000;
|
||||
}
|
||||
|
||||
return BaseFrequence * (PalRet.r11 >> 32) / (UINT32)PalRet.r11;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue