]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Handle case when PAL calls 13 or 14 may not be available.
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Aug 2007 01:01:44 +0000 (01:01 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Aug 2007 01:01:44 +0000 (01:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3708 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c

index 8d3c3fd6f327766e091a0bc424da310a832eb4cb..9fe33ec134ebe346a6e9a2b3867ad058d24651a1 100644 (file)
@@ -152,13 +152,6 @@ GetPerformanceCounterProperties (
   PAL_CALL_RETURN                   PalRet;\r
   UINT64                            BaseFrequence;\r
 \r
-  PalRet = PalCallStatic (NULL, 13, 0, 0, 0);\r
-  ASSERT (PalRet.Status == 0);\r
-  BaseFrequence = PalRet.r9;\r
-\r
-  PalRet = PalCallStatic (NULL, 14, 0, 0, 0);\r
-  ASSERT (PalRet.Status == 0);\r
-\r
   if (StartValue != NULL) {\r
     *StartValue = 0;\r
   }\r
@@ -167,5 +160,16 @@ GetPerformanceCounterProperties (
     *EndValue = (UINT64)(-1);\r
   }\r
 \r
+  PalRet = PalCallStatic (NULL, 13, 0, 0, 0);\r
+  if (PalRet.Status != 0) {\r
+    return 1000000;\r
+  }\r
+  BaseFrequence = PalRet.r9;\r
+\r
+  PalRet = PalCallStatic (NULL, 14, 0, 0, 0);\r
+  if (PalRet.Status != 0) {\r
+    return 1000000;\r
+  }\r
+\r
   return BaseFrequence * (PalRet.r11 >> 32) / (UINT32)PalRet.r11;\r
 }\r