]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPlatformPkg / Drivers / SP805WatchdogDxe / SP805Watchdog.c
index 00238ee65943f49a2c76769ec9e3423171bd0bb8..5821dc1958222637b214628d044c9bbbf14a3ca5 100644 (file)
@@ -7,7 +7,6 @@
 \r
 **/\r
 \r
-\r
 #include <PiDxe.h>\r
 \r
 #include <Library/BaseLib.h>\r
@@ -68,8 +67,8 @@ STATIC
 VOID\r
 EFIAPI\r
 SP805InterruptHandler (\r
-  IN  HARDWARE_INTERRUPT_SOURCE   Source,\r
-  IN  EFI_SYSTEM_CONTEXT          SystemContext\r
+  IN  HARDWARE_INTERRUPT_SOURCE  Source,\r
+  IN  EFI_SYSTEM_CONTEXT         SystemContext\r
   )\r
 {\r
   SP805Unlock ();\r
@@ -171,15 +170,15 @@ STATIC
 EFI_STATUS\r
 EFIAPI\r
 SP805RegisterHandler (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL         *This,\r
-  IN EFI_WATCHDOG_TIMER_NOTIFY                NotifyFunction\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN EFI_WATCHDOG_TIMER_NOTIFY         NotifyFunction\r
   )\r
 {\r
-  if (mWatchdogNotify == NULL && NotifyFunction == NULL) {\r
+  if ((mWatchdogNotify == NULL) && (NotifyFunction == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (mWatchdogNotify != NULL && NotifyFunction != NULL) {\r
+  if ((mWatchdogNotify != NULL) && (NotifyFunction != NULL)) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
@@ -219,8 +218,8 @@ STATIC
 EFI_STATUS\r
 EFIAPI\r
 SP805SetTimerPeriod (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL         *This,\r
-  IN UINT64                                   TimerPeriod   // In 100ns units\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN UINT64                            TimerPeriod          // In 100ns units\r
   )\r
 {\r
   EFI_STATUS  Status;\r
@@ -291,8 +290,8 @@ STATIC
 EFI_STATUS\r
 EFIAPI\r
 SP805GetTimerPeriod (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL         *This,\r
-  OUT UINT64                                  *TimerPeriod\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  OUT UINT64                           *TimerPeriod\r
   )\r
 {\r
   if (TimerPeriod == NULL) {\r
@@ -335,7 +334,7 @@ SP805GetTimerPeriod (
   Retrieves the period of the timer interrupt in 100 nS units.\r
 \r
 **/\r
-STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {\r
+STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  mWatchdogTimer = {\r
   SP805RegisterHandler,\r
   SP805SetTimerPeriod,\r
   SP805GetTimerPeriod\r
@@ -355,16 +354,19 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {
 EFI_STATUS\r
 EFIAPI\r
 SP805Initialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
   EFI_STATUS  Status;\r
   EFI_HANDLE  Handle;\r
 \r
   // Find the interrupt controller protocol.  ASSERT if not found.\r
-  Status = gBS->LocateProtocol (&gHardwareInterruptProtocolGuid, NULL,\r
-                  (VOID **)&mInterrupt);\r
+  Status = gBS->LocateProtocol (\r
+                  &gHardwareInterruptProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&mInterrupt\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   // Unlock access to the SP805 registers\r
@@ -386,17 +388,26 @@ SP805Initialize (
   SP805Lock ();\r
 \r
   if (PcdGet32 (PcdSP805WatchdogInterrupt) > 0) {\r
-    Status = mInterrupt->RegisterInterruptSource (mInterrupt,\r
+    Status = mInterrupt->RegisterInterruptSource (\r
+                           mInterrupt,\r
                            PcdGet32 (PcdSP805WatchdogInterrupt),\r
-                           SP805InterruptHandler);\r
+                           SP805InterruptHandler\r
+                           );\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_ERROR, "%a: failed to register watchdog interrupt - %r\n",\r
-        __FUNCTION__, Status));\r
+      DEBUG ((\r
+        DEBUG_ERROR,\r
+        "%a: failed to register watchdog interrupt - %r\n",\r
+        __FUNCTION__,\r
+        Status\r
+        ));\r
       return Status;\r
     }\r
   } else {\r
-    DEBUG ((DEBUG_WARN, "%a: no interrupt specified, running in RESET mode only\n",\r
-      __FUNCTION__));\r
+    DEBUG ((\r
+      DEBUG_WARN,\r
+      "%a: no interrupt specified, running in RESET mode only\n",\r
+      __FUNCTION__\r
+      ));\r
   }\r
 \r
   //\r
@@ -406,8 +417,13 @@ SP805Initialize (
   ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiWatchdogTimerArchProtocolGuid);\r
 \r
   // Register for an ExitBootServicesEvent\r
-  Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY,\r
-                  ExitBootServicesEvent, NULL, &mEfiExitBootServicesEvent);\r
+  Status = gBS->CreateEvent (\r
+                  EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+                  TPL_NOTIFY,\r
+                  ExitBootServicesEvent,\r
+                  NULL,\r
+                  &mEfiExitBootServicesEvent\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto EXIT;\r
@@ -417,7 +433,8 @@ SP805Initialize (
   Handle = NULL;\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &Handle,\r
-                  &gEfiWatchdogTimerArchProtocolGuid, &mWatchdogTimer,\r
+                  &gEfiWatchdogTimerArchProtocolGuid,\r
+                  &mWatchdogTimer,\r
                   NULL\r
                   );\r
   if (EFI_ERROR (Status)) {\r