+\r
+\r
+\r
+/**\r
+ Performs a delay measured as number of ticks.\r
+\r
+ An internal function to perform a delay measured as number of ticks. It's\r
+ invoked by MicroSecondDelay() and NanoSecondDelay().\r
+\r
+ @param Delay Number of ticks to delay.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+InternalIpfDelay (\r
+ IN INT64 Delay\r
+ )\r
+{\r
+ INT64 Ticks;\r
+\r
+ //\r
+ // The target timer count is calculated here\r
+ //\r
+ Ticks = IpfReadItc () + 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 - IpfReadItc () >= 0);\r
+}\r