]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/TimerDxe/Timer.c
Integrate patch from Andrew Fish to make it run on OS X.
[mirror_edk2.git] / UnixPkg / TimerDxe / Timer.c
index 53b5656f7cccaa7425a8f987c0f22679cd49b4ad..7f43a368e2e6bd8ff3f2466560f472998ec870db 100644 (file)
@@ -62,7 +62,7 @@ UINT64                  mTimerPeriodMs;
 \r
 \r
 VOID\r
-TimerCallback (UINT64 DeltaMs)
+TimerCallback (UINT64 DeltaMs)\r
 /*++\r
 \r
 Routine Description:\r
@@ -84,12 +84,12 @@ Returns:
 --*/\r
 {\r
   EFI_TPL           OriginalTPL;\r
-  EFI_TIMER_NOTIFY  CallbackFunction;
-
+  EFI_TIMER_NOTIFY  CallbackFunction;\r
+\r
 \r
   OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
-  if (OriginalTPL < TPL_HIGH_LEVEL) {
+  if (OriginalTPL < TPL_HIGH_LEVEL) {\r
     CallbackFunction = mTimerNotifyFunction;\r
 \r
     //\r
@@ -99,7 +99,7 @@ Returns:
     if (CallbackFunction != NULL) {\r
       CallbackFunction ((UINT64) (DeltaMs * 10000));\r
     }\r
-  }
+  }\r
 \r
   gBS->RestoreTPL (OriginalTPL);\r
 \r
@@ -164,13 +164,13 @@ Returns:
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
-  if (NotifyFunction == NULL) {
-    /* Disable timer.  */
-    gUnix->SetTimer (0, TimerCallback);
-  } else if (mTimerNotifyFunction == NULL) {
-    /* Enable Timer.  */
-    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);
-  }
+  if (NotifyFunction == NULL) {\r
+    /* Disable timer.  */\r
+    gUnix->SetTimer (0, TimerCallback);\r
+  } else if (mTimerNotifyFunction == NULL) {\r
+    /* Enable Timer.  */\r
+    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);\r
+  }\r
   mTimerNotifyFunction = NotifyFunction;\r
 \r
   return EFI_SUCCESS;\r
@@ -224,13 +224,13 @@ Returns:
   // If TimerPeriod is 0, then the timer thread should be canceled\r
   // If the TimerPeriod is valid, then create and/or adjust the period of the timer thread\r
   //\r
-  if (TimerPeriod == 0
-      || ((TimerPeriod > TIMER_MINIMUM_VALUE)
+  if (TimerPeriod == 0\r
+      || ((TimerPeriod > TIMER_MINIMUM_VALUE)\r
          && (TimerPeriod < TIMER_MAXIMUM_VALUE))) {\r
     mTimerPeriodMs = DivU64x32 (TimerPeriod + 5000, 10000);\r
-
-    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);
-  }
+\r
+    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -369,6 +369,6 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-
+\r
   return EFI_SUCCESS;\r
 }\r