summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c b/MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c
index 8d3c3fd..9fe33ec 100644
--- a/MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c
+++ b/MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c
@@ -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;
}