THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- Module Name: IpfTimerLib.c\r
-\r
**/\r
\r
#include <Base.h>\r
#include <Library/IoLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/PcdLib.h>\r
+#include <Library/PalCallLib.h>\r
\r
\r
/**\r
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
*EndValue = (UINT64)(-1);\r
}\r
\r
+ PalRet = PalCall (PAL_FREQ_BASE, 0, 0, 0);\r
+ if (PalRet.Status != 0) {\r
+ return 1000000;\r
+ }\r
+ BaseFrequence = PalRet.r9;\r
+\r
+ PalRet = PalCall (PAL_FREQ_RATIOS, 0, 0, 0);\r
+ if (PalRet.Status != 0) {\r
+ return 1000000;\r
+ }\r
+\r
return BaseFrequence * (PalRet.r11 >> 32) / (UINT32)PalRet.r11;\r
}\r