]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / ArmGicCommonDxe.c
index 5fb33c5465df9e671f1524cae06c3551d55bd8a8..cd12fcda27e9652ccb32e281d1846c7223c7f3f0 100644 (file)
@@ -11,8 +11,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 VOID\r
 EFIAPI\r
 IrqInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE           InterruptType,\r
-  IN EFI_SYSTEM_CONTEXT           SystemContext\r
+  IN EFI_EXCEPTION_TYPE  InterruptType,\r
+  IN EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
 \r
 VOID\r
@@ -26,14 +26,13 @@ ExitBootServicesEvent (
 EFI_HANDLE  gHardwareInterruptHandle = NULL;\r
 \r
 // Notifications\r
-EFI_EVENT EfiExitBootServicesEvent      = (EFI_EVENT)NULL;\r
+EFI_EVENT  EfiExitBootServicesEvent = (EFI_EVENT)NULL;\r
 \r
 // Maximum Number of Interrupts\r
-UINTN mGicNumInterrupts                 = 0;\r
+UINTN  mGicNumInterrupts = 0;\r
 \r
 HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers = NULL;\r
 \r
-\r
 /**\r
   Calculate GICD_ICFGRn base address and corresponding bit\r
   field Int_config[1] of the GIC distributor register.\r
@@ -47,21 +46,21 @@ HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers = NULL;
 **/\r
 EFI_STATUS\r
 GicGetDistributorIcfgBaseAndBit (\r
-  IN HARDWARE_INTERRUPT_SOURCE             Source,\r
-  OUT UINTN                               *RegAddress,\r
-  OUT UINTN                               *Config1Bit\r
+  IN HARDWARE_INTERRUPT_SOURCE  Source,\r
+  OUT UINTN                     *RegAddress,\r
+  OUT UINTN                     *Config1Bit\r
   )\r
 {\r
-  UINTN                  RegIndex;\r
-  UINTN                  Field;\r
+  UINTN  RegIndex;\r
+  UINTN  Field;\r
 \r
   if (Source >= mGicNumInterrupts) {\r
-    ASSERT(Source < mGicNumInterrupts);\r
+    ASSERT (Source < mGicNumInterrupts);\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  RegIndex = Source / ARM_GIC_ICDICFR_F_STRIDE;  // NOTE: truncation is significant\r
-  Field = Source % ARM_GIC_ICDICFR_F_STRIDE;\r
+  RegIndex    = Source / ARM_GIC_ICDICFR_F_STRIDE; // NOTE: truncation is significant\r
+  Field       = Source % ARM_GIC_ICDICFR_F_STRIDE;\r
   *RegAddress = PcdGet64 (PcdGicDistributorBase)\r
                 + ARM_GIC_ICDICFR\r
                 + (ARM_GIC_ICDICFR_BYTES * RegIndex);\r
@@ -71,8 +70,6 @@ GicGetDistributorIcfgBaseAndBit (
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
-\r
 /**\r
   Register Handler for the specified interrupt source.\r
 \r
@@ -87,13 +84,13 @@ GicGetDistributorIcfgBaseAndBit (
 EFI_STATUS\r
 EFIAPI\r
 RegisterInterruptSource (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
-  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL  *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE        Source,\r
+  IN HARDWARE_INTERRUPT_HANDLER       Handler\r
   )\r
 {\r
   if (Source >= mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
+    ASSERT (FALSE);\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -108,25 +105,25 @@ RegisterInterruptSource (
   gRegisteredInterruptHandlers[Source] = Handler;\r
 \r
   // If the interrupt handler is unregistered then disable the interrupt\r
-  if (NULL == Handler){\r
+  if (NULL == Handler) {\r
     return This->DisableInterruptSource (This, Source);\r
   } else {\r
     return This->EnableInterruptSource (This, Source);\r
   }\r
 }\r
 \r
-STATIC VOID *mCpuArchProtocolNotifyEventRegistration;\r
+STATIC VOID  *mCpuArchProtocolNotifyEventRegistration;\r
 \r
 STATIC\r
 VOID\r
 EFIAPI\r
 CpuArchEventProtocolNotify (\r
-  IN  EFI_EVENT       Event,\r
-  IN  VOID            *Context\r
+  IN  EFI_EVENT  Event,\r
+  IN  VOID       *Context\r
   )\r
 {\r
-  EFI_CPU_ARCH_PROTOCOL   *Cpu;\r
-  EFI_STATUS              Status;\r
+  EFI_CPU_ARCH_PROTOCOL  *Cpu;\r
+  EFI_STATUS             Status;\r
 \r
   // Get the CPU protocol that this driver requires.\r
   Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);\r
@@ -137,17 +134,28 @@ CpuArchEventProtocolNotify (
   // Unregister the default exception handler.\r
   Status = Cpu->RegisterInterruptHandler (Cpu, ARM_ARCH_EXCEPTION_IRQ, NULL);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: Cpu->RegisterInterruptHandler() - %r\n",\r
-      __FUNCTION__, Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: Cpu->RegisterInterruptHandler() - %r\n",\r
+      __FUNCTION__,\r
+      Status\r
+      ));\r
     return;\r
   }\r
 \r
   // Register to receive interrupts\r
-  Status = Cpu->RegisterInterruptHandler (Cpu, ARM_ARCH_EXCEPTION_IRQ,\r
-                  Context);\r
+  Status = Cpu->RegisterInterruptHandler (\r
+                  Cpu,\r
+                  ARM_ARCH_EXCEPTION_IRQ,\r
+                  Context\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: Cpu->RegisterInterruptHandler() - %r\n",\r
-      __FUNCTION__, Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: Cpu->RegisterInterruptHandler() - %r\n",\r
+      __FUNCTION__,\r
+      Status\r
+      ));\r
   }\r
 \r
   gBS->CloseEvent (Event);\r
@@ -157,13 +165,13 @@ EFI_STATUS
 InstallAndRegisterInterruptService (\r
   IN EFI_HARDWARE_INTERRUPT_PROTOCOL   *InterruptProtocol,\r
   IN EFI_HARDWARE_INTERRUPT2_PROTOCOL  *Interrupt2Protocol,\r
-  IN EFI_CPU_INTERRUPT_HANDLER          InterruptHandler,\r
-  IN EFI_EVENT_NOTIFY                   ExitBootServicesEvent\r
+  IN EFI_CPU_INTERRUPT_HANDLER         InterruptHandler,\r
+  IN EFI_EVENT_NOTIFY                  ExitBootServicesEvent\r
   )\r
 {\r
-  EFI_STATUS               Status;\r
-  CONST UINTN              RihArraySize =\r
-    (sizeof(HARDWARE_INTERRUPT_HANDLER) * mGicNumInterrupts);\r
+  EFI_STATUS   Status;\r
+  CONST UINTN  RihArraySize =\r
+    (sizeof (HARDWARE_INTERRUPT_HANDLER) * mGicNumInterrupts);\r
 \r
   // Initialize the array for the Interrupt Handlers\r
   gRegisteredInterruptHandlers = AllocateZeroPool (RihArraySize);\r
@@ -191,7 +199,8 @@ InstallAndRegisterInterruptService (
     TPL_CALLBACK,\r
     CpuArchEventProtocolNotify,\r
     InterruptHandler,\r
-    &mCpuArchProtocolNotifyEventRegistration);\r
+    &mCpuArchProtocolNotifyEventRegistration\r
+    );\r
 \r
   // Register for an ExitBootServicesEvent\r
   Status = gBS->CreateEvent (\r