]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/TimerDxe/Timer.c
EmulatorPkg: Apply uncrustify changes
[mirror_edk2.git] / EmulatorPkg / TimerDxe / Timer.c
index 8e2baaaa5b91299f108286e70962968523474ea8..4ec5c3ee2847b5fd3f3886207834eccbbab44eb4 100644 (file)
@@ -27,12 +27,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //\r
 // Pointer to the CPU Architectural Protocol instance\r
 //\r
-EFI_CPU_ARCH_PROTOCOL   *mCpu;\r
+EFI_CPU_ARCH_PROTOCOL  *mCpu;\r
 \r
 //\r
 // The Timer Architectural Protocol that this driver produces\r
 //\r
-EFI_TIMER_ARCH_PROTOCOL mTimer = {\r
+EFI_TIMER_ARCH_PROTOCOL  mTimer = {\r
   EmuTimerDriverRegisterHandler,\r
   EmuTimerDriverSetTimerPeriod,\r
   EmuTimerDriverGetTimerPeriod,\r
@@ -42,22 +42,22 @@ EFI_TIMER_ARCH_PROTOCOL mTimer = {
 //\r
 // The notification function to call on every timer interrupt\r
 //\r
-EFI_TIMER_NOTIFY        mTimerNotifyFunction = NULL;\r
+EFI_TIMER_NOTIFY  mTimerNotifyFunction = NULL;\r
 \r
 //\r
 // The current period of the timer interrupt\r
 //\r
-UINT64                  mTimerPeriodMs;\r
-\r
+UINT64  mTimerPeriodMs;\r
 \r
 VOID\r
 EFIAPI\r
-TimerCallback (UINT64 DeltaMs)\r
+TimerCallback (\r
+  UINT64  DeltaMs\r
+  )\r
 {\r
   EFI_TPL           OriginalTPL;\r
   EFI_TIMER_NOTIFY  CallbackFunction;\r
 \r
-\r
   OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
   if (OriginalTPL < TPL_HIGH_LEVEL) {\r
@@ -73,15 +73,15 @@ TimerCallback (UINT64 DeltaMs)
   }\r
 \r
   gBS->RestoreTPL (OriginalTPL);\r
-\r
 }\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 EmuTimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL           *This,\r
-  IN EFI_TIMER_NOTIFY                  NotifyFunction\r
+  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
+  IN EFI_TIMER_NOTIFY         NotifyFunction\r
   )\r
+\r
 /*++\r
 \r
 Routine Description:\r
@@ -127,11 +127,11 @@ Returns:
   //\r
   // Check for invalid parameters\r
   //\r
-  if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {\r
+  if ((NotifyFunction == NULL) && (mTimerNotifyFunction == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {\r
+  if ((NotifyFunction != NULL) && (mTimerNotifyFunction != NULL)) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
@@ -142,6 +142,7 @@ Returns:
     /* Enable Timer.  */\r
     gEmuThunk->SetTimer (mTimerPeriodMs, TimerCallback);\r
   }\r
+\r
   mTimerNotifyFunction = NotifyFunction;\r
 \r
   return EFI_SUCCESS;\r
@@ -153,6 +154,7 @@ EmuTimerDriverSetTimerPeriod (
   IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
   IN UINT64                   TimerPeriod\r
   )\r
+\r
 /*++\r
 \r
 Routine Description:\r
@@ -190,14 +192,14 @@ Returns:
 \r
 **/\r
 {\r
-\r
   //\r
   // 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\r
-      || ((TimerPeriod > TIMER_MINIMUM_VALUE)\r
-    && (TimerPeriod < TIMER_MAXIMUM_VALUE))) {\r
+  if (  (TimerPeriod == 0)\r
+     || (  (TimerPeriod > TIMER_MINIMUM_VALUE)\r
+        && (TimerPeriod < TIMER_MAXIMUM_VALUE)))\r
+  {\r
     mTimerPeriodMs = DivU64x32 (TimerPeriod + 5000, 10000);\r
 \r
     gEmuThunk->SetTimer (mTimerPeriodMs, TimerCallback);\r
@@ -209,9 +211,10 @@ Returns:
 EFI_STATUS\r
 EFIAPI\r
 EmuTimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL            *This,\r
-  OUT UINT64                            *TimerPeriod\r
+  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
+  OUT UINT64                  *TimerPeriod\r
   )\r
+\r
 /*++\r
 \r
 Routine Description:\r
@@ -250,6 +253,7 @@ EFIAPI
 EmuTimerDriverGenerateSoftInterrupt (\r
   IN EFI_TIMER_ARCH_PROTOCOL  *This\r
   )\r
+\r
 /*++\r
 \r
 Routine Description:\r
@@ -283,6 +287,7 @@ EmuTimerDriverInitialize (
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
+\r
 /*++\r
 \r
 Routine Description:\r
@@ -341,6 +346,5 @@ Returns:
     return Status;\r
   }\r
 \r
-\r
   return EFI_SUCCESS;\r
 }\r