]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / SecPeiDxeTimerLibCpu / IpfTimerLib.c
index 9c4a07b696e397753403920c89a5d3ff8125a2bd..42c8511dde18f07c89e47acf20bbf9c1e03bb517 100644 (file)
 \r
 **/\r
 \r
-\r
+#include <Base.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
 \r
 \r
 /**\r
@@ -32,19 +37,19 @@ InternalIpfDelay (
   IN      INT64                     Delay\r
   )\r
 {\r
-  UINT64                             Ticks;\r
+  INT64                             Ticks;\r
 \r
   //\r
   // The target timer count is calculated here\r
   //\r
-  Ticks = AsmReadItc () + Delay;\r
+  Ticks = (INT64)AsmReadItc () + Delay;\r
 \r
   //\r
   // Wait until time out\r
   // Delay > 2^63 could not be handled by this function\r
   // Timer wrap-arounds are handled correctly by this function\r
   //\r
-  while (Ticks >= AsmReadItc());\r
+  while (Ticks - (INT64)AsmReadItc() >= 0);\r
 }\r
 \r
 /**\r