]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg: Apply uncrustify changes
authorMichael Kubacki <michael.kubacki@microsoft.com>
Sun, 5 Dec 2021 22:53:52 +0000 (14:53 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 7 Dec 2021 17:24:28 +0000 (17:24 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the ArmVirtPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
38 files changed:
ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c
ArmVirtPkg/CloudHvPlatformHasAcpiDtDxe/CloudHvHasAcpiDtDxe.c
ArmVirtPkg/Include/Guid/Early16550UartBaseAddress.h
ArmVirtPkg/Include/Guid/EarlyPL011BaseAddress.h
ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h
ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c
ArmVirtPkg/Library/ArmVirtDxeHobLib/HobLib.c
ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c
ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c
ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.c
ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c
ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c
ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c
ArmVirtPkg/Library/BaseCachingPciExpressLib/PciExpressLib.c
ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
ArmVirtPkg/Library/Fdt16550SerialPortHookLib/Fdt16550SerialPortHookLib.c
ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c
ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c
ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c
ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c
ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c
ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c
ArmVirtPkg/Library/XenArmGenericTimerVirtCounterLib/XenArmGenericTimerVirtCounterLib.c
ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c
ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c
ArmVirtPkg/PrePi/FdtParser.c
ArmVirtPkg/PrePi/PrePi.c
ArmVirtPkg/PrePi/PrePi.h
ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c
ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c

index 0e86e7a036e50bf1f5b41a562f9e54d2de7ffb24..0595b0e1d38443316f0ffa566c5738622b1ee7c9 100644 (file)
@@ -26,13 +26,13 @@ FindAcpiTableProtocol (
   VOID\r
   )\r
 {\r
-  EFI_STATUS              Status;\r
-  EFI_ACPI_TABLE_PROTOCOL *AcpiTable;\r
+  EFI_STATUS               Status;\r
+  EFI_ACPI_TABLE_PROTOCOL  *AcpiTable;\r
 \r
   Status = gBS->LocateProtocol (\r
                   &gEfiAcpiTableProtocolGuid,\r
                   NULL,\r
-                  (VOID**)&AcpiTable\r
+                  (VOID **)&AcpiTable\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
   return AcpiTable;\r
@@ -52,32 +52,32 @@ FindAcpiTableProtocol (
 EFI_STATUS\r
 EFIAPI\r
 InstallCloudHvAcpiTables (\r
-  IN     EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol\r
+  IN     EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol\r
   )\r
 {\r
-  UINTN          InstalledKey;\r
-  UINTN          TableSize;\r
-  UINTN          AcpiTableLength;\r
-  UINT64         RsdpPtr;\r
-  UINT64         XsdtPtr;\r
-  UINT64         TableOffset;\r
-  UINT64         AcpiTablePtr;\r
-  UINT64         *DsdtPtr;\r
-  EFI_STATUS     Status;\r
+  UINTN       InstalledKey;\r
+  UINTN       TableSize;\r
+  UINTN       AcpiTableLength;\r
+  UINT64      RsdpPtr;\r
+  UINT64      XsdtPtr;\r
+  UINT64      TableOffset;\r
+  UINT64      AcpiTablePtr;\r
+  UINT64      *DsdtPtr;\r
+  EFI_STATUS  Status;\r
 \r
   if (AcpiProtocol == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  RsdpPtr = PcdGet64 (PcdCloudHvAcpiRsdpBaseAddress);\r
-  XsdtPtr = ((EFI_ACPI_6_3_ROOT_SYSTEM_DESCRIPTION_POINTER *)RsdpPtr)->XsdtAddress;\r
+  RsdpPtr         = PcdGet64 (PcdCloudHvAcpiRsdpBaseAddress);\r
+  XsdtPtr         = ((EFI_ACPI_6_3_ROOT_SYSTEM_DESCRIPTION_POINTER *)RsdpPtr)->XsdtAddress;\r
   AcpiTableLength = ((EFI_ACPI_COMMON_HEADER *)XsdtPtr)->Length;\r
-  TableOffset = sizeof (EFI_ACPI_DESCRIPTION_HEADER);\r
-  DsdtPtr = NULL;\r
+  TableOffset     = sizeof (EFI_ACPI_DESCRIPTION_HEADER);\r
+  DsdtPtr         = NULL;\r
 \r
   while (TableOffset < AcpiTableLength) {\r
     AcpiTablePtr = *(UINT64 *)(XsdtPtr + TableOffset);\r
-    TableSize = ((EFI_ACPI_COMMON_HEADER *)AcpiTablePtr)->Length;\r
+    TableSize    = ((EFI_ACPI_COMMON_HEADER *)AcpiTablePtr)->Length;\r
 \r
     //\r
     // Install ACPI tables from XSDT\r
@@ -89,7 +89,7 @@ InstallCloudHvAcpiTables (
                              &InstalledKey\r
                              );\r
     if (EFI_ERROR (Status)) {\r
-        return Status;\r
+      return Status;\r
     }\r
 \r
     //\r
@@ -97,7 +97,8 @@ InstallCloudHvAcpiTables (
     //\r
     if ((DsdtPtr == NULL) &&\r
         (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE ==\r
-         ((EFI_ACPI_COMMON_HEADER *)AcpiTablePtr)->Signature)) {\r
+         ((EFI_ACPI_COMMON_HEADER *)AcpiTablePtr)->Signature))\r
+    {\r
       DsdtPtr = (UINT64 *)((EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE *)AcpiTablePtr)->XDsdt;\r
     }\r
 \r
@@ -113,12 +114,12 @@ InstallCloudHvAcpiTables (
   // Install DSDT table\r
   //\r
   TableSize = ((EFI_ACPI_COMMON_HEADER *)DsdtPtr)->Length;\r
-  Status = AcpiProtocol->InstallAcpiTable (\r
-                           AcpiProtocol,\r
-                           DsdtPtr,\r
-                           TableSize,\r
-                           &InstalledKey\r
-                           );\r
+  Status    = AcpiProtocol->InstallAcpiTable (\r
+                              AcpiProtocol,\r
+                              DsdtPtr,\r
+                              TableSize,\r
+                              &InstalledKey\r
+                              );\r
 \r
   return Status;\r
 }\r
@@ -138,22 +139,22 @@ InstallCloudHvAcpiTables (
 EFI_STATUS\r
 EFIAPI\r
 CloudHvAcpiPlatformEntryPoint (\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_STATUS  Status;\r
 \r
   Status = InstallCloudHvAcpiTables (FindAcpiTableProtocol ());\r
 \r
   if (EFI_ERROR (Status)) {\r
-     DEBUG ((\r
-       DEBUG_ERROR,\r
-       "%a: Fail to install Acpi table: %r\n",\r
-       __FUNCTION__,\r
-       Status\r
-       ));\r
-     CpuDeadLoop ();\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: Fail to install Acpi table: %r\n",\r
+      __FUNCTION__,\r
+      Status\r
+      ));\r
+    CpuDeadLoop ();\r
   }\r
 \r
   return EFI_SUCCESS;\r
index 4cf1d39df475bce67e05dd503ff68ad7393bb94f..05fc35cb82aa39d183ff750a0384f8c3205d57fd 100644 (file)
 EFI_STATUS\r
 EFIAPI\r
 PlatformHasAcpiDt (\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_STATUS  Status;\r
 \r
   //\r
   // If we fail to install any of the necessary protocols below, the OS will be\r
   // unbootable anyway (due to lacking hardware description), so tolerate no\r
   // errors here.\r
   //\r
-  if (MAX_UINTN == MAX_UINT64 &&\r
-      !PcdGetBool (PcdForceNoAcpi)) {\r
+  if ((MAX_UINTN == MAX_UINT64) &&\r
+      !PcdGetBool (PcdForceNoAcpi))\r
+  {\r
     Status = gBS->InstallProtocolInterface (\r
                     &ImageHandle,\r
                     &gEdkiiPlatformHasAcpiGuid,\r
index 6b76f37a27dac03d6749f31a03e8026023231056..22f5bfbd4499b39b20c1074fdbc721db2666f615 100644 (file)
 #ifndef EARLY_16550_UART_BASE_ADDRESS_H__\r
 #define EARLY_16550_UART_BASE_ADDRESS_H__\r
 \r
-#define EARLY_16550_UART_BASE_ADDRESS_GUID       \\r
+#define EARLY_16550_UART_BASE_ADDRESS_GUID  {      \\r
   0xea67ca3e, 0x1f54, 0x436b, {                    \\r
     0x97, 0x88, 0xd4, 0xeb, 0x29, 0xc3, 0x42, 0x67 \\r
     }                                              \\r
   }\r
 \r
-extern EFI_GUID gEarly16550UartBaseAddressGuid;\r
+extern EFI_GUID  gEarly16550UartBaseAddressGuid;\r
 \r
 #endif // EARLY_16550_UART_BASE_ADDRESS_H__\r
index 8818a87aec4f2315b090ceb7256ca0706b30fbe7..492cbbcb15992b35e2e9cc04383a96fd45195d1e 100644 (file)
 #ifndef __EARLY_PL011_BASE_ADDRESS_H__\r
 #define __EARLY_PL011_BASE_ADDRESS_H__\r
 \r
-#define EARLY_PL011_BASE_ADDRESS_GUID \\r
+#define EARLY_PL011_BASE_ADDRESS_GUID  {\\r
           0xB199DEA9, 0xFD5C, 0x4A84, \\r
           { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } \\r
         }\r
 \r
-extern EFI_GUID gEarlyPL011BaseAddressGuid;\r
+extern EFI_GUID  gEarlyPL011BaseAddressGuid;\r
 \r
 #endif\r
index 3daf1fa5f986dcf30c7039e1f6d01266e9c6269f..7812c2e28657ca9525880dcc0d16d7bca90cc334 100644 (file)
@@ -29,7 +29,7 @@
 VOID\r
 EFIAPI\r
 ArmVirtGetMemoryMap (\r
-  OUT ARM_MEMORY_REGION_DESCRIPTOR    **VirtualMemoryMap\r
+  OUT ARM_MEMORY_REGION_DESCRIPTOR  **VirtualMemoryMap\r
   );\r
 \r
 #endif\r
index a42b64d1061dcdf8163775f66b6d2f550e481315..3f5027fac4d65c4ae3f370c5349c6f410aae5b43 100644 (file)
@@ -33,7 +33,7 @@
 STATIC\r
 EFI_STATUS\r
 PlatformHasAcpiDt (\r
-  IN EFI_HANDLE           ImageHandle\r
+  IN EFI_HANDLE  ImageHandle\r
   )\r
 {\r
   if (!PcdGetBool (PcdForceNoAcpi)) {\r
@@ -69,11 +69,11 @@ PlatformHasAcpiDt (
 EFI_STATUS\r
 EFIAPI\r
 KvmtoolPlatformDxeEntryPoint (\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_STATUS  Status;\r
 \r
   Status = PlatformHasAcpiDt (ImageHandle);\r
   ASSERT_EFI_ERROR (Status);\r
index 2da5d22193beb7130ae8e7baaec23f40ae6d573c..55f8bdfdb620047efb876122a899bca828de12c6 100644 (file)
@@ -43,7 +43,7 @@ HobLibConstructor (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
-  UINTN             Index;\r
+  UINTN  Index;\r
 \r
   for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {\r
     if (CompareGuid (&gEfiHobListGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {\r
@@ -101,15 +101,15 @@ GetHobList (
 VOID *\r
 EFIAPI\r
 GetNextHob (\r
-  IN UINT16                 Type,\r
-  IN CONST VOID             *HobStart\r
+  IN UINT16      Type,\r
+  IN CONST VOID  *HobStart\r
   )\r
 {\r
   EFI_PEI_HOB_POINTERS  Hob;\r
 \r
   ASSERT (HobStart != NULL);\r
 \r
-  Hob.Raw = (UINT8 *) HobStart;\r
+  Hob.Raw = (UINT8 *)HobStart;\r
   //\r
   // Parse the HOB list until end of list or matching type is found.\r
   //\r
@@ -117,8 +117,10 @@ GetNextHob (
     if (Hob.Header->HobType == Type) {\r
       return Hob.Raw;\r
     }\r
+\r
     Hob.Raw = GET_NEXT_HOB (Hob);\r
   }\r
+\r
   return NULL;\r
 }\r
 \r
@@ -138,10 +140,10 @@ GetNextHob (
 VOID *\r
 EFIAPI\r
 GetFirstHob (\r
-  IN UINT16                 Type\r
+  IN UINT16  Type\r
   )\r
 {\r
-  VOID      *HobList;\r
+  VOID  *HobList;\r
 \r
   HobList = GetHobList ();\r
   return GetNextHob (Type, HobList);\r
@@ -172,19 +174,21 @@ GetFirstHob (
 VOID *\r
 EFIAPI\r
 GetNextGuidHob (\r
-  IN CONST EFI_GUID         *Guid,\r
-  IN CONST VOID             *HobStart\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN CONST VOID      *HobStart\r
   )\r
 {\r
   EFI_PEI_HOB_POINTERS  GuidHob;\r
 \r
-  GuidHob.Raw = (UINT8 *) HobStart;\r
+  GuidHob.Raw = (UINT8 *)HobStart;\r
   while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {\r
     if (CompareGuid (Guid, &GuidHob.Guid->Name)) {\r
       break;\r
     }\r
+\r
     GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r
   }\r
+\r
   return GuidHob.Raw;\r
 }\r
 \r
@@ -209,10 +213,10 @@ GetNextGuidHob (
 VOID *\r
 EFIAPI\r
 GetFirstGuidHob (\r
-  IN CONST EFI_GUID         *Guid\r
+  IN CONST EFI_GUID  *Guid\r
   )\r
 {\r
-  VOID      *HobList;\r
+  VOID  *HobList;\r
 \r
   HobList = GetHobList ();\r
   return GetNextGuidHob (Guid, HobList);\r
@@ -237,11 +241,11 @@ GetBootModeHob (
   VOID\r
   )\r
 {\r
-  EFI_HOB_HANDOFF_INFO_TABLE    *HandOffHob;\r
+  EFI_HOB_HANDOFF_INFO_TABLE  *HandOffHob;\r
 \r
-  HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();\r
+  HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *)GetHobList ();\r
 \r
-  return  HandOffHob->BootMode;\r
+  return HandOffHob->BootMode;\r
 }\r
 \r
 /**\r
@@ -263,10 +267,10 @@ GetBootModeHob (
 VOID\r
 EFIAPI\r
 BuildModuleHob (\r
-  IN CONST EFI_GUID         *ModuleName,\r
-  IN EFI_PHYSICAL_ADDRESS   MemoryAllocationModule,\r
-  IN UINT64                 ModuleLength,\r
-  IN EFI_PHYSICAL_ADDRESS   EntryPoint\r
+  IN CONST EFI_GUID        *ModuleName,\r
+  IN EFI_PHYSICAL_ADDRESS  MemoryAllocationModule,\r
+  IN UINT64                ModuleLength,\r
+  IN EFI_PHYSICAL_ADDRESS  EntryPoint\r
   )\r
 {\r
   //\r
@@ -330,8 +334,8 @@ BuildResourceDescriptorHob (
 VOID *\r
 EFIAPI\r
 BuildGuidHob (\r
-  IN CONST EFI_GUID              *Guid,\r
-  IN UINTN                       DataLength\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN UINTN           DataLength\r
   )\r
 {\r
   //\r
@@ -369,9 +373,9 @@ BuildGuidHob (
 VOID *\r
 EFIAPI\r
 BuildGuidDataHob (\r
-  IN CONST EFI_GUID              *Guid,\r
-  IN VOID                        *Data,\r
-  IN UINTN                       DataLength\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN VOID            *Data,\r
+  IN UINTN           DataLength\r
   )\r
 {\r
   //\r
@@ -398,8 +402,8 @@ BuildGuidDataHob (
 VOID\r
 EFIAPI\r
 BuildFvHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   )\r
 {\r
   //\r
@@ -427,10 +431,10 @@ BuildFvHob (
 VOID\r
 EFIAPI\r
 BuildFv2Hob (\r
-  IN          EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN          UINT64                      Length,\r
-  IN CONST    EFI_GUID                    *FvName,\r
-  IN CONST    EFI_GUID                    *FileName\r
+  IN          EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN          UINT64                Length,\r
+  IN CONST    EFI_GUID              *FvName,\r
+  IN CONST    EFI_GUID              *FileName\r
   )\r
 {\r
   ASSERT (FALSE);\r
@@ -460,12 +464,12 @@ BuildFv2Hob (
 VOID\r
 EFIAPI\r
 BuildFv3Hob (\r
-  IN          EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN          UINT64                      Length,\r
-  IN          UINT32                      AuthenticationStatus,\r
-  IN          BOOLEAN                     ExtractedFv,\r
-  IN CONST    EFI_GUID                    *FvName  OPTIONAL,\r
-  IN CONST    EFI_GUID                    *FileName OPTIONAL\r
+  IN          EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN          UINT64                Length,\r
+  IN          UINT32                AuthenticationStatus,\r
+  IN          BOOLEAN               ExtractedFv,\r
+  IN CONST    EFI_GUID              *FvName  OPTIONAL,\r
+  IN CONST    EFI_GUID              *FileName OPTIONAL\r
   )\r
 {\r
   ASSERT (FALSE);\r
@@ -488,8 +492,8 @@ BuildFv3Hob (
 VOID\r
 EFIAPI\r
 BuildCvHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   )\r
 {\r
   //\r
@@ -514,8 +518,8 @@ BuildCvHob (
 VOID\r
 EFIAPI\r
 BuildCpuHob (\r
-  IN UINT8                       SizeOfMemorySpace,\r
-  IN UINT8                       SizeOfIoSpace\r
+  IN UINT8  SizeOfMemorySpace,\r
+  IN UINT8  SizeOfIoSpace\r
   )\r
 {\r
   //\r
@@ -540,8 +544,8 @@ BuildCpuHob (
 VOID\r
 EFIAPI\r
 BuildStackHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   )\r
 {\r
   //\r
@@ -567,9 +571,9 @@ BuildStackHob (
 VOID\r
 EFIAPI\r
 BuildBspStoreHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length,\r
-  IN EFI_MEMORY_TYPE             MemoryType\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN EFI_MEMORY_TYPE       MemoryType\r
   )\r
 {\r
   //\r
@@ -595,9 +599,9 @@ BuildBspStoreHob (
 VOID\r
 EFIAPI\r
 BuildMemoryAllocationHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length,\r
-  IN EFI_MEMORY_TYPE             MemoryType\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN EFI_MEMORY_TYPE       MemoryType\r
   )\r
 {\r
   //\r
index 46e5b3f3e1aa2aabf5755d39149dbd6498576730..57bbfd20d03c7d5a89f2856848d634e1375401e9 100644 (file)
@@ -19,7 +19,7 @@
 \r
 #include <Protocol/FdtClient.h>\r
 \r
-STATIC ARM_GIC_ARCH_REVISION        mGicArchRevision;\r
+STATIC ARM_GIC_ARCH_REVISION  mGicArchRevision;\r
 \r
 RETURN_STATUS\r
 EFIAPI\r
@@ -27,115 +27,133 @@ ArmVirtGicArchLibConstructor (
   VOID\r
   )\r
 {\r
-  UINT32                IccSre;\r
-  FDT_CLIENT_PROTOCOL   *FdtClient;\r
-  CONST UINT64          *Reg;\r
-  UINT32                RegSize;\r
-  UINTN                 AddressCells, SizeCells;\r
-  UINTN                 GicRevision;\r
-  EFI_STATUS            Status;\r
-  UINT64                DistBase, CpuBase, RedistBase;\r
-  RETURN_STATUS         PcdStatus;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  UINT32               IccSre;\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  CONST UINT64         *Reg;\r
+  UINT32               RegSize;\r
+  UINTN                AddressCells, SizeCells;\r
+  UINTN                GicRevision;\r
+  EFI_STATUS           Status;\r
+  UINT64               DistBase, CpuBase, RedistBase;\r
+  RETURN_STATUS        PcdStatus;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   GicRevision = 2;\r
-  Status = FdtClient->FindCompatibleNodeReg (FdtClient, "arm,cortex-a15-gic",\r
-                        (CONST VOID **)&Reg, &AddressCells, &SizeCells,\r
-                        &RegSize);\r
+  Status      = FdtClient->FindCompatibleNodeReg (\r
+                             FdtClient,\r
+                             "arm,cortex-a15-gic",\r
+                             (CONST VOID **)&Reg,\r
+                             &AddressCells,\r
+                             &SizeCells,\r
+                             &RegSize\r
+                             );\r
   if (Status == EFI_NOT_FOUND) {\r
     GicRevision = 3;\r
-    Status = FdtClient->FindCompatibleNodeReg (FdtClient, "arm,gic-v3",\r
-                          (CONST VOID **)&Reg, &AddressCells, &SizeCells,\r
-                          &RegSize);\r
+    Status      = FdtClient->FindCompatibleNodeReg (\r
+                               FdtClient,\r
+                               "arm,gic-v3",\r
+                               (CONST VOID **)&Reg,\r
+                               &AddressCells,\r
+                               &SizeCells,\r
+                               &RegSize\r
+                               );\r
   }\r
+\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
   switch (GicRevision) {\r
-\r
-  case 3:\r
-    //\r
-    // The GIC v3 DT binding describes a series of at least 3 physical (base\r
-    // addresses, size) pairs: the distributor interface (GICD), at least one\r
-    // redistributor region (GICR) containing dedicated redistributor\r
-    // interfaces for all individual CPUs, and the CPU interface (GICC).\r
-    // Under virtualization, we assume that the first redistributor region\r
-    // listed covers the boot CPU. Also, our GICv3 driver only supports the\r
-    // system register CPU interface, so we can safely ignore the MMIO version\r
-    // which is listed after the sequence of redistributor interfaces.\r
-    // This means we are only interested in the first two memory regions\r
-    // supplied, and ignore everything else.\r
-    //\r
-    ASSERT (RegSize >= 32);\r
-\r
-    // RegProp[0..1] == { GICD base, GICD size }\r
-    DistBase = SwapBytes64 (Reg[0]);\r
-    ASSERT (DistBase < MAX_UINTN);\r
-\r
-    // RegProp[2..3] == { GICR base, GICR size }\r
-    RedistBase = SwapBytes64 (Reg[2]);\r
-    ASSERT (RedistBase < MAX_UINTN);\r
-\r
-    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
-    ASSERT_RETURN_ERROR (PcdStatus);\r
-    PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase);\r
-    ASSERT_RETURN_ERROR (PcdStatus);\r
-\r
-    DEBUG ((DEBUG_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",\r
-      DistBase, RedistBase));\r
-\r
-    //\r
-    // The default implementation of ArmGicArchLib is responsible for enabling\r
-    // the system register interface on the GICv3 if one is found. So let's do\r
-    // the same here.\r
-    //\r
-    IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
-    if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
-      ArmGicV3SetControlSystemRegisterEnable (IccSre | ICC_SRE_EL2_SRE);\r
+    case 3:\r
+      //\r
+      // The GIC v3 DT binding describes a series of at least 3 physical (base\r
+      // addresses, size) pairs: the distributor interface (GICD), at least one\r
+      // redistributor region (GICR) containing dedicated redistributor\r
+      // interfaces for all individual CPUs, and the CPU interface (GICC).\r
+      // Under virtualization, we assume that the first redistributor region\r
+      // listed covers the boot CPU. Also, our GICv3 driver only supports the\r
+      // system register CPU interface, so we can safely ignore the MMIO version\r
+      // which is listed after the sequence of redistributor interfaces.\r
+      // This means we are only interested in the first two memory regions\r
+      // supplied, and ignore everything else.\r
+      //\r
+      ASSERT (RegSize >= 32);\r
+\r
+      // RegProp[0..1] == { GICD base, GICD size }\r
+      DistBase = SwapBytes64 (Reg[0]);\r
+      ASSERT (DistBase < MAX_UINTN);\r
+\r
+      // RegProp[2..3] == { GICR base, GICR size }\r
+      RedistBase = SwapBytes64 (Reg[2]);\r
+      ASSERT (RedistBase < MAX_UINTN);\r
+\r
+      PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
+      ASSERT_RETURN_ERROR (PcdStatus);\r
+      PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase);\r
+      ASSERT_RETURN_ERROR (PcdStatus);\r
+\r
+      DEBUG ((\r
+        DEBUG_INFO,\r
+        "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",\r
+        DistBase,\r
+        RedistBase\r
+        ));\r
+\r
+      //\r
+      // The default implementation of ArmGicArchLib is responsible for enabling\r
+      // the system register interface on the GICv3 if one is found. So let's do\r
+      // the same here.\r
+      //\r
       IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
-    }\r
-\r
-    //\r
-    // Unlike the default implementation, there is no fall through to GICv2\r
-    // mode if this GICv3 cannot be driven in native mode due to the fact\r
-    // that the System Register interface is unavailable.\r
-    //\r
-    ASSERT (IccSre & ICC_SRE_EL2_SRE);\r
-\r
-    mGicArchRevision = ARM_GIC_ARCH_REVISION_3;\r
-    break;\r
-\r
-  case 2:\r
-    //\r
-    // When the GICv2 is emulated with virtualization=on, it adds a virtual\r
-    // set of control registers. This means the register property can be\r
-    // either 32 or 64 bytes in size.\r
-    //\r
-    ASSERT ((RegSize == 32) || (RegSize == 64));\r
-\r
-    DistBase = SwapBytes64 (Reg[0]);\r
-    CpuBase  = SwapBytes64 (Reg[2]);\r
-    ASSERT (DistBase < MAX_UINTN);\r
-    ASSERT (CpuBase < MAX_UINTN);\r
-\r
-    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
-    ASSERT_RETURN_ERROR (PcdStatus);\r
-    PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase);\r
-    ASSERT_RETURN_ERROR (PcdStatus);\r
-\r
-    DEBUG ((DEBUG_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));\r
-\r
-    mGicArchRevision = ARM_GIC_ARCH_REVISION_2;\r
-    break;\r
-\r
-  default:\r
-    DEBUG ((DEBUG_ERROR, "%a: No GIC revision specified!\n", __FUNCTION__));\r
-    return RETURN_NOT_FOUND;\r
+      if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
+        ArmGicV3SetControlSystemRegisterEnable (IccSre | ICC_SRE_EL2_SRE);\r
+        IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
+      }\r
+\r
+      //\r
+      // Unlike the default implementation, there is no fall through to GICv2\r
+      // mode if this GICv3 cannot be driven in native mode due to the fact\r
+      // that the System Register interface is unavailable.\r
+      //\r
+      ASSERT (IccSre & ICC_SRE_EL2_SRE);\r
+\r
+      mGicArchRevision = ARM_GIC_ARCH_REVISION_3;\r
+      break;\r
+\r
+    case 2:\r
+      //\r
+      // When the GICv2 is emulated with virtualization=on, it adds a virtual\r
+      // set of control registers. This means the register property can be\r
+      // either 32 or 64 bytes in size.\r
+      //\r
+      ASSERT ((RegSize == 32) || (RegSize == 64));\r
+\r
+      DistBase = SwapBytes64 (Reg[0]);\r
+      CpuBase  = SwapBytes64 (Reg[2]);\r
+      ASSERT (DistBase < MAX_UINTN);\r
+      ASSERT (CpuBase < MAX_UINTN);\r
+\r
+      PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
+      ASSERT_RETURN_ERROR (PcdStatus);\r
+      PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase);\r
+      ASSERT_RETURN_ERROR (PcdStatus);\r
+\r
+      DEBUG ((DEBUG_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));\r
+\r
+      mGicArchRevision = ARM_GIC_ARCH_REVISION_2;\r
+      break;\r
+\r
+    default:\r
+      DEBUG ((DEBUG_ERROR, "%a: No GIC revision specified!\n", __FUNCTION__));\r
+      return RETURN_NOT_FOUND;\r
   }\r
+\r
   return RETURN_SUCCESS;\r
 }\r
 \r
index 4946fad77adf74a10772ecf6a33e0dfab95c7ed2..022e13e762b653ecc317e6cf564c7b7931918775 100644 (file)
@@ -35,7 +35,7 @@ InitMmu (
   // Get Virtual Memory Map from the Platform Library\r
   ArmVirtGetMemoryMap (&MemoryTable);\r
 \r
-  //Note: Because we called PeiServicesInstallPeiMemory() before to call InitMmu() the MMU Page Table resides in\r
+  // Note: Because we called PeiServicesInstallPeiMemory() before to call InitMmu() the MMU Page Table resides in\r
   //      DRAM (even at the top of DRAM as it is the first permanent memory allocation)\r
   Status = ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize);\r
   if (EFI_ERROR (Status)) {\r
@@ -46,12 +46,12 @@ InitMmu (
 EFI_STATUS\r
 EFIAPI\r
 MemoryPeim (\r
-  IN EFI_PHYSICAL_ADDRESS               UefiMemoryBase,\r
-  IN UINT64                             UefiMemorySize\r
+  IN EFI_PHYSICAL_ADDRESS  UefiMemoryBase,\r
+  IN UINT64                UefiMemorySize\r
   )\r
 {\r
-  EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes;\r
-  UINT64                      SystemMemoryTop;\r
+  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttributes;\r
+  UINT64                       SystemMemoryTop;\r
 \r
   // Ensure PcdSystemMemorySize has been set\r
   ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);\r
@@ -60,35 +60,35 @@ MemoryPeim (
   // Now, the permanent memory has been installed, we can call AllocatePages()\r
   //\r
   ResourceAttributes = (\r
-      EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
-      EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
-      EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |\r
-      EFI_RESOURCE_ATTRIBUTE_TESTED\r
-  );\r
+                        EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
+                        EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
+                        EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |\r
+                        EFI_RESOURCE_ATTRIBUTE_TESTED\r
+                        );\r
 \r
   SystemMemoryTop = PcdGet64 (PcdSystemMemoryBase) +\r
                     PcdGet64 (PcdSystemMemorySize);\r
 \r
   if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) {\r
     BuildResourceDescriptorHob (\r
-        EFI_RESOURCE_SYSTEM_MEMORY,\r
-        ResourceAttributes,\r
-        PcdGet64 (PcdSystemMemoryBase),\r
-        (UINT64)MAX_ALLOC_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1\r
-        );\r
+      EFI_RESOURCE_SYSTEM_MEMORY,\r
+      ResourceAttributes,\r
+      PcdGet64 (PcdSystemMemoryBase),\r
+      (UINT64)MAX_ALLOC_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1\r
+      );\r
     BuildResourceDescriptorHob (\r
-        EFI_RESOURCE_SYSTEM_MEMORY,\r
-        ResourceAttributes,\r
-        (UINT64)MAX_ALLOC_ADDRESS + 1,\r
-        SystemMemoryTop - MAX_ALLOC_ADDRESS - 1\r
-        );\r
+      EFI_RESOURCE_SYSTEM_MEMORY,\r
+      ResourceAttributes,\r
+      (UINT64)MAX_ALLOC_ADDRESS + 1,\r
+      SystemMemoryTop - MAX_ALLOC_ADDRESS - 1\r
+      );\r
   } else {\r
     BuildResourceDescriptorHob (\r
-        EFI_RESOURCE_SYSTEM_MEMORY,\r
-        ResourceAttributes,\r
-        PcdGet64 (PcdSystemMemoryBase),\r
-        PcdGet64 (PcdSystemMemorySize)\r
-        );\r
+      EFI_RESOURCE_SYSTEM_MEMORY,\r
+      ResourceAttributes,\r
+      PcdGet64 (PcdSystemMemoryBase),\r
+      PcdGet64 (PcdSystemMemorySize)\r
+      );\r
   }\r
 \r
   //\r
@@ -98,7 +98,7 @@ MemoryPeim (
   // that the contents we put there with the caches and MMU off will still\r
   // be visible after turning them on.\r
   //\r
-  InvalidateDataCacheRange ((VOID*)(UINTN)UefiMemoryBase, UefiMemorySize);\r
+  InvalidateDataCacheRange ((VOID *)(UINTN)UefiMemoryBase, UefiMemorySize);\r
 \r
   // Build Memory Allocation Hob\r
   InitMmu ();\r
index 63dc1476a5dd3ac018d31dec80f47c52e4199329..45dd9f179c6a08ffa8e671bd45b956a6ef493e1d 100644 (file)
@@ -22,31 +22,44 @@ ArmVirtPL031FdtClientLibConstructor (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  FDT_CLIENT_PROTOCOL           *FdtClient;\r
-  INT32                         Node;\r
-  CONST UINT64                  *Reg;\r
-  UINT32                        RegSize;\r
-  UINT64                        RegBase;\r
-  RETURN_STATUS                 PcdStatus;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  EFI_STATUS           Status;\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  INT32                Node;\r
+  CONST UINT64         *Reg;\r
+  UINT32               RegSize;\r
+  UINT64               RegBase;\r
+  RETURN_STATUS        PcdStatus;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   Status = FdtClient->FindCompatibleNode (FdtClient, "arm,pl031", &Node);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_WARN, "%a: No 'arm,pl031' compatible DT node found\n",\r
-      __FUNCTION__));\r
+    DEBUG ((\r
+      DEBUG_WARN,\r
+      "%a: No 'arm,pl031' compatible DT node found\n",\r
+      __FUNCTION__\r
+      ));\r
     return EFI_SUCCESS;\r
   }\r
 \r
-  Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",\r
-                        (CONST VOID **)&Reg, &RegSize);\r
+  Status = FdtClient->GetNodeProperty (\r
+                        FdtClient,\r
+                        Node,\r
+                        "reg",\r
+                        (CONST VOID **)&Reg,\r
+                        &RegSize\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_WARN,\r
+    DEBUG ((\r
+      DEBUG_WARN,\r
       "%a: No 'reg' property found in 'arm,pl031' compatible DT node\n",\r
-      __FUNCTION__));\r
+      __FUNCTION__\r
+      ));\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -66,10 +79,15 @@ ArmVirtPL031FdtClientLibConstructor (
   // need to disable it in the device tree to prevent the OS from attaching\r
   // its device driver as well.\r
   //\r
-  Status = FdtClient->SetNodeProperty (FdtClient, Node, "status",\r
-                        "disabled", sizeof ("disabled"));\r
+  Status = FdtClient->SetNodeProperty (\r
+                        FdtClient,\r
+                        Node,\r
+                        "status",\r
+                        "disabled",\r
+                        sizeof ("disabled")\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_WARN, "Failed to set PL031 status to 'disabled'\n"));\r
+    DEBUG ((DEBUG_WARN, "Failed to set PL031 status to 'disabled'\n"));\r
   }\r
 \r
   return EFI_SUCCESS;\r
index 90962caffd0467d5a6c194e8239ebefbb2e71343..55295c1029e5703eeee3b60233b79b11b5f5bca2 100644 (file)
 \r
 #pragma pack(1)\r
 typedef struct {\r
-  ACPI_HID_DEVICE_PATH     AcpiDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL EndDevicePath;\r
+  ACPI_HID_DEVICE_PATH        AcpiDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL    EndDevicePath;\r
 } EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;\r
 #pragma pack ()\r
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED\r
-CHAR16 *mPciHostBridgeAcpiAddressSpaceTypeStr[] = {\r
+CHAR16  *mPciHostBridgeAcpiAddressSpaceTypeStr[] = {\r
   L"Mem",\r
   L"I/O",\r
   L"Bus"\r
 };\r
 \r
-STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath = {\r
+STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH  mEfiPciRootBridgeDevicePath = {\r
   {\r
     {\r
       ACPI_DEVICE_PATH,\r
       ACPI_DP,\r
       {\r
-        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),\r
-        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)\r
+        (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),\r
+        (UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)\r
       }\r
     },\r
     EISA_PNP_ID (0x0A03), // HID\r
-    0                    // UID\r
+    0                     // UID\r
   },\r
 \r
   {\r
@@ -55,13 +55,12 @@ STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath = {
   }\r
 };\r
 \r
-\r
 GLOBAL_REMOVE_IF_UNREFERENCED\r
-CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {\r
+CHAR16  *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {\r
   L"Mem", L"I/O", L"Bus"\r
 };\r
 \r
-STATIC PCI_ROOT_BRIDGE mRootBridge;\r
+STATIC PCI_ROOT_BRIDGE  mRootBridge;\r
 \r
 /**\r
   Utility function to return all the root bridge instances in an array.\r
@@ -84,18 +83,18 @@ STATIC PCI_ROOT_BRIDGE mRootBridge;
 PCI_ROOT_BRIDGE *\r
 EFIAPI\r
 PciHostBridgeUtilityGetRootBridges (\r
-  OUT UINTN                    *Count,\r
-  IN  UINT64                   Attributes,\r
-  IN  UINT64                   AllocationAttributes,\r
-  IN  BOOLEAN                  DmaAbove4G,\r
-  IN  BOOLEAN                  NoExtendedConfigSpace,\r
-  IN  UINTN                    BusMin,\r
-  IN  UINTN                    BusMax,\r
-  IN  PCI_ROOT_BRIDGE_APERTURE *Io,\r
-  IN  PCI_ROOT_BRIDGE_APERTURE *Mem,\r
-  IN  PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,\r
-  IN  PCI_ROOT_BRIDGE_APERTURE *PMem,\r
-  IN  PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G\r
+  OUT UINTN                     *Count,\r
+  IN  UINT64                    Attributes,\r
+  IN  UINT64                    AllocationAttributes,\r
+  IN  BOOLEAN                   DmaAbove4G,\r
+  IN  BOOLEAN                   NoExtendedConfigSpace,\r
+  IN  UINTN                     BusMin,\r
+  IN  UINTN                     BusMax,\r
+  IN  PCI_ROOT_BRIDGE_APERTURE  *Io,\r
+  IN  PCI_ROOT_BRIDGE_APERTURE  *Mem,\r
+  IN  PCI_ROOT_BRIDGE_APERTURE  *MemAbove4G,\r
+  IN  PCI_ROOT_BRIDGE_APERTURE  *PMem,\r
+  IN  PCI_ROOT_BRIDGE_APERTURE  *PMemAbove4G\r
   )\r
 {\r
   if ((Count == NULL)       ||\r
@@ -103,38 +102,38 @@ PciHostBridgeUtilityGetRootBridges (
       (Mem == NULL)         ||\r
       (MemAbove4G == NULL)  ||\r
       (PMem == NULL)        ||\r
-      (PMemAbove4G == NULL)) {\r
+      (PMemAbove4G == NULL))\r
+  {\r
     return NULL;\r
   }\r
 \r
-\r
   *Count = 1;\r
 \r
-  mRootBridge.Segment               = 0;\r
-  mRootBridge.Supports              = Attributes;\r
-  mRootBridge.Attributes            = Attributes;\r
+  mRootBridge.Segment    = 0;\r
+  mRootBridge.Supports   = Attributes;\r
+  mRootBridge.Attributes = Attributes;\r
 \r
   mRootBridge.DmaAbove4G            = DmaAbove4G;\r
   mRootBridge.NoExtendedConfigSpace = NoExtendedConfigSpace;\r
   mRootBridge.ResourceAssigned      = FALSE;\r
 \r
-  mRootBridge.AllocationAttributes  = AllocationAttributes;\r
-\r
-  mRootBridge.Bus.Base              = BusMin;\r
-  mRootBridge.Bus.Limit             = BusMax;\r
-  mRootBridge.Io.Base               = Io->Base;\r
-  mRootBridge.Io.Limit              = Io->Limit;\r
-  mRootBridge.Mem.Base              = Mem->Base;\r
-  mRootBridge.Mem.Limit             = Mem->Limit;\r
-  mRootBridge.MemAbove4G.Base       = MemAbove4G->Base;\r
-  mRootBridge.MemAbove4G.Limit      = MemAbove4G->Limit;\r
-  mRootBridge.PMem.Base             = PMem->Base;\r
-  mRootBridge.PMem.Limit            = PMem->Limit;\r
-  mRootBridge.PMemAbove4G.Base      = PMemAbove4G->Base;\r
-  mRootBridge.PMemAbove4G.Limit     = PMemAbove4G->Limit;\r
+  mRootBridge.AllocationAttributes = AllocationAttributes;\r
+\r
+  mRootBridge.Bus.Base          = BusMin;\r
+  mRootBridge.Bus.Limit         = BusMax;\r
+  mRootBridge.Io.Base           = Io->Base;\r
+  mRootBridge.Io.Limit          = Io->Limit;\r
+  mRootBridge.Mem.Base          = Mem->Base;\r
+  mRootBridge.Mem.Limit         = Mem->Limit;\r
+  mRootBridge.MemAbove4G.Base   = MemAbove4G->Base;\r
+  mRootBridge.MemAbove4G.Limit  = MemAbove4G->Limit;\r
+  mRootBridge.PMem.Base         = PMem->Base;\r
+  mRootBridge.PMem.Limit        = PMem->Limit;\r
+  mRootBridge.PMemAbove4G.Base  = PMemAbove4G->Base;\r
+  mRootBridge.PMemAbove4G.Limit = PMemAbove4G->Limit;\r
 \r
   mRootBridge.DevicePath =\r
-    (EFI_DEVICE_PATH_PROTOCOL*)&mEfiPciRootBridgeDevicePath;\r
+    (EFI_DEVICE_PATH_PROTOCOL *)&mEfiPciRootBridgeDevicePath;\r
 \r
   return &mRootBridge;\r
 }\r
@@ -149,8 +148,8 @@ PciHostBridgeUtilityGetRootBridges (
 VOID\r
 EFIAPI\r
 PciHostBridgeUtilityFreeRootBridges (\r
-  IN PCI_ROOT_BRIDGE *Bridges,\r
-  IN UINTN           Count\r
+  IN PCI_ROOT_BRIDGE  *Bridges,\r
+  IN UINTN            Count\r
   )\r
 {\r
   // Nothing to do here.\r
@@ -176,18 +175,20 @@ PciHostBridgeUtilityResourceConflict (
   IN VOID  *Configuration\r
   )\r
 {\r
-  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor;\r
-  UINTN                             RootBridgeIndex;\r
+  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  *Descriptor;\r
+  UINTN                              RootBridgeIndex;\r
+\r
   DEBUG ((DEBUG_ERROR, "PciHostBridge: Resource conflict happens!\n"));\r
 \r
   RootBridgeIndex = 0;\r
-  Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR*)Configuration;\r
+  Descriptor      = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Configuration;\r
   while (Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) {\r
     DEBUG ((DEBUG_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++));\r
-    for (; Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR; Descriptor++) {\r
-      ASSERT (Descriptor->ResType <\r
-              ARRAY_SIZE (mPciHostBridgeAcpiAddressSpaceTypeStr)\r
-              );\r
+    for ( ; Descriptor->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR; Descriptor++) {\r
+      ASSERT (\r
+        Descriptor->ResType <\r
+        ARRAY_SIZE (mPciHostBridgeAcpiAddressSpaceTypeStr)\r
+        );\r
       DEBUG ((\r
         DEBUG_ERROR,\r
         " %s: Length/Alignment = 0x%lx / 0x%lx\n",\r
@@ -207,12 +208,13 @@ PciHostBridgeUtilityResourceConflict (
           ));\r
       }\r
     }\r
+\r
     //\r
     // Skip the END descriptor for root bridge\r
     //\r
     ASSERT (Descriptor->Desc == ACPI_END_TAG_DESCRIPTOR);\r
-    Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR*)(\r
-                   (EFI_ACPI_END_TAG_DESCRIPTOR*)Descriptor + 1\r
-                   );\r
+    Descriptor = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)(\r
+                                                       (EFI_ACPI_END_TAG_DESCRIPTOR *)Descriptor + 1\r
+                                                       );\r
   }\r
 }\r
index 419ed7d50f6b81d4a699c3801b6fcae1878e2507..c7065b7ec5c1a083ebbf9c16867786be8fffd849 100644 (file)
@@ -27,7 +27,7 @@
 \r
 #include <Protocol/FdtClient.h>\r
 \r
-STATIC UINT32 mArmPsciMethod;\r
+STATIC UINT32  mArmPsciMethod;\r
 \r
 RETURN_STATUS\r
 EFIAPI\r
@@ -35,16 +35,24 @@ ArmPsciResetSystemLibConstructor (
   VOID\r
   )\r
 {\r
-  EFI_STATUS            Status;\r
-  FDT_CLIENT_PROTOCOL   *FdtClient;\r
-  CONST VOID            *Prop;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  EFI_STATUS           Status;\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  CONST VOID           *Prop;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = FdtClient->FindCompatibleNodeProperty (FdtClient, "arm,psci-0.2",\r
-                        "method", &Prop, NULL);\r
+  Status = FdtClient->FindCompatibleNodeProperty (\r
+                        FdtClient,\r
+                        "arm,psci-0.2",\r
+                        "method",\r
+                        &Prop,\r
+                        NULL\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -54,10 +62,15 @@ ArmPsciResetSystemLibConstructor (
   } else if (AsciiStrnCmp (Prop, "smc", 3) == 0) {\r
     mArmPsciMethod = 2;\r
   } else {\r
-    DEBUG ((DEBUG_ERROR, "%a: Unknown PSCI method \"%a\"\n", __FUNCTION__,\r
-      Prop));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: Unknown PSCI method \"%a\"\n",\r
+      __FUNCTION__,\r
+      Prop\r
+      ));\r
     return EFI_NOT_FOUND;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -75,24 +88,24 @@ ResetCold (
   VOID\r
   )\r
 {\r
-  ARM_SMC_ARGS ArmSmcArgs;\r
-  ARM_HVC_ARGS ArmHvcArgs;\r
+  ARM_SMC_ARGS  ArmSmcArgs;\r
+  ARM_HVC_ARGS  ArmHvcArgs;\r
 \r
   // Send a PSCI 0.2 SYSTEM_RESET command\r
   ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET;\r
   ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET;\r
 \r
   switch (mArmPsciMethod) {\r
-  case 1:\r
-    ArmCallHvc (&ArmHvcArgs);\r
-    break;\r
+    case 1:\r
+      ArmCallHvc (&ArmHvcArgs);\r
+      break;\r
 \r
-  case 2:\r
-    ArmCallSmc (&ArmSmcArgs);\r
-    break;\r
+    case 2:\r
+      ArmCallSmc (&ArmSmcArgs);\r
+      break;\r
 \r
-  default:\r
-    DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
+    default:\r
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
   }\r
 }\r
 \r
@@ -124,24 +137,24 @@ ResetShutdown (
   VOID\r
   )\r
 {\r
-  ARM_SMC_ARGS ArmSmcArgs;\r
-  ARM_HVC_ARGS ArmHvcArgs;\r
+  ARM_SMC_ARGS  ArmSmcArgs;\r
+  ARM_HVC_ARGS  ArmHvcArgs;\r
 \r
   // Send a PSCI 0.2 SYSTEM_OFF command\r
   ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF;\r
   ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF;\r
 \r
   switch (mArmPsciMethod) {\r
-  case 1:\r
-    ArmCallHvc (&ArmHvcArgs);\r
-    break;\r
+    case 1:\r
+      ArmCallHvc (&ArmHvcArgs);\r
+      break;\r
 \r
-  case 2:\r
-    ArmCallSmc (&ArmSmcArgs);\r
-    break;\r
+    case 2:\r
+      ArmCallSmc (&ArmSmcArgs);\r
+      break;\r
 \r
-  default:\r
-    DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
+    default:\r
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
   }\r
 }\r
 \r
@@ -159,8 +172,8 @@ ResetShutdown (
 VOID\r
 EFIAPI\r
 ResetPlatformSpecific (\r
-  IN UINTN   DataSize,\r
-  IN VOID    *ResetData\r
+  IN UINTN  DataSize,\r
+  IN VOID   *ResetData\r
   )\r
 {\r
   // Map the platform specific reset as reboot\r
@@ -182,30 +195,30 @@ ResetPlatformSpecific (
 VOID\r
 EFIAPI\r
 ResetSystem (\r
-  IN EFI_RESET_TYPE               ResetType,\r
-  IN EFI_STATUS                   ResetStatus,\r
-  IN UINTN                        DataSize,\r
-  IN VOID                         *ResetData OPTIONAL\r
+  IN EFI_RESET_TYPE  ResetType,\r
+  IN EFI_STATUS      ResetStatus,\r
+  IN UINTN           DataSize,\r
+  IN VOID            *ResetData OPTIONAL\r
   )\r
 {\r
   switch (ResetType) {\r
-  case EfiResetWarm:\r
-    ResetWarm ();\r
-    break;\r
+    case EfiResetWarm:\r
+      ResetWarm ();\r
+      break;\r
 \r
-  case EfiResetCold:\r
-    ResetCold ();\r
-    break;\r
+    case EfiResetCold:\r
+      ResetCold ();\r
+      break;\r
 \r
-  case EfiResetShutdown:\r
-    ResetShutdown ();\r
-    return;\r
+    case EfiResetShutdown:\r
+      ResetShutdown ();\r
+      return;\r
 \r
-  case EfiResetPlatformSpecific:\r
-    ResetPlatformSpecific (DataSize, ResetData);\r
-    return;\r
+    case EfiResetPlatformSpecific:\r
+      ResetPlatformSpecific (DataSize, ResetData);\r
+      return;\r
 \r
-  default:\r
-    return;\r
+    default:\r
+      return;\r
   }\r
 }\r
index 394a04e3c384bf27ca6ad2e28fa8d77e97acd7f9..03d14fe4325dd67f949f0993685026934dd6fe96 100644 (file)
@@ -34,20 +34,20 @@ DiscoverPsciMethod (
   VOID\r
   )\r
 {\r
-  VOID                            *DeviceTreeBase;\r
-  INT32                           Node, Prev;\r
-  INT32                           Len;\r
-  CONST CHAR8                     *Compatible;\r
-  CONST CHAR8                     *CompatibleItem;\r
-  CONST VOID                      *Prop;\r
-\r
-  DeviceTreeBase = (VOID*)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
+  VOID         *DeviceTreeBase;\r
+  INT32        Node, Prev;\r
+  INT32        Len;\r
+  CONST CHAR8  *Compatible;\r
+  CONST CHAR8  *CompatibleItem;\r
+  CONST VOID   *Prop;\r
+\r
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
   ASSERT (fdt_check_header (DeviceTreeBase) == 0);\r
 \r
   //\r
   // Enumerate all FDT nodes looking for the PSCI node and capture the method\r
   //\r
-  for (Prev = 0;; Prev = Node) {\r
+  for (Prev = 0; ; Prev = Node) {\r
     Node = fdt_next_node (DeviceTreeBase, Prev, NULL);\r
     if (Node < 0) {\r
       break;\r
@@ -62,16 +62,19 @@ DiscoverPsciMethod (
     // Iterate over the NULL-separated items in the compatible string\r
     //\r
     for (CompatibleItem = Compatible; CompatibleItem < Compatible + Len;\r
-      CompatibleItem += 1 + AsciiStrLen (CompatibleItem)) {\r
-\r
+         CompatibleItem += 1 + AsciiStrLen (CompatibleItem))\r
+    {\r
       if (AsciiStrCmp (CompatibleItem, "arm,psci-0.2") != 0) {\r
         continue;\r
       }\r
 \r
       Prop = fdt_getprop (DeviceTreeBase, Node, "method", NULL);\r
       if (!Prop) {\r
-        DEBUG ((DEBUG_ERROR, "%a: Missing PSCI method property\n",\r
-          __FUNCTION__));\r
+        DEBUG ((\r
+          DEBUG_ERROR,\r
+          "%a: Missing PSCI method property\n",\r
+          __FUNCTION__\r
+          ));\r
         return PsciMethodUnknown;\r
       }\r
 \r
@@ -80,39 +83,44 @@ DiscoverPsciMethod (
       } else if (AsciiStrnCmp (Prop, "smc", 3) == 0) {\r
         return PsciMethodSmc;\r
       } else {\r
-        DEBUG ((DEBUG_ERROR, "%a: Unknown PSCI method \"%a\"\n", __FUNCTION__,\r
-          Prop));\r
+        DEBUG ((\r
+          DEBUG_ERROR,\r
+          "%a: Unknown PSCI method \"%a\"\n",\r
+          __FUNCTION__,\r
+          Prop\r
+          ));\r
         return PsciMethodUnknown;\r
       }\r
     }\r
   }\r
+\r
   return PsciMethodUnknown;\r
 }\r
 \r
 STATIC\r
 VOID\r
 PerformPsciAction (\r
-  IN  UINTN     Arg0\r
+  IN  UINTN  Arg0\r
   )\r
 {\r
-  ARM_SMC_ARGS ArmSmcArgs;\r
-  ARM_HVC_ARGS ArmHvcArgs;\r
+  ARM_SMC_ARGS  ArmSmcArgs;\r
+  ARM_HVC_ARGS  ArmHvcArgs;\r
 \r
   ArmSmcArgs.Arg0 = Arg0;\r
   ArmHvcArgs.Arg0 = Arg0;\r
 \r
   switch (DiscoverPsciMethod ()) {\r
-  case PsciMethodHvc:\r
-    ArmCallHvc (&ArmHvcArgs);\r
-    break;\r
+    case PsciMethodHvc:\r
+      ArmCallHvc (&ArmHvcArgs);\r
+      break;\r
 \r
-  case PsciMethodSmc:\r
-    ArmCallSmc (&ArmSmcArgs);\r
-    break;\r
+    case PsciMethodSmc:\r
+      ArmCallSmc (&ArmSmcArgs);\r
+      break;\r
 \r
-  default:\r
-    DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
-    ASSERT (FALSE);\r
+    default:\r
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
+      ASSERT (FALSE);\r
   }\r
 }\r
 \r
@@ -180,8 +188,8 @@ ResetShutdown (
 VOID\r
 EFIAPI\r
 ResetPlatformSpecific (\r
-  IN UINTN   DataSize,\r
-  IN VOID    *ResetData\r
+  IN UINTN  DataSize,\r
+  IN VOID   *ResetData\r
   )\r
 {\r
   // Map the platform specific reset as reboot\r
@@ -203,30 +211,30 @@ ResetPlatformSpecific (
 VOID\r
 EFIAPI\r
 ResetSystem (\r
-  IN EFI_RESET_TYPE               ResetType,\r
-  IN EFI_STATUS                   ResetStatus,\r
-  IN UINTN                        DataSize,\r
-  IN VOID                         *ResetData OPTIONAL\r
+  IN EFI_RESET_TYPE  ResetType,\r
+  IN EFI_STATUS      ResetStatus,\r
+  IN UINTN           DataSize,\r
+  IN VOID            *ResetData OPTIONAL\r
   )\r
 {\r
   switch (ResetType) {\r
-  case EfiResetWarm:\r
-    ResetWarm ();\r
-    break;\r
+    case EfiResetWarm:\r
+      ResetWarm ();\r
+      break;\r
 \r
-  case EfiResetCold:\r
-    ResetCold ();\r
-    break;\r
+    case EfiResetCold:\r
+      ResetCold ();\r
+      break;\r
 \r
-  case EfiResetShutdown:\r
-    ResetShutdown ();\r
-    return;\r
+    case EfiResetShutdown:\r
+      ResetShutdown ();\r
+      return;\r
 \r
-  case EfiResetPlatformSpecific:\r
-    ResetPlatformSpecific (DataSize, ResetData);\r
-    return;\r
+    case EfiResetPlatformSpecific:\r
+      ResetPlatformSpecific (DataSize, ResetData);\r
+      return;\r
 \r
-  default:\r
-    return;\r
+    default:\r
+      return;\r
   }\r
 }\r
index 35d61feefc8f7408c746e96119638f98eac1ebb2..38dd6c533329975583bef220f4c210ecad2f9e30 100644 (file)
@@ -18,9 +18,9 @@
 \r
 #pragma pack (1)\r
 typedef struct {\r
-  UINT32  Type;\r
-  UINT32  Number;\r
-  UINT32  Flags;\r
+  UINT32    Type;\r
+  UINT32    Number;\r
+  UINT32    Flags;\r
 } INTERRUPT_PROPERTY;\r
 #pragma pack ()\r
 \r
@@ -30,25 +30,35 @@ ArmVirtTimerFdtClientLibConstructor (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  FDT_CLIENT_PROTOCOL           *FdtClient;\r
-  CONST INTERRUPT_PROPERTY      *InterruptProp;\r
-  UINT32                        PropSize;\r
-  INT32                         SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum;\r
-  RETURN_STATUS                 PcdStatus;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  EFI_STATUS                Status;\r
+  FDT_CLIENT_PROTOCOL       *FdtClient;\r
+  CONST INTERRUPT_PROPERTY  *InterruptProp;\r
+  UINT32                    PropSize;\r
+  INT32                     SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum;\r
+  RETURN_STATUS             PcdStatus;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = FdtClient->FindCompatibleNodeProperty (FdtClient, "arm,armv7-timer",\r
-                        "interrupts", (CONST VOID **)&InterruptProp,\r
-                        &PropSize);\r
+  Status = FdtClient->FindCompatibleNodeProperty (\r
+                        FdtClient,\r
+                        "arm,armv7-timer",\r
+                        "interrupts",\r
+                        (CONST VOID **)&InterruptProp,\r
+                        &PropSize\r
+                        );\r
   if (Status == EFI_NOT_FOUND) {\r
-    Status = FdtClient->FindCompatibleNodeProperty (FdtClient,\r
-                          "arm,armv8-timer", "interrupts",\r
+    Status = FdtClient->FindCompatibleNodeProperty (\r
+                          FdtClient,\r
+                          "arm,armv8-timer",\r
+                          "interrupts",\r
                           (CONST VOID **)&InterruptProp,\r
-                          &PropSize);\r
+                          &PropSize\r
+                          );\r
   }\r
 \r
   if (EFI_ERROR (Status)) {\r
@@ -68,10 +78,16 @@ ArmVirtTimerFdtClientLibConstructor (
   VirtIntrNum = SwapBytes32 (InterruptProp[2].Number)\r
                 + (InterruptProp[2].Type ? 16 : 0);\r
   HypIntrNum = PropSize < 48 ? 0 : SwapBytes32 (InterruptProp[3].Number)\r
-                                   + (InterruptProp[3].Type ? 16 : 0);\r
-\r
-  DEBUG ((DEBUG_INFO, "Found Timer interrupts %d, %d, %d, %d\n",\r
-    SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum));\r
+               + (InterruptProp[3].Type ? 16 : 0);\r
+\r
+  DEBUG ((\r
+    DEBUG_INFO,\r
+    "Found Timer interrupts %d, %d, %d, %d\n",\r
+    SecIntrNum,\r
+    IntrNum,\r
+    VirtIntrNum,\r
+    HypIntrNum\r
+    ));\r
 \r
   PcdStatus = PcdSet32S (PcdArmArchTimerSecIntrNum, SecIntrNum);\r
   ASSERT_RETURN_ERROR (PcdStatus);\r
index 0cae6ec15692b4c412f1568a6a754dcd5fc9b226..24741286975a1fe58bd09c2bd2652c73744bf19c 100644 (file)
@@ -10,7 +10,6 @@
 \r
 **/\r
 \r
-\r
 #include <Base.h>\r
 \r
 #include <Library/BaseLib.h>\r
@@ -19,7 +18,6 @@
 #include <Library/DebugLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
-\r
 /**\r
   Assert the validity of a PCI address. A valid PCI address should contain 1's\r
   only in the low 28 bits.\r
@@ -62,7 +60,7 @@ PciExpressRegisterForRuntimeAccess (
   return RETURN_UNSUPPORTED;\r
 }\r
 \r
-STATIC UINT64 mPciExpressBaseAddress;\r
+STATIC UINT64  mPciExpressBaseAddress;\r
 \r
 RETURN_STATUS\r
 EFIAPI\r
@@ -74,19 +72,18 @@ PciExpressLibInitialize (
   return RETURN_SUCCESS;\r
 }\r
 \r
-\r
 /**\r
   Gets the base address of PCI Express.\r
 \r
   @return The base address of PCI Express.\r
 \r
 **/\r
-VOID*\r
+VOID *\r
 GetPciExpressBaseAddress (\r
   VOID\r
   )\r
 {\r
-  return (VOID*)(UINTN) mPciExpressBaseAddress;\r
+  return (VOID *)(UINTN)mPciExpressBaseAddress;\r
 }\r
 \r
 /**\r
@@ -107,11 +104,11 @@ GetPciExpressBaseAddress (
 UINT8\r
 EFIAPI\r
 PciExpressRead8 (\r
-  IN      UINTN                     Address\r
+  IN      UINTN  Address\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioRead8 ((UINTN) GetPciExpressBaseAddress () + Address);\r
+  return MmioRead8 ((UINTN)GetPciExpressBaseAddress () + Address);\r
 }\r
 \r
 /**\r
@@ -133,12 +130,12 @@ PciExpressRead8 (
 UINT8\r
 EFIAPI\r
 PciExpressWrite8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT8                     Value\r
+  IN      UINTN  Address,\r
+  IN      UINT8  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioWrite8 ((UINTN) GetPciExpressBaseAddress () + Address, Value);\r
+  return MmioWrite8 ((UINTN)GetPciExpressBaseAddress () + Address, Value);\r
 }\r
 \r
 /**\r
@@ -164,12 +161,12 @@ PciExpressWrite8 (
 UINT8\r
 EFIAPI\r
 PciExpressOr8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT8                     OrData\r
+  IN      UINTN  Address,\r
+  IN      UINT8  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioOr8 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);\r
+  return MmioOr8 ((UINTN)GetPciExpressBaseAddress () + Address, OrData);\r
 }\r
 \r
 /**\r
@@ -195,12 +192,12 @@ PciExpressOr8 (
 UINT8\r
 EFIAPI\r
 PciExpressAnd8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT8                     AndData\r
+  IN      UINTN  Address,\r
+  IN      UINT8  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioAnd8 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);\r
+  return MmioAnd8 ((UINTN)GetPciExpressBaseAddress () + Address, AndData);\r
 }\r
 \r
 /**\r
@@ -228,14 +225,14 @@ PciExpressAnd8 (
 UINT8\r
 EFIAPI\r
 PciExpressAndThenOr8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT8                     AndData,\r
-  IN      UINT8                     OrData\r
+  IN      UINTN  Address,\r
+  IN      UINT8  AndData,\r
+  IN      UINT8  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioAndThenOr8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            AndData,\r
            OrData\r
            );\r
@@ -265,14 +262,14 @@ PciExpressAndThenOr8 (
 UINT8\r
 EFIAPI\r
 PciExpressBitFieldRead8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldRead8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit\r
            );\r
@@ -305,15 +302,15 @@ PciExpressBitFieldRead8 (
 UINT8\r
 EFIAPI\r
 PciExpressBitFieldWrite8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     Value\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit,\r
+  IN      UINT8  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldWrite8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            Value\r
@@ -350,15 +347,15 @@ PciExpressBitFieldWrite8 (
 UINT8\r
 EFIAPI\r
 PciExpressBitFieldOr8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     OrData\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit,\r
+  IN      UINT8  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldOr8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            OrData\r
@@ -395,15 +392,15 @@ PciExpressBitFieldOr8 (
 UINT8\r
 EFIAPI\r
 PciExpressBitFieldAnd8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     AndData\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit,\r
+  IN      UINT8  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAnd8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData\r
@@ -444,16 +441,16 @@ PciExpressBitFieldAnd8 (
 UINT8\r
 EFIAPI\r
 PciExpressBitFieldAndThenOr8 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     AndData,\r
-  IN      UINT8                     OrData\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit,\r
+  IN      UINT8  AndData,\r
+  IN      UINT8  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAndThenOr8 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData,\r
@@ -480,11 +477,11 @@ PciExpressBitFieldAndThenOr8 (
 UINT16\r
 EFIAPI\r
 PciExpressRead16 (\r
-  IN      UINTN                     Address\r
+  IN      UINTN  Address\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioRead16 ((UINTN) GetPciExpressBaseAddress () + Address);\r
+  return MmioRead16 ((UINTN)GetPciExpressBaseAddress () + Address);\r
 }\r
 \r
 /**\r
@@ -507,12 +504,12 @@ PciExpressRead16 (
 UINT16\r
 EFIAPI\r
 PciExpressWrite16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT16                    Value\r
+  IN      UINTN   Address,\r
+  IN      UINT16  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioWrite16 ((UINTN) GetPciExpressBaseAddress () + Address, Value);\r
+  return MmioWrite16 ((UINTN)GetPciExpressBaseAddress () + Address, Value);\r
 }\r
 \r
 /**\r
@@ -539,12 +536,12 @@ PciExpressWrite16 (
 UINT16\r
 EFIAPI\r
 PciExpressOr16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT16                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINT16  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioOr16 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);\r
+  return MmioOr16 ((UINTN)GetPciExpressBaseAddress () + Address, OrData);\r
 }\r
 \r
 /**\r
@@ -571,12 +568,12 @@ PciExpressOr16 (
 UINT16\r
 EFIAPI\r
 PciExpressAnd16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT16                    AndData\r
+  IN      UINTN   Address,\r
+  IN      UINT16  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioAnd16 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);\r
+  return MmioAnd16 ((UINTN)GetPciExpressBaseAddress () + Address, AndData);\r
 }\r
 \r
 /**\r
@@ -605,14 +602,14 @@ PciExpressAnd16 (
 UINT16\r
 EFIAPI\r
 PciExpressAndThenOr16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT16                    AndData,\r
-  IN      UINT16                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINT16  AndData,\r
+  IN      UINT16  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioAndThenOr16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            AndData,\r
            OrData\r
            );\r
@@ -643,14 +640,14 @@ PciExpressAndThenOr16 (
 UINT16\r
 EFIAPI\r
 PciExpressBitFieldRead16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldRead16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit\r
            );\r
@@ -684,15 +681,15 @@ PciExpressBitFieldRead16 (
 UINT16\r
 EFIAPI\r
 PciExpressBitFieldWrite16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    Value\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT16  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldWrite16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            Value\r
@@ -730,15 +727,15 @@ PciExpressBitFieldWrite16 (
 UINT16\r
 EFIAPI\r
 PciExpressBitFieldOr16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT16  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldOr16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            OrData\r
@@ -776,15 +773,15 @@ PciExpressBitFieldOr16 (
 UINT16\r
 EFIAPI\r
 PciExpressBitFieldAnd16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    AndData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT16  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAnd16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData\r
@@ -826,16 +823,16 @@ PciExpressBitFieldAnd16 (
 UINT16\r
 EFIAPI\r
 PciExpressBitFieldAndThenOr16 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    AndData,\r
-  IN      UINT16                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT16  AndData,\r
+  IN      UINT16  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAndThenOr16 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData,\r
@@ -862,11 +859,11 @@ PciExpressBitFieldAndThenOr16 (
 UINT32\r
 EFIAPI\r
 PciExpressRead32 (\r
-  IN      UINTN                     Address\r
+  IN      UINTN  Address\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioRead32 ((UINTN) GetPciExpressBaseAddress () + Address);\r
+  return MmioRead32 ((UINTN)GetPciExpressBaseAddress () + Address);\r
 }\r
 \r
 /**\r
@@ -889,12 +886,12 @@ PciExpressRead32 (
 UINT32\r
 EFIAPI\r
 PciExpressWrite32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT32                    Value\r
+  IN      UINTN   Address,\r
+  IN      UINT32  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioWrite32 ((UINTN) GetPciExpressBaseAddress () + Address, Value);\r
+  return MmioWrite32 ((UINTN)GetPciExpressBaseAddress () + Address, Value);\r
 }\r
 \r
 /**\r
@@ -921,12 +918,12 @@ PciExpressWrite32 (
 UINT32\r
 EFIAPI\r
 PciExpressOr32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT32                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINT32  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioOr32 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);\r
+  return MmioOr32 ((UINTN)GetPciExpressBaseAddress () + Address, OrData);\r
 }\r
 \r
 /**\r
@@ -953,12 +950,12 @@ PciExpressOr32 (
 UINT32\r
 EFIAPI\r
 PciExpressAnd32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT32                    AndData\r
+  IN      UINTN   Address,\r
+  IN      UINT32  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
-  return MmioAnd32 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);\r
+  return MmioAnd32 ((UINTN)GetPciExpressBaseAddress () + Address, AndData);\r
 }\r
 \r
 /**\r
@@ -987,14 +984,14 @@ PciExpressAnd32 (
 UINT32\r
 EFIAPI\r
 PciExpressAndThenOr32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINT32                    AndData,\r
-  IN      UINT32                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINT32  AndData,\r
+  IN      UINT32  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioAndThenOr32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            AndData,\r
            OrData\r
            );\r
@@ -1025,14 +1022,14 @@ PciExpressAndThenOr32 (
 UINT32\r
 EFIAPI\r
 PciExpressBitFieldRead32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
+  IN      UINTN  Address,\r
+  IN      UINTN  StartBit,\r
+  IN      UINTN  EndBit\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldRead32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit\r
            );\r
@@ -1066,15 +1063,15 @@ PciExpressBitFieldRead32 (
 UINT32\r
 EFIAPI\r
 PciExpressBitFieldWrite32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    Value\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT32  Value\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldWrite32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            Value\r
@@ -1112,15 +1109,15 @@ PciExpressBitFieldWrite32 (
 UINT32\r
 EFIAPI\r
 PciExpressBitFieldOr32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT32  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldOr32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            OrData\r
@@ -1158,15 +1155,15 @@ PciExpressBitFieldOr32 (
 UINT32\r
 EFIAPI\r
 PciExpressBitFieldAnd32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT32  AndData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAnd32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData\r
@@ -1208,16 +1205,16 @@ PciExpressBitFieldAnd32 (
 UINT32\r
 EFIAPI\r
 PciExpressBitFieldAndThenOr32 (\r
-  IN      UINTN                     Address,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData,\r
-  IN      UINT32                    OrData\r
+  IN      UINTN   Address,\r
+  IN      UINTN   StartBit,\r
+  IN      UINTN   EndBit,\r
+  IN      UINT32  AndData,\r
+  IN      UINT32  OrData\r
   )\r
 {\r
   ASSERT_INVALID_PCI_ADDRESS (Address);\r
   return MmioBitFieldAndThenOr32 (\r
-           (UINTN) GetPciExpressBaseAddress () + Address,\r
+           (UINTN)GetPciExpressBaseAddress () + Address,\r
            StartBit,\r
            EndBit,\r
            AndData,\r
@@ -1251,12 +1248,12 @@ PciExpressBitFieldAndThenOr32 (
 UINTN\r
 EFIAPI\r
 PciExpressReadBuffer (\r
-  IN      UINTN                     StartAddress,\r
-  IN      UINTN                     Size,\r
-  OUT     VOID                      *Buffer\r
+  IN      UINTN  StartAddress,\r
+  IN      UINTN  Size,\r
+  OUT     VOID   *Buffer\r
   )\r
 {\r
-  UINTN   ReturnValue;\r
+  UINTN  ReturnValue;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
@@ -1277,41 +1274,41 @@ PciExpressReadBuffer (
     // Read a byte if StartAddress is byte aligned\r
     //\r
     *(volatile UINT8 *)Buffer = PciExpressRead8 (StartAddress);\r
-    StartAddress += sizeof (UINT8);\r
-    Size -= sizeof (UINT8);\r
-    Buffer = (UINT8*)Buffer + 1;\r
+    StartAddress             += sizeof (UINT8);\r
+    Size                     -= sizeof (UINT8);\r
+    Buffer                    = (UINT8 *)Buffer + 1;\r
   }\r
 \r
-  if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {\r
+  if ((Size >= sizeof (UINT16)) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
-    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));\r
+    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16)PciExpressRead16 (StartAddress));\r
 \r
     StartAddress += sizeof (UINT16);\r
-    Size -= sizeof (UINT16);\r
-    Buffer = (UINT16*)Buffer + 1;\r
+    Size         -= sizeof (UINT16);\r
+    Buffer        = (UINT16 *)Buffer + 1;\r
   }\r
 \r
   while (Size >= sizeof (UINT32)) {\r
     //\r
     // Read as many double words as possible\r
     //\r
-    WriteUnaligned32 ((UINT32 *) Buffer, (UINT32) PciExpressRead32 (StartAddress));\r
+    WriteUnaligned32 ((UINT32 *)Buffer, (UINT32)PciExpressRead32 (StartAddress));\r
 \r
     StartAddress += sizeof (UINT32);\r
-    Size -= sizeof (UINT32);\r
-    Buffer = (UINT32*)Buffer + 1;\r
+    Size         -= sizeof (UINT32);\r
+    Buffer        = (UINT32 *)Buffer + 1;\r
   }\r
 \r
   if (Size >= sizeof (UINT16)) {\r
     //\r
     // Read the last remaining word if exist\r
     //\r
-    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));\r
+    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16)PciExpressRead16 (StartAddress));\r
     StartAddress += sizeof (UINT16);\r
-    Size -= sizeof (UINT16);\r
-    Buffer = (UINT16*)Buffer + 1;\r
+    Size         -= sizeof (UINT16);\r
+    Buffer        = (UINT16 *)Buffer + 1;\r
   }\r
 \r
   if (Size >= sizeof (UINT8)) {\r
@@ -1351,12 +1348,12 @@ PciExpressReadBuffer (
 UINTN\r
 EFIAPI\r
 PciExpressWriteBuffer (\r
-  IN      UINTN                     StartAddress,\r
-  IN      UINTN                     Size,\r
-  IN      VOID                      *Buffer\r
+  IN      UINTN  StartAddress,\r
+  IN      UINTN  Size,\r
+  IN      VOID   *Buffer\r
   )\r
 {\r
-  UINTN                             ReturnValue;\r
+  UINTN  ReturnValue;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
@@ -1376,47 +1373,47 @@ PciExpressWriteBuffer (
     //\r
     // Write a byte if StartAddress is byte aligned\r
     //\r
-    PciExpressWrite8 (StartAddress, *(UINT8*)Buffer);\r
+    PciExpressWrite8 (StartAddress, *(UINT8 *)Buffer);\r
     StartAddress += sizeof (UINT8);\r
-    Size -= sizeof (UINT8);\r
-    Buffer = (UINT8*)Buffer + 1;\r
+    Size         -= sizeof (UINT8);\r
+    Buffer        = (UINT8 *)Buffer + 1;\r
   }\r
 \r
-  if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {\r
+  if ((Size >= sizeof (UINT16)) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Write a word if StartAddress is word aligned\r
     //\r
-    PciExpressWrite16 (StartAddress, ReadUnaligned16 ((UINT16*)Buffer));\r
+    PciExpressWrite16 (StartAddress, ReadUnaligned16 ((UINT16 *)Buffer));\r
     StartAddress += sizeof (UINT16);\r
-    Size -= sizeof (UINT16);\r
-    Buffer = (UINT16*)Buffer + 1;\r
+    Size         -= sizeof (UINT16);\r
+    Buffer        = (UINT16 *)Buffer + 1;\r
   }\r
 \r
   while (Size >= sizeof (UINT32)) {\r
     //\r
     // Write as many double words as possible\r
     //\r
-    PciExpressWrite32 (StartAddress, ReadUnaligned32 ((UINT32*)Buffer));\r
+    PciExpressWrite32 (StartAddress, ReadUnaligned32 ((UINT32 *)Buffer));\r
     StartAddress += sizeof (UINT32);\r
-    Size -= sizeof (UINT32);\r
-    Buffer = (UINT32*)Buffer + 1;\r
+    Size         -= sizeof (UINT32);\r
+    Buffer        = (UINT32 *)Buffer + 1;\r
   }\r
 \r
   if (Size >= sizeof (UINT16)) {\r
     //\r
     // Write the last remaining word if exist\r
     //\r
-    PciExpressWrite16 (StartAddress, ReadUnaligned16 ((UINT16*)Buffer));\r
+    PciExpressWrite16 (StartAddress, ReadUnaligned16 ((UINT16 *)Buffer));\r
     StartAddress += sizeof (UINT16);\r
-    Size -= sizeof (UINT16);\r
-    Buffer = (UINT16*)Buffer + 1;\r
+    Size         -= sizeof (UINT16);\r
+    Buffer        = (UINT16 *)Buffer + 1;\r
   }\r
 \r
   if (Size >= sizeof (UINT8)) {\r
     //\r
     // Write the last remaining byte if exist\r
     //\r
-    PciExpressWrite8 (StartAddress, *(UINT8*)Buffer);\r
+    PciExpressWrite8 (StartAddress, *(UINT8 *)Buffer);\r
   }\r
 \r
   return ReturnValue;\r
index 61c9c47127f8ae890a4dc1a9be3c85511a1fac21..5c01a9997ead616113f34ba89440ee038fcba07d 100644 (file)
@@ -83,6 +83,7 @@ GetSerialConsolePortAddress (
     if (Path == NULL) {\r
       return EFI_NOT_FOUND;\r
     }\r
+\r
     SerialConsoleNode = fdt_path_offset (Fdt, Path);\r
   }\r
 \r
@@ -115,9 +116,9 @@ PlatformHookSerialPortInitialize (
   VOID\r
   )\r
 {\r
-  RETURN_STATUS   Status;\r
-  VOID            *DeviceTreeBase;\r
-  UINT64          SerialConsoleAddress;\r
+  RETURN_STATUS  Status;\r
+  VOID           *DeviceTreeBase;\r
+  UINT64         SerialConsoleAddress;\r
 \r
   if (PcdGet64 (PcdSerialRegisterBase) != 0) {\r
     return RETURN_SUCCESS;\r
index 803725c3ce325f783758f2abee6d2443bde2ba17..6f8caf521c658c7b3f5a4f11565a37a02ddcb107 100644 (file)
@@ -35,8 +35,8 @@ PlatformHookSerialPortInitialize (
   VOID\r
   )\r
 {\r
-  VOID            *Hob;\r
-  UINT64          *UartBase;\r
+  VOID    *Hob;\r
+  UINT64  *UartBase;\r
 \r
   if (PcdGet64 (PcdSerialRegisterBase) != 0) {\r
     return RETURN_SUCCESS;\r
index 3f96b1e45021241180d233c7e3a767bbf1e793e8..c34021243210387bde30aa10851e4d5fb4f95f2a 100644 (file)
@@ -74,7 +74,7 @@ SerialPortGetBaseAddress (
   //\r
   // Enumerate all FDT nodes looking for a PL011 and capture its base address\r
   //\r
-  for (Prev = 0;; Prev = Node) {\r
+  for (Prev = 0; ; Prev = Node) {\r
     Node = fdt_next_node (DeviceTreeBase, Prev, NULL);\r
     if (Node < 0) {\r
       break;\r
@@ -89,11 +89,11 @@ SerialPortGetBaseAddress (
     // Iterate over the NULL-separated items in the compatible string\r
     //\r
     for (CompatibleItem = Compatible; CompatibleItem < Compatible + Len;\r
-      CompatibleItem += 1 + AsciiStrLen (CompatibleItem)) {\r
-\r
+         CompatibleItem += 1 + AsciiStrLen (CompatibleItem))\r
+    {\r
       if (AsciiStrCmp (CompatibleItem, "arm,pl011") == 0) {\r
         NodeStatus = fdt_getprop (DeviceTreeBase, Node, "status", &Len);\r
-        if (NodeStatus != NULL && AsciiStrCmp (NodeStatus, "okay") != 0) {\r
+        if ((NodeStatus != NULL) && (AsciiStrCmp (NodeStatus, "okay") != 0)) {\r
           continue;\r
         }\r
 \r
@@ -101,13 +101,14 @@ SerialPortGetBaseAddress (
         if (Len != 16) {\r
           return 0;\r
         }\r
+\r
         UartBase = (UINTN)fdt64_to_cpu (ReadUnaligned64 (RegProperty));\r
 \r
-        BaudRate = (UINTN)FixedPcdGet64 (PcdUartDefaultBaudRate);\r
+        BaudRate         = (UINTN)FixedPcdGet64 (PcdUartDefaultBaudRate);\r
         ReceiveFifoDepth = 0; // Use the default value for Fifo depth\r
-        Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);\r
-        DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);\r
-        StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);\r
+        Parity           = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);\r
+        DataBits         = FixedPcdGet8 (PcdUartDefaultDataBits);\r
+        StopBits         = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);\r
 \r
         Status = PL011UartInitializePort (\r
                    UartBase,\r
@@ -124,6 +125,7 @@ SerialPortGetBaseAddress (
       }\r
     }\r
   }\r
+\r
   return 0;\r
 }\r
 \r
@@ -140,16 +142,17 @@ SerialPortGetBaseAddress (
 UINTN\r
 EFIAPI\r
 SerialPortWrite (\r
-  IN UINT8     *Buffer,\r
-  IN UINTN     NumberOfBytes\r
+  IN UINT8  *Buffer,\r
+  IN UINTN  NumberOfBytes\r
   )\r
 {\r
-  UINT64 SerialRegisterBase;\r
+  UINT64  SerialRegisterBase;\r
 \r
   SerialRegisterBase = SerialPortGetBaseAddress ();\r
   if (SerialRegisterBase != 0) {\r
     return PL011UartWrite ((UINTN)SerialRegisterBase, Buffer, NumberOfBytes);\r
   }\r
+\r
   return 0;\r
 }\r
 \r
@@ -166,9 +169,9 @@ SerialPortWrite (
 UINTN\r
 EFIAPI\r
 SerialPortRead (\r
-  OUT UINT8     *Buffer,\r
-  IN  UINTN     NumberOfBytes\r
-)\r
+  OUT UINT8  *Buffer,\r
+  IN  UINTN  NumberOfBytes\r
+  )\r
 {\r
   return 0;\r
 }\r
@@ -202,7 +205,7 @@ SerialPortPoll (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortSetControl (\r
-  IN UINT32 Control\r
+  IN UINT32  Control\r
   )\r
 {\r
   return RETURN_UNSUPPORTED;\r
@@ -221,7 +224,7 @@ SerialPortSetControl (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortGetControl (\r
-  OUT UINT32 *Control\r
+  OUT UINT32  *Control\r
   )\r
 {\r
   return RETURN_UNSUPPORTED;\r
@@ -263,14 +266,13 @@ SerialPortGetControl (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortSetAttributes (\r
-  IN OUT UINT64             *BaudRate,\r
-  IN OUT UINT32             *ReceiveFifoDepth,\r
-  IN OUT UINT32             *Timeout,\r
-  IN OUT EFI_PARITY_TYPE    *Parity,\r
-  IN OUT UINT8              *DataBits,\r
-  IN OUT EFI_STOP_BITS_TYPE *StopBits\r
+  IN OUT UINT64              *BaudRate,\r
+  IN OUT UINT32              *ReceiveFifoDepth,\r
+  IN OUT UINT32              *Timeout,\r
+  IN OUT EFI_PARITY_TYPE     *Parity,\r
+  IN OUT UINT8               *DataBits,\r
+  IN OUT EFI_STOP_BITS_TYPE  *StopBits\r
   )\r
 {\r
   return RETURN_UNSUPPORTED;\r
 }\r
-\r
index 23def28e1236ed3655e7ecf94f4c7c879ea503a4..614ea5a860b9c1a340cf818ae16d85731bed020f 100644 (file)
@@ -23,7 +23,7 @@
 #include <Library/HobLib.h>\r
 #include <Guid/EarlyPL011BaseAddress.h>\r
 \r
-STATIC UINTN mSerialBaseAddress;\r
+STATIC UINTN  mSerialBaseAddress;\r
 \r
 RETURN_STATUS\r
 EFIAPI\r
@@ -57,9 +57,10 @@ FdtPL011SerialPortLibInitialize (
   EFI_STOP_BITS_TYPE  StopBits;\r
 \r
   Hob = GetFirstGuidHob (&gEarlyPL011BaseAddressGuid);\r
-  if (Hob == NULL || GET_GUID_HOB_DATA_SIZE (Hob) != sizeof *UartBase) {\r
+  if ((Hob == NULL) || (GET_GUID_HOB_DATA_SIZE (Hob) != sizeof *UartBase)) {\r
     return RETURN_NOT_FOUND;\r
   }\r
+\r
   UartBase = GET_GUID_HOB_DATA (Hob);\r
 \r
   mSerialBaseAddress = (UINTN)*UartBase;\r
@@ -67,11 +68,11 @@ FdtPL011SerialPortLibInitialize (
     return RETURN_NOT_FOUND;\r
   }\r
 \r
-  BaudRate = (UINTN)PcdGet64 (PcdUartDefaultBaudRate);\r
+  BaudRate         = (UINTN)PcdGet64 (PcdUartDefaultBaudRate);\r
   ReceiveFifoDepth = 0; // Use the default value for Fifo depth\r
-  Parity = (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity);\r
-  DataBits = PcdGet8 (PcdUartDefaultDataBits);\r
-  StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits);\r
+  Parity           = (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity);\r
+  DataBits         = PcdGet8 (PcdUartDefaultDataBits);\r
+  StopBits         = (EFI_STOP_BITS_TYPE)PcdGet8 (PcdUartDefaultStopBits);\r
 \r
   return PL011UartInitializePort (\r
            mSerialBaseAddress,\r
@@ -97,13 +98,14 @@ FdtPL011SerialPortLibInitialize (
 UINTN\r
 EFIAPI\r
 SerialPortWrite (\r
-  IN UINT8     *Buffer,\r
-  IN UINTN     NumberOfBytes\r
+  IN UINT8  *Buffer,\r
+  IN UINTN  NumberOfBytes\r
   )\r
 {\r
   if (mSerialBaseAddress != 0) {\r
     return PL011UartWrite (mSerialBaseAddress, Buffer, NumberOfBytes);\r
   }\r
+\r
   return 0;\r
 }\r
 \r
@@ -120,13 +122,14 @@ SerialPortWrite (
 UINTN\r
 EFIAPI\r
 SerialPortRead (\r
-  OUT UINT8     *Buffer,\r
-  IN  UINTN     NumberOfBytes\r
-)\r
+  OUT UINT8  *Buffer,\r
+  IN  UINTN  NumberOfBytes\r
+  )\r
 {\r
   if (mSerialBaseAddress != 0) {\r
     return PL011UartRead (mSerialBaseAddress, Buffer, NumberOfBytes);\r
   }\r
+\r
   return 0;\r
 }\r
 \r
@@ -146,6 +149,7 @@ SerialPortPoll (
   if (mSerialBaseAddress != 0) {\r
     return PL011UartPoll (mSerialBaseAddress);\r
   }\r
+\r
   return FALSE;\r
 }\r
 \r
@@ -185,15 +189,15 @@ SerialPortPoll (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortSetAttributes (\r
-  IN OUT UINT64             *BaudRate,\r
-  IN OUT UINT32             *ReceiveFifoDepth,\r
-  IN OUT UINT32             *Timeout,\r
-  IN OUT EFI_PARITY_TYPE    *Parity,\r
-  IN OUT UINT8              *DataBits,\r
-  IN OUT EFI_STOP_BITS_TYPE *StopBits\r
+  IN OUT UINT64              *BaudRate,\r
+  IN OUT UINT32              *ReceiveFifoDepth,\r
+  IN OUT UINT32              *Timeout,\r
+  IN OUT EFI_PARITY_TYPE     *Parity,\r
+  IN OUT UINT8               *DataBits,\r
+  IN OUT EFI_STOP_BITS_TYPE  *StopBits\r
   )\r
 {\r
-  RETURN_STATUS Status;\r
+  RETURN_STATUS  Status;\r
 \r
   if (mSerialBaseAddress == 0) {\r
     Status = RETURN_UNSUPPORTED;\r
@@ -225,10 +229,10 @@ SerialPortSetAttributes (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortSetControl (\r
-  IN UINT32 Control\r
+  IN UINT32  Control\r
   )\r
 {\r
-  RETURN_STATUS Status;\r
+  RETURN_STATUS  Status;\r
 \r
   if (mSerialBaseAddress == 0) {\r
     Status = RETURN_UNSUPPORTED;\r
@@ -252,10 +256,10 @@ SerialPortSetControl (
 RETURN_STATUS\r
 EFIAPI\r
 SerialPortGetControl (\r
-  OUT UINT32 *Control\r
+  OUT UINT32  *Control\r
   )\r
 {\r
-  RETURN_STATUS Status;\r
+  RETURN_STATUS  Status;\r
 \r
   if (mSerialBaseAddress == 0) {\r
     Status = RETURN_UNSUPPORTED;\r
@@ -265,4 +269,3 @@ SerialPortGetControl (
 \r
   return Status;\r
 }\r
-\r
index 255eb0599e4ad73874282eef8422e0b0d8eab2ac..30e43beb9af8d4b4e8a9b1ebf0021e19edf6c2ac 100644 (file)
@@ -38,15 +38,15 @@ PlatformPeim (
   UINT64  *FdtHobData;\r
   UINT64  *UartHobData;\r
 \r
-  Base = (VOID*)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
+  Base = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
   if ((Base == NULL) || (fdt_check_header (Base) != 0)) {\r
     ASSERT (0);\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  FdtSize = fdt_totalsize (Base) + PcdGet32 (PcdDeviceTreeAllocationPadding);\r
+  FdtSize  = fdt_totalsize (Base) + PcdGet32 (PcdDeviceTreeAllocationPadding);\r
   FdtPages = EFI_SIZE_TO_PAGES (FdtSize);\r
-  NewBase = AllocatePages (FdtPages);\r
+  NewBase  = AllocatePages (FdtPages);\r
   if (NewBase == NULL) {\r
     ASSERT (0);\r
     return EFI_OUT_OF_RESOURCES;\r
index 93715958952f933007ff143a22cbe81606cc539e..89eee757d141caed6f5f91c0f5f76189277c93aa 100644 (file)
 \r
 /** RTC Index register is at offset 0x0\r
 */\r
-#define RTC_INDEX_REG_OFFSET    0x0ULL\r
+#define RTC_INDEX_REG_OFFSET  0x0ULL\r
 \r
 /** RTC Target register is at offset 0x1\r
 */\r
-#define RTC_TARGET_REG_OFFSET   0x1ULL\r
+#define RTC_TARGET_REG_OFFSET  0x1ULL\r
 \r
 /** Add the RTC controller address range to the memory map.\r
 \r
@@ -34,8 +34,8 @@
 STATIC\r
 EFI_STATUS\r
 KvmtoolRtcMapMemory (\r
-  IN EFI_HANDLE               ImageHandle,\r
-  IN EFI_PHYSICAL_ADDRESS     RtcPageBase\r
+  IN EFI_HANDLE            ImageHandle,\r
+  IN EFI_PHYSICAL_ADDRESS  RtcPageBase\r
   )\r
 {\r
   EFI_STATUS  Status;\r
@@ -48,7 +48,8 @@ KvmtoolRtcMapMemory (
                   );\r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((\r
-      DEBUG_ERROR, "Failed to add memory space. Status = %r\n",\r
+      DEBUG_ERROR,\r
+      "Failed to add memory space. Status = %r\n",\r
       Status\r
       ));\r
     return Status;\r
@@ -117,18 +118,18 @@ KvmtoolRtcMapMemory (
 EFI_STATUS\r
 EFIAPI\r
 KvmtoolRtcFdtClientLibConstructor (\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
-  FDT_CLIENT_PROTOCOL   *FdtClient;\r
-  INT32                 Node;\r
-  CONST UINT32          *Reg;\r
-  UINT32                RegSize;\r
-  UINT64                RegBase;\r
-  UINT64                Range;\r
-  RETURN_STATUS         PcdStatus;\r
+  EFI_STATUS           Status;\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  INT32                Node;\r
+  CONST UINT32         *Reg;\r
+  UINT32               RegSize;\r
+  UINT64               RegBase;\r
+  UINT64               Range;\r
+  RETURN_STATUS        PcdStatus;\r
 \r
   Status = gBS->LocateProtocol (\r
                   &gFdtClientProtocolGuid,\r
@@ -170,7 +171,7 @@ KvmtoolRtcFdtClientLibConstructor (
   ASSERT (RegSize == 16);\r
 \r
   RegBase = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[0]));\r
-  Range = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2]));\r
+  Range   = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2]));\r
   DEBUG ((\r
     DEBUG_INFO,\r
     "Found motorola,mc146818 RTC @ 0x%Lx Range = 0x%x\n",\r
index 63bb81ef91ce0d16b604f5606a6a340647b706ad..29122856b6e8c474ce4c1a1256415456dece85a9 100644 (file)
@@ -15,7 +15,7 @@
 #include <Library/MemoryAllocationLib.h>\r
 \r
 // Number of Virtual Memory Map Descriptors\r
-#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS          5\r
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS  5\r
 \r
 /**\r
   Return the Virtual Memory Map of your platform\r
 **/\r
 VOID\r
 ArmVirtGetMemoryMap (\r
-  OUT ARM_MEMORY_REGION_DESCRIPTOR   **VirtualMemoryMap\r
+  OUT ARM_MEMORY_REGION_DESCRIPTOR  **VirtualMemoryMap\r
   )\r
 {\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
-  UINTN                          Idx;\r
-  EFI_PHYSICAL_ADDRESS           TopOfAddressSpace;\r
+  UINTN                         Idx;\r
+  EFI_PHYSICAL_ADDRESS          TopOfAddressSpace;\r
 \r
   ASSERT (VirtualMemoryMap != NULL);\r
 \r
   TopOfAddressSpace = LShiftU64 (1ULL, ArmGetPhysicalAddressBits ());\r
 \r
-  VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR*)\r
-                        AllocatePages (\r
-                          EFI_SIZE_TO_PAGES (\r
-                            sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *\r
-                            MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS\r
-                            )\r
-                          );\r
+  VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR *)\r
+                       AllocatePages (\r
+                         EFI_SIZE_TO_PAGES (\r
+                           sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *\r
+                           MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS\r
+                           )\r
+                         );\r
   if (VirtualMemoryTable == NULL) {\r
     DEBUG ((\r
       DEBUG_ERROR,\r
@@ -75,24 +75,24 @@ ArmVirtGetMemoryMap (
   // Peripheral space after DRAM\r
   VirtualMemoryTable[++Idx].PhysicalBase = PcdGet64 (PcdSystemMemoryBase) +\r
                                            PcdGet64 (PcdSystemMemorySize);\r
-  VirtualMemoryTable[Idx].VirtualBase    = VirtualMemoryTable[Idx].PhysicalBase;\r
-  VirtualMemoryTable[Idx].Length         = TopOfAddressSpace -\r
-                                           VirtualMemoryTable[Idx].PhysicalBase;\r
-  VirtualMemoryTable[Idx].Attributes     = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
+  VirtualMemoryTable[Idx].VirtualBase = VirtualMemoryTable[Idx].PhysicalBase;\r
+  VirtualMemoryTable[Idx].Length      = TopOfAddressSpace -\r
+                                        VirtualMemoryTable[Idx].PhysicalBase;\r
+  VirtualMemoryTable[Idx].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
 \r
   // Map the FV region as normal executable memory\r
   VirtualMemoryTable[++Idx].PhysicalBase = PcdGet64 (PcdFvBaseAddress);\r
-  VirtualMemoryTable[Idx].VirtualBase  = VirtualMemoryTable[Idx].PhysicalBase;\r
-  VirtualMemoryTable[Idx].Length       = FixedPcdGet32 (PcdFvSize);\r
-  VirtualMemoryTable[Idx].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;\r
+  VirtualMemoryTable[Idx].VirtualBase    = VirtualMemoryTable[Idx].PhysicalBase;\r
+  VirtualMemoryTable[Idx].Length         = FixedPcdGet32 (PcdFvSize);\r
+  VirtualMemoryTable[Idx].Attributes     = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;\r
 \r
   // End of Table\r
-  VirtualMemoryTable[++Idx].PhysicalBase  = 0;\r
-  VirtualMemoryTable[Idx].VirtualBase     = 0;\r
-  VirtualMemoryTable[Idx].Length          = 0;\r
-  VirtualMemoryTable[Idx].Attributes      = (ARM_MEMORY_REGION_ATTRIBUTES)0;\r
+  VirtualMemoryTable[++Idx].PhysicalBase = 0;\r
+  VirtualMemoryTable[Idx].VirtualBase    = 0;\r
+  VirtualMemoryTable[Idx].Length         = 0;\r
+  VirtualMemoryTable[Idx].Attributes     = (ARM_MEMORY_REGION_ATTRIBUTES)0;\r
 \r
-  ASSERT((Idx + 1) <= MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);\r
+  ASSERT ((Idx + 1) <= MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);\r
 \r
   *VirtualMemoryMap = VirtualMemoryTable;\r
 }\r
index 7a1bef12e8ec90c1d94e42fb5cd70103e987867c..39d2615b54091837890485c5022b19c8a0f85abe 100644 (file)
 \r
 /** Macro defining the maximum number of Flash devices.\r
 */\r
-#define MAX_FLASH_DEVICES       4\r
+#define MAX_FLASH_DEVICES  4\r
 \r
 /** Macro defining the cfi-flash label describing the UEFI variable store.\r
 */\r
-#define LABEL_UEFI_VAR_STORE    "System-firmware"\r
+#define LABEL_UEFI_VAR_STORE  "System-firmware"\r
 \r
 STATIC NOR_FLASH_DESCRIPTION  mNorFlashDevices[MAX_FLASH_DEVICES];\r
 STATIC UINTN                  mNorFlashDeviceCount = 0;\r
-STATIC INT32                  mUefiVarStoreNode = MAX_INT32;\r
+STATIC INT32                  mUefiVarStoreNode    = MAX_INT32;\r
 STATIC FDT_CLIENT_PROTOCOL    *mFdtClient;\r
 \r
 /** This function performs platform specific actions to initialise\r
@@ -40,7 +40,7 @@ NorFlashPlatformInitialization (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                  Status;\r
+  EFI_STATUS  Status;\r
 \r
   DEBUG ((DEBUG_INFO, "NorFlashPlatformInitialization\n"));\r
 \r
@@ -89,24 +89,25 @@ NorFlashPlatformInitialization (
 STATIC\r
 EFI_STATUS\r
 SetupVariableStore (\r
-  IN NOR_FLASH_DESCRIPTION FlashDevice\r
+  IN NOR_FLASH_DESCRIPTION  *FlashDevice\r
   )\r
 {\r
-  UINTN   FlashRegion;\r
-  UINTN   FlashNvStorageVariableBase;\r
-  UINTN   FlashNvStorageFtwWorkingBase;\r
-  UINTN   FlashNvStorageFtwSpareBase;\r
-  UINTN   FlashNvStorageVariableSize;\r
-  UINTN   FlashNvStorageFtwWorkingSize;\r
-  UINTN   FlashNvStorageFtwSpareSize;\r
-\r
-  FlashNvStorageVariableSize = PcdGet32 (PcdFlashNvStorageVariableSize);\r
+  UINTN  FlashRegion;\r
+  UINTN  FlashNvStorageVariableBase;\r
+  UINTN  FlashNvStorageFtwWorkingBase;\r
+  UINTN  FlashNvStorageFtwSpareBase;\r
+  UINTN  FlashNvStorageVariableSize;\r
+  UINTN  FlashNvStorageFtwWorkingSize;\r
+  UINTN  FlashNvStorageFtwSpareSize;\r
+\r
+  FlashNvStorageVariableSize   = PcdGet32 (PcdFlashNvStorageVariableSize);\r
   FlashNvStorageFtwWorkingSize = PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
-  FlashNvStorageFtwSpareSize =  PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
+  FlashNvStorageFtwSpareSize   =  PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
 \r
   if ((FlashNvStorageVariableSize == 0)   ||\r
       (FlashNvStorageFtwWorkingSize == 0) ||\r
-      (FlashNvStorageFtwSpareSize == 0)) {\r
+      (FlashNvStorageFtwSpareSize == 0))\r
+  {\r
     DEBUG ((DEBUG_ERROR, "FlashNvStorage size not defined\n"));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -115,13 +116,13 @@ SetupVariableStore (
   FlashRegion = FlashDevice->DeviceBaseAddress;\r
 \r
   FlashNvStorageVariableBase = FlashRegion;\r
-  FlashRegion += PcdGet32 (PcdFlashNvStorageVariableSize);\r
+  FlashRegion               += PcdGet32 (PcdFlashNvStorageVariableSize);\r
 \r
   FlashNvStorageFtwWorkingBase = FlashRegion;\r
-  FlashRegion += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
+  FlashRegion                 += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
 \r
   FlashNvStorageFtwSpareBase = FlashRegion;\r
-  FlashRegion += PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
+  FlashRegion               += PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
 \r
   if (FlashRegion > (FlashDevice->DeviceBaseAddress + FlashDevice->Size)) {\r
     DEBUG ((DEBUG_ERROR, "Insufficient flash storage size\n"));\r
@@ -187,15 +188,16 @@ SetupVariableStore (
 **/\r
 EFI_STATUS\r
 NorFlashPlatformGetDevices (\r
-  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,\r
-  OUT UINT32                  *Count\r
+  OUT NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,\r
+  OUT UINT32                 *Count\r
   )\r
 {\r
   if (mNorFlashDeviceCount > 0) {\r
     *NorFlashDescriptions = mNorFlashDevices;\r
-    *Count = mNorFlashDeviceCount;\r
+    *Count                = mNorFlashDeviceCount;\r
     return EFI_SUCCESS;\r
   }\r
+\r
   return EFI_NOT_FOUND;\r
 }\r
 \r
@@ -211,20 +213,20 @@ NorFlashPlatformGetDevices (
 EFI_STATUS\r
 EFIAPI\r
 NorFlashPlatformLibConstructor (\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
-  INT32                       Node;\r
-  EFI_STATUS                  Status;\r
-  EFI_STATUS                  FindNodeStatus;\r
-  CONST UINT32                *Reg;\r
-  UINT32                      PropSize;\r
-  UINT64                      Base;\r
-  UINT64                      Size;\r
-  UINTN                       UefiVarStoreIndex;\r
-  CONST CHAR8                 *Label;\r
-  UINT32                      LabelLen;\r
+  INT32         Node;\r
+  EFI_STATUS    Status;\r
+  EFI_STATUS    FindNodeStatus;\r
+  CONST UINT32  *Reg;\r
+  UINT32        PropSize;\r
+  UINT64        Base;\r
+  UINT64        Size;\r
+  UINTN         UefiVarStoreIndex;\r
+  CONST CHAR8   *Label;\r
+  UINT32        LabelLen;\r
 \r
   if (mNorFlashDeviceCount != 0) {\r
     return EFI_SUCCESS;\r
@@ -244,13 +246,14 @@ NorFlashPlatformLibConstructor (
                                       &Node\r
                                       );\r
        !EFI_ERROR (FindNodeStatus) &&\r
-         (mNorFlashDeviceCount < MAX_FLASH_DEVICES);\r
+       (mNorFlashDeviceCount < MAX_FLASH_DEVICES);\r
        FindNodeStatus = mFdtClient->FindNextCompatibleNode (\r
                                       mFdtClient,\r
                                       "cfi-flash",\r
                                       Node,\r
                                       &Node\r
-    )) {\r
+                                      ))\r
+  {\r
     Status = mFdtClient->GetNodeProperty (\r
                            mFdtClient,\r
                            Node,\r
@@ -278,15 +281,20 @@ NorFlashPlatformLibConstructor (
                            &PropSize\r
                            );\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",\r
-        __FUNCTION__, Status));\r
+      DEBUG ((\r
+        DEBUG_ERROR,\r
+        "%a: GetNodeProperty () failed (Status == %r)\n",\r
+        __FUNCTION__,\r
+        Status\r
+        ));\r
       continue;\r
     }\r
 \r
     ASSERT ((PropSize % (4 * sizeof (UINT32))) == 0);\r
 \r
     while ((PropSize >= (4 * sizeof (UINT32))) &&\r
-           (mNorFlashDeviceCount < MAX_FLASH_DEVICES)) {\r
+           (mNorFlashDeviceCount < MAX_FLASH_DEVICES))\r
+    {\r
       Base = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[0]));\r
       Size = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2]));\r
       Reg += 4;\r
@@ -298,7 +306,8 @@ NorFlashPlatformLibConstructor (
       // The firmware is not updatable from inside the guest anyway.\r
       //\r
       if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) &&\r
-          (Base + Size) > PcdGet64 (PcdFvBaseAddress)) {\r
+          ((Base + Size) > PcdGet64 (PcdFvBaseAddress)))\r
+      {\r
         continue;\r
       }\r
 \r
@@ -312,8 +321,8 @@ NorFlashPlatformLibConstructor (
 \r
       mNorFlashDevices[mNorFlashDeviceCount].DeviceBaseAddress = (UINTN)Base;\r
       mNorFlashDevices[mNorFlashDeviceCount].RegionBaseAddress = (UINTN)Base;\r
-      mNorFlashDevices[mNorFlashDeviceCount].Size = (UINTN)Size;\r
-      mNorFlashDevices[mNorFlashDeviceCount].BlockSize = KVMTOOL_NOR_BLOCK_SIZE;\r
+      mNorFlashDevices[mNorFlashDeviceCount].Size              = (UINTN)Size;\r
+      mNorFlashDevices[mNorFlashDeviceCount].BlockSize         = KVMTOOL_NOR_BLOCK_SIZE;\r
       mNorFlashDeviceCount++;\r
     }\r
   } // for\r
@@ -326,6 +335,7 @@ NorFlashPlatformLibConstructor (
       UefiVarStoreIndex = mNorFlashDeviceCount - 1;\r
       mUefiVarStoreNode = Node;\r
     }\r
+\r
     if (mNorFlashDevices[UefiVarStoreIndex].DeviceBaseAddress != 0) {\r
       return SetupVariableStore (&mNorFlashDevices[UefiVarStoreIndex]);\r
     }\r
index 271d7f0efbc09e9848608b6fc3de55d600c905cb..2b39f021d0aec8a94ab5ebe63a0ebaef877160c0 100644 (file)
@@ -13,9 +13,9 @@
 \r
 #include <Protocol/FdtClient.h>\r
 \r
-#define QEMU_NOR_BLOCK_SIZE    SIZE_256KB\r
+#define QEMU_NOR_BLOCK_SIZE  SIZE_256KB\r
 \r
-#define MAX_FLASH_BANKS        4\r
+#define MAX_FLASH_BANKS  4\r
 \r
 EFI_STATUS\r
 NorFlashPlatformInitialization (\r
@@ -25,40 +25,59 @@ NorFlashPlatformInitialization (
   return EFI_SUCCESS;\r
 }\r
 \r
-NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];\r
+NOR_FLASH_DESCRIPTION  mNorFlashDevices[MAX_FLASH_BANKS];\r
 \r
 EFI_STATUS\r
 NorFlashPlatformGetDevices (\r
-  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,\r
-  OUT UINT32                  *Count\r
+  OUT NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,\r
+  OUT UINT32                 *Count\r
   )\r
 {\r
-  FDT_CLIENT_PROTOCOL         *FdtClient;\r
-  INT32                       Node;\r
-  EFI_STATUS                  Status;\r
-  EFI_STATUS                  FindNodeStatus;\r
-  CONST UINT32                *Reg;\r
-  UINT32                      PropSize;\r
-  UINT32                      Num;\r
-  UINT64                      Base;\r
-  UINT64                      Size;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  INT32                Node;\r
+  EFI_STATUS           Status;\r
+  EFI_STATUS           FindNodeStatus;\r
+  CONST UINT32         *Reg;\r
+  UINT32               PropSize;\r
+  UINT32               Num;\r
+  UINT64               Base;\r
+  UINT64               Size;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   Num = 0;\r
-  for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,\r
-                                     "cfi-flash", &Node);\r
+  for (FindNodeStatus = FdtClient->FindCompatibleNode (\r
+                                     FdtClient,\r
+                                     "cfi-flash",\r
+                                     &Node\r
+                                     );\r
        !EFI_ERROR (FindNodeStatus) && Num < MAX_FLASH_BANKS;\r
-       FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,\r
-                                     "cfi-flash", Node, &Node)) {\r
-\r
-    Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",\r
-                          (CONST VOID **)&Reg, &PropSize);\r
+       FindNodeStatus = FdtClient->FindNextCompatibleNode (\r
+                                     FdtClient,\r
+                                     "cfi-flash",\r
+                                     Node,\r
+                                     &Node\r
+                                     ))\r
+  {\r
+    Status = FdtClient->GetNodeProperty (\r
+                          FdtClient,\r
+                          Node,\r
+                          "reg",\r
+                          (CONST VOID **)&Reg,\r
+                          &PropSize\r
+                          );\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",\r
-        __FUNCTION__, Status));\r
+      DEBUG ((\r
+        DEBUG_ERROR,\r
+        "%a: GetNodeProperty () failed (Status == %r)\n",\r
+        __FUNCTION__,\r
+        Status\r
+        ));\r
       continue;\r
     }\r
 \r
@@ -76,7 +95,8 @@ NorFlashPlatformGetDevices (
       // The firmware is not updatable from inside the guest anyway.\r
       //\r
       if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) &&\r
-          (Base + Size) > PcdGet64 (PcdFvBaseAddress)) {\r
+          ((Base + Size) > PcdGet64 (PcdFvBaseAddress)))\r
+      {\r
         continue;\r
       }\r
 \r
@@ -97,15 +117,20 @@ NorFlashPlatformGetDevices (
     // code, which is not intended to be guest updatable, and is usually backed\r
     // in a readonly manner by QEMU anyway.\r
     //\r
-    Status = FdtClient->SetNodeProperty (FdtClient, Node, "status",\r
-                          "disabled", sizeof ("disabled"));\r
+    Status = FdtClient->SetNodeProperty (\r
+                          FdtClient,\r
+                          Node,\r
+                          "status",\r
+                          "disabled",\r
+                          sizeof ("disabled")\r
+                          );\r
     if (EFI_ERROR (Status)) {\r
       DEBUG ((DEBUG_WARN, "Failed to set NOR flash status to 'disabled'\n"));\r
     }\r
   }\r
 \r
   *NorFlashDescriptions = mNorFlashDevices;\r
-  *Count = Num;\r
+  *Count                = Num;\r
 \r
   return EFI_SUCCESS;\r
 }\r
index 02d6c87050602fd8288cee4f07409392d3bd60a2..3ad1ecd9d2862ab8c7bba45f8315b87a70e9bcf8 100644 (file)
 \r
 #include "PlatformBm.h"\r
 \r
-#define DP_NODE_LEN(Type) { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) }\r
-\r
+#define DP_NODE_LEN(Type)  { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 8) }\r
 \r
 #pragma pack (1)\r
 typedef struct {\r
-  VENDOR_DEVICE_PATH         SerialDxe;\r
-  UART_DEVICE_PATH           Uart;\r
-  VENDOR_DEFINED_DEVICE_PATH TermType;\r
-  EFI_DEVICE_PATH_PROTOCOL   End;\r
+  VENDOR_DEVICE_PATH            SerialDxe;\r
+  UART_DEVICE_PATH              Uart;\r
+  VENDOR_DEFINED_DEVICE_PATH    TermType;\r
+  EFI_DEVICE_PATH_PROTOCOL      End;\r
 } PLATFORM_SERIAL_CONSOLE;\r
 #pragma pack ()\r
 \r
-STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {\r
+STATIC PLATFORM_SERIAL_CONSOLE  mSerialConsole = {\r
   //\r
   // VENDOR_DEVICE_PATH SerialDxe\r
   //\r
   {\r
-    { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, DP_NODE_LEN (VENDOR_DEVICE_PATH) },\r
+    { HARDWARE_DEVICE_PATH,  HW_VENDOR_DP, DP_NODE_LEN (VENDOR_DEVICE_PATH) },\r
     EDKII_SERIAL_PORT_LIB_VENDOR_GUID\r
   },\r
 \r
@@ -57,7 +56,7 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
   // UART_DEVICE_PATH Uart\r
   //\r
   {\r
-    { MESSAGING_DEVICE_PATH, MSG_UART_DP, DP_NODE_LEN (UART_DEVICE_PATH) },\r
+    { MESSAGING_DEVICE_PATH, MSG_UART_DP,  DP_NODE_LEN (UART_DEVICE_PATH)   },\r
     0,                                      // Reserved\r
     FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate\r
     FixedPcdGet8 (PcdUartDefaultDataBits),  // DataBits\r
@@ -87,15 +86,14 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
   }\r
 };\r
 \r
-\r
 #pragma pack (1)\r
 typedef struct {\r
-  USB_CLASS_DEVICE_PATH    Keyboard;\r
-  EFI_DEVICE_PATH_PROTOCOL End;\r
+  USB_CLASS_DEVICE_PATH       Keyboard;\r
+  EFI_DEVICE_PATH_PROTOCOL    End;\r
 } PLATFORM_USB_KEYBOARD;\r
 #pragma pack ()\r
 \r
-STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {\r
+STATIC PLATFORM_USB_KEYBOARD  mUsbKeyboard = {\r
   //\r
   // USB_CLASS_DEVICE_PATH Keyboard\r
   //\r
@@ -120,7 +118,6 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
   }\r
 };\r
 \r
-\r
 /**\r
   Check if the handle satisfies a particular condition.\r
 \r
@@ -134,12 +131,11 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
 **/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *FILTER_FUNCTION) (\r
+(EFIAPI *FILTER_FUNCTION)(\r
   IN EFI_HANDLE   Handle,\r
   IN CONST CHAR16 *ReportText\r
   );\r
 \r
-\r
 /**\r
   Process a handle.\r
 \r
@@ -149,7 +145,7 @@ BOOLEAN
 **/\r
 typedef\r
 VOID\r
-(EFIAPI *CALLBACK_FUNCTION)  (\r
+(EFIAPI *CALLBACK_FUNCTION)(\r
   IN EFI_HANDLE   Handle,\r
   IN CONST CHAR16 *ReportText\r
   );\r
@@ -170,31 +166,41 @@ VOID
 STATIC\r
 VOID\r
 FilterAndProcess (\r
-  IN EFI_GUID          *ProtocolGuid,\r
-  IN FILTER_FUNCTION   Filter         OPTIONAL,\r
-  IN CALLBACK_FUNCTION Process\r
+  IN EFI_GUID           *ProtocolGuid,\r
+  IN FILTER_FUNCTION    Filter         OPTIONAL,\r
+  IN CALLBACK_FUNCTION  Process\r
   )\r
 {\r
-  EFI_STATUS Status;\r
-  EFI_HANDLE *Handles;\r
-  UINTN      NoHandles;\r
-  UINTN      Idx;\r
-\r
-  Status = gBS->LocateHandleBuffer (ByProtocol, ProtocolGuid,\r
-                  NULL /* SearchKey */, &NoHandles, &Handles);\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  *Handles;\r
+  UINTN       NoHandles;\r
+  UINTN       Idx;\r
+\r
+  Status = gBS->LocateHandleBuffer (\r
+                  ByProtocol,\r
+                  ProtocolGuid,\r
+                  NULL /* SearchKey */,\r
+                  &NoHandles,\r
+                  &Handles\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     //\r
     // This is not an error, just an informative condition.\r
     //\r
-    DEBUG ((DEBUG_VERBOSE, "%a: %g: %r\n", __FUNCTION__, ProtocolGuid,\r
-      Status));\r
+    DEBUG ((\r
+      DEBUG_VERBOSE,\r
+      "%a: %g: %r\n",\r
+      __FUNCTION__,\r
+      ProtocolGuid,\r
+      Status\r
+      ));\r
     return;\r
   }\r
 \r
   ASSERT (NoHandles > 0);\r
   for (Idx = 0; Idx < NoHandles; ++Idx) {\r
-    CHAR16        *DevicePathText;\r
-    STATIC CHAR16 Fallback[] = L"<device path unavailable>";\r
+    CHAR16         *DevicePathText;\r
+    STATIC CHAR16  Fallback[] = L"<device path unavailable>";\r
 \r
     //\r
     // The ConvertDevicePathToText() function handles NULL input transparently.\r
@@ -208,7 +214,7 @@ FilterAndProcess (
       DevicePathText = Fallback;\r
     }\r
 \r
-    if (Filter == NULL || Filter (Handles[Idx], DevicePathText)) {\r
+    if ((Filter == NULL) || Filter (Handles[Idx], DevicePathText)) {\r
       Process (Handles[Idx], DevicePathText);\r
     }\r
 \r
@@ -216,10 +222,10 @@ FilterAndProcess (
       FreePool (DevicePathText);\r
     }\r
   }\r
+\r
   gBS->FreePool (Handles);\r
 }\r
 \r
-\r
 /**\r
   This FILTER_FUNCTION checks if a handle corresponds to a PCI display device.\r
 **/\r
@@ -227,16 +233,19 @@ STATIC
 BOOLEAN\r
 EFIAPI\r
 IsPciDisplay (\r
-  IN EFI_HANDLE   Handle,\r
-  IN CONST CHAR16 *ReportText\r
+  IN EFI_HANDLE    Handle,\r
+  IN CONST CHAR16  *ReportText\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
-  EFI_PCI_IO_PROTOCOL *PciIo;\r
-  PCI_TYPE00          Pci;\r
+  EFI_STATUS           Status;\r
+  EFI_PCI_IO_PROTOCOL  *PciIo;\r
+  PCI_TYPE00           Pci;\r
 \r
-  Status = gBS->HandleProtocol (Handle, &gEfiPciIoProtocolGuid,\r
-                  (VOID**)&PciIo);\r
+  Status = gBS->HandleProtocol (\r
+                  Handle,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **)&PciIo\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     //\r
     // This is not an error worth reporting.\r
@@ -244,8 +253,13 @@ IsPciDisplay (
     return FALSE;\r
   }\r
 \r
-  Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0 /* Offset */,\r
-                        sizeof Pci / sizeof (UINT32), &Pci);\r
+  Status = PciIo->Pci.Read (\r
+                        PciIo,\r
+                        EfiPciIoWidthUint32,\r
+                        0 /* Offset */,\r
+                        sizeof Pci / sizeof (UINT32),\r
+                        &Pci\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));\r
     return FALSE;\r
@@ -254,7 +268,6 @@ IsPciDisplay (
   return IS_PCI_DISPLAY (&Pci);\r
 }\r
 \r
-\r
 /**\r
   This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at\r
   the VIRTIO_DEVICE_PROTOCOL level.\r
@@ -263,23 +276,26 @@ STATIC
 BOOLEAN\r
 EFIAPI\r
 IsVirtioRng (\r
-  IN EFI_HANDLE   Handle,\r
-  IN CONST CHAR16 *ReportText\r
+  IN EFI_HANDLE    Handle,\r
+  IN CONST CHAR16  *ReportText\r
   )\r
 {\r
-  EFI_STATUS             Status;\r
-  VIRTIO_DEVICE_PROTOCOL *VirtIo;\r
+  EFI_STATUS              Status;\r
+  VIRTIO_DEVICE_PROTOCOL  *VirtIo;\r
 \r
-  Status = gBS->HandleProtocol (Handle, &gVirtioDeviceProtocolGuid,\r
-                  (VOID**)&VirtIo);\r
+  Status = gBS->HandleProtocol (\r
+                  Handle,\r
+                  &gVirtioDeviceProtocolGuid,\r
+                  (VOID **)&VirtIo\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     return FALSE;\r
   }\r
+\r
   return (BOOLEAN)(VirtIo->SubSystemDeviceId ==\r
                    VIRTIO_SUBSYSTEM_ENTROPY_SOURCE);\r
 }\r
 \r
-\r
 /**\r
   This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at\r
   the EFI_PCI_IO_PROTOCOL level.\r
@@ -288,20 +304,23 @@ STATIC
 BOOLEAN\r
 EFIAPI\r
 IsVirtioPciRng (\r
-  IN EFI_HANDLE   Handle,\r
-  IN CONST CHAR16 *ReportText\r
+  IN EFI_HANDLE    Handle,\r
+  IN CONST CHAR16  *ReportText\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
-  EFI_PCI_IO_PROTOCOL *PciIo;\r
-  UINT16              VendorId;\r
-  UINT16              DeviceId;\r
-  UINT8               RevisionId;\r
-  BOOLEAN             Virtio10;\r
-  UINT16              SubsystemId;\r
-\r
-  Status = gBS->HandleProtocol (Handle, &gEfiPciIoProtocolGuid,\r
-                  (VOID**)&PciIo);\r
+  EFI_STATUS           Status;\r
+  EFI_PCI_IO_PROTOCOL  *PciIo;\r
+  UINT16               VendorId;\r
+  UINT16               DeviceId;\r
+  UINT8                RevisionId;\r
+  BOOLEAN              Virtio10;\r
+  UINT16               SubsystemId;\r
+\r
+  Status = gBS->HandleProtocol (\r
+                  Handle,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **)&PciIo\r
+                  );\r
   if (EFI_ERROR (Status)) {\r
     return FALSE;\r
   }\r
@@ -309,11 +328,17 @@ IsVirtioPciRng (
   //\r
   // Read and check VendorId.\r
   //\r
-  Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, PCI_VENDOR_ID_OFFSET,\r
-                        1, &VendorId);\r
+  Status = PciIo->Pci.Read (\r
+                        PciIo,\r
+                        EfiPciIoWidthUint16,\r
+                        PCI_VENDOR_ID_OFFSET,\r
+                        1,\r
+                        &VendorId\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     goto PciError;\r
   }\r
+\r
   if (VendorId != VIRTIO_VENDOR_ID) {\r
     return FALSE;\r
   }\r
@@ -321,13 +346,24 @@ IsVirtioPciRng (
   //\r
   // Read DeviceId and RevisionId.\r
   //\r
-  Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, PCI_DEVICE_ID_OFFSET,\r
-                        1, &DeviceId);\r
+  Status = PciIo->Pci.Read (\r
+                        PciIo,\r
+                        EfiPciIoWidthUint16,\r
+                        PCI_DEVICE_ID_OFFSET,\r
+                        1,\r
+                        &DeviceId\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     goto PciError;\r
   }\r
-  Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, PCI_REVISION_ID_OFFSET,\r
-                        1, &RevisionId);\r
+\r
+  Status = PciIo->Pci.Read (\r
+                        PciIo,\r
+                        EfiPciIoWidthUint8,\r
+                        PCI_REVISION_ID_OFFSET,\r
+                        1,\r
+                        &RevisionId\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     goto PciError;\r
   }\r
@@ -339,10 +375,11 @@ IsVirtioPciRng (
   // SubsystemId will only play a sanity-check role. Otherwise, DeviceId can\r
   // only be sanity-checked, and SubsystemId will decide.\r
   //\r
-  if (DeviceId == 0x1040 + VIRTIO_SUBSYSTEM_ENTROPY_SOURCE &&\r
-      RevisionId >= 0x01) {\r
+  if ((DeviceId == 0x1040 + VIRTIO_SUBSYSTEM_ENTROPY_SOURCE) &&\r
+      (RevisionId >= 0x01))\r
+  {\r
     Virtio10 = TRUE;\r
-  } else if (DeviceId >= 0x1000 && DeviceId <= 0x103F && RevisionId == 0x00) {\r
+  } else if ((DeviceId >= 0x1000) && (DeviceId <= 0x103F) && (RevisionId == 0x00)) {\r
     Virtio10 = FALSE;\r
   } else {\r
     return FALSE;\r
@@ -351,17 +388,25 @@ IsVirtioPciRng (
   //\r
   // Read and check SubsystemId as dictated by Virtio10.\r
   //\r
-  Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16,\r
-                        PCI_SUBSYSTEM_ID_OFFSET, 1, &SubsystemId);\r
+  Status = PciIo->Pci.Read (\r
+                        PciIo,\r
+                        EfiPciIoWidthUint16,\r
+                        PCI_SUBSYSTEM_ID_OFFSET,\r
+                        1,\r
+                        &SubsystemId\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
     goto PciError;\r
   }\r
-  if (Virtio10 && SubsystemId >= 0x40) {\r
+\r
+  if (Virtio10 && (SubsystemId >= 0x40)) {\r
     return TRUE;\r
   }\r
-  if (!Virtio10 && SubsystemId == VIRTIO_SUBSYSTEM_ENTROPY_SOURCE) {\r
+\r
+  if (!Virtio10 && (SubsystemId == VIRTIO_SUBSYSTEM_ENTROPY_SOURCE)) {\r
     return TRUE;\r
   }\r
+\r
   return FALSE;\r
 \r
 PciError:\r
@@ -369,7 +414,6 @@ PciError:
   return FALSE;\r
 }\r
 \r
-\r
 /**\r
   This CALLBACK_FUNCTION attempts to connect a handle non-recursively, asking\r
   the matching driver to produce all first-level child handles.\r
@@ -378,11 +422,11 @@ STATIC
 VOID\r
 EFIAPI\r
 Connect (\r
-  IN EFI_HANDLE   Handle,\r
-  IN CONST CHAR16 *ReportText\r
+  IN EFI_HANDLE    Handle,\r
+  IN CONST CHAR16  *ReportText\r
   )\r
 {\r
-  EFI_STATUS Status;\r
+  EFI_STATUS  Status;\r
 \r
   Status = gBS->ConnectController (\r
                   Handle, // ControllerHandle\r
@@ -390,11 +434,15 @@ Connect (
                   NULL,   // RemainingDevicePath -- produce all children\r
                   FALSE   // Recursive\r
                   );\r
-  DEBUG ((EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, "%a: %s: %r\n",\r
-    __FUNCTION__, ReportText, Status));\r
+  DEBUG ((\r
+    EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,\r
+    "%a: %s: %r\n",\r
+    __FUNCTION__,\r
+    ReportText,\r
+    Status\r
+    ));\r
 }\r
 \r
-\r
 /**\r
   This CALLBACK_FUNCTION retrieves the EFI_DEVICE_PATH_PROTOCOL from the\r
   handle, and adds it to ConOut and ErrOut.\r
@@ -403,59 +451,78 @@ STATIC
 VOID\r
 EFIAPI\r
 AddOutput (\r
-  IN EFI_HANDLE   Handle,\r
-  IN CONST CHAR16 *ReportText\r
+  IN EFI_HANDLE    Handle,\r
+  IN CONST CHAR16  *ReportText\r
   )\r
 {\r
-  EFI_STATUS               Status;\r
-  EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+  EFI_STATUS                Status;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
 \r
   DevicePath = DevicePathFromHandle (Handle);\r
   if (DevicePath == NULL) {\r
-    DEBUG ((DEBUG_ERROR, "%a: %s: handle %p: device path not found\n",\r
-      __FUNCTION__, ReportText, Handle));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: %s: handle %p: device path not found\n",\r
+      __FUNCTION__,\r
+      ReportText,\r
+      Handle\r
+      ));\r
     return;\r
   }\r
 \r
   Status = EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,\r
-      ReportText, Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: %s: adding to ConOut: %r\n",\r
+      __FUNCTION__,\r
+      ReportText,\r
+      Status\r
+      ));\r
     return;\r
   }\r
 \r
   Status = EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: %s: adding to ErrOut: %r\n", __FUNCTION__,\r
-      ReportText, Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: %s: adding to ErrOut: %r\n",\r
+      __FUNCTION__,\r
+      ReportText,\r
+      Status\r
+      ));\r
     return;\r
   }\r
 \r
-  DEBUG ((DEBUG_VERBOSE, "%a: %s: added to ConOut and ErrOut\n", __FUNCTION__,\r
-    ReportText));\r
+  DEBUG ((\r
+    DEBUG_VERBOSE,\r
+    "%a: %s: added to ConOut and ErrOut\n",\r
+    __FUNCTION__,\r
+    ReportText\r
+    ));\r
 }\r
 \r
 STATIC\r
 VOID\r
 PlatformRegisterFvBootOption (\r
-  EFI_GUID                         *FileGuid,\r
-  CHAR16                           *Description,\r
-  UINT32                           Attributes\r
+  EFI_GUID  *FileGuid,\r
+  CHAR16    *Description,\r
+  UINT32    Attributes\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
-  INTN                              OptionIndex;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION      NewOption;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION      *BootOptions;\r
-  UINTN                             BootOptionCount;\r
-  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;\r
-  EFI_LOADED_IMAGE_PROTOCOL         *LoadedImage;\r
-  EFI_DEVICE_PATH_PROTOCOL          *DevicePath;\r
+  EFI_STATUS                         Status;\r
+  INTN                               OptionIndex;\r
+  EFI_BOOT_MANAGER_LOAD_OPTION       NewOption;\r
+  EFI_BOOT_MANAGER_LOAD_OPTION       *BootOptions;\r
+  UINTN                              BootOptionCount;\r
+  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;\r
+  EFI_LOADED_IMAGE_PROTOCOL          *LoadedImage;\r
+  EFI_DEVICE_PATH_PROTOCOL           *DevicePath;\r
 \r
   Status = gBS->HandleProtocol (\r
                   gImageHandle,\r
                   &gEfiLoadedImageProtocolGuid,\r
-                  (VOID **) &LoadedImage\r
+                  (VOID **)&LoadedImage\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -464,7 +531,7 @@ PlatformRegisterFvBootOption (
   ASSERT (DevicePath != NULL);\r
   DevicePath = AppendDevicePathNode (\r
                  DevicePath,\r
-                 (EFI_DEVICE_PATH_PROTOCOL *) &FileNode\r
+                 (EFI_DEVICE_PATH_PROTOCOL *)&FileNode\r
                  );\r
   ASSERT (DevicePath != NULL);\r
 \r
@@ -482,22 +549,25 @@ PlatformRegisterFvBootOption (
   FreePool (DevicePath);\r
 \r
   BootOptions = EfiBootManagerGetLoadOptions (\r
-                  &BootOptionCount, LoadOptionTypeBoot\r
+                  &BootOptionCount,\r
+                  LoadOptionTypeBoot\r
                   );\r
 \r
   OptionIndex = EfiBootManagerFindLoadOption (\r
-                  &NewOption, BootOptions, BootOptionCount\r
+                  &NewOption,\r
+                  BootOptions,\r
+                  BootOptionCount\r
                   );\r
 \r
   if (OptionIndex == -1) {\r
     Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
+\r
   EfiBootManagerFreeLoadOption (&NewOption);\r
   EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
 }\r
 \r
-\r
 /**\r
   Remove all MemoryMapped(...)/FvFile(...) and Fv(...)/FvFile(...) boot options\r
   whose device paths do not resolve exactly to an FvFile in the system.\r
@@ -518,27 +588,30 @@ RemoveStaleFvFileOptions (
   VOID\r
   )\r
 {\r
-  EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;\r
-  UINTN                        BootOptionCount;\r
-  UINTN                        Index;\r
+  EFI_BOOT_MANAGER_LOAD_OPTION  *BootOptions;\r
+  UINTN                         BootOptionCount;\r
+  UINTN                         Index;\r
 \r
-  BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount,\r
-                  LoadOptionTypeBoot);\r
+  BootOptions = EfiBootManagerGetLoadOptions (\r
+                  &BootOptionCount,\r
+                  LoadOptionTypeBoot\r
+                  );\r
 \r
   for (Index = 0; Index < BootOptionCount; ++Index) {\r
-    EFI_DEVICE_PATH_PROTOCOL *Node1, *Node2, *SearchNode;\r
-    EFI_STATUS               Status;\r
-    EFI_HANDLE               FvHandle;\r
+    EFI_DEVICE_PATH_PROTOCOL  *Node1, *Node2, *SearchNode;\r
+    EFI_STATUS                Status;\r
+    EFI_HANDLE                FvHandle;\r
 \r
     //\r
     // If the device path starts with neither MemoryMapped(...) nor Fv(...),\r
     // then keep the boot option.\r
     //\r
     Node1 = BootOptions[Index].FilePath;\r
-    if (!(DevicePathType (Node1) == HARDWARE_DEVICE_PATH &&\r
-          DevicePathSubType (Node1) == HW_MEMMAP_DP) &&\r
-        !(DevicePathType (Node1) == MEDIA_DEVICE_PATH &&\r
-          DevicePathSubType (Node1) == MEDIA_PIWG_FW_VOL_DP)) {\r
+    if (!((DevicePathType (Node1) == HARDWARE_DEVICE_PATH) &&\r
+          (DevicePathSubType (Node1) == HW_MEMMAP_DP)) &&\r
+        !((DevicePathType (Node1) == MEDIA_DEVICE_PATH) &&\r
+          (DevicePathSubType (Node1) == MEDIA_PIWG_FW_VOL_DP)))\r
+    {\r
       continue;\r
     }\r
 \r
@@ -547,8 +620,9 @@ RemoveStaleFvFileOptions (
     // option.\r
     //\r
     Node2 = NextDevicePathNode (Node1);\r
-    if (DevicePathType (Node2) != MEDIA_DEVICE_PATH ||\r
-        DevicePathSubType (Node2) != MEDIA_PIWG_FW_FILE_DP) {\r
+    if ((DevicePathType (Node2) != MEDIA_DEVICE_PATH) ||\r
+        (DevicePathSubType (Node2) != MEDIA_PIWG_FW_FILE_DP))\r
+    {\r
       continue;\r
     }\r
 \r
@@ -559,23 +633,29 @@ RemoveStaleFvFileOptions (
     // boot option.\r
     //\r
     SearchNode = Node1;\r
-    Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid,\r
-                    &SearchNode, &FvHandle);\r
+    Status     = gBS->LocateDevicePath (\r
+                        &gEfiFirmwareVolume2ProtocolGuid,\r
+                        &SearchNode,\r
+                        &FvHandle\r
+                        );\r
 \r
     if (!EFI_ERROR (Status)) {\r
       //\r
       // The firmware volume was found; now let's see if it contains the FvFile\r
       // identified by GUID.\r
       //\r
-      EFI_FIRMWARE_VOLUME2_PROTOCOL     *FvProtocol;\r
-      MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFileNode;\r
-      UINTN                             BufferSize;\r
-      EFI_FV_FILETYPE                   FoundType;\r
-      EFI_FV_FILE_ATTRIBUTES            FileAttributes;\r
-      UINT32                            AuthenticationStatus;\r
-\r
-      Status = gBS->HandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid,\r
-                      (VOID **)&FvProtocol);\r
+      EFI_FIRMWARE_VOLUME2_PROTOCOL      *FvProtocol;\r
+      MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvFileNode;\r
+      UINTN                              BufferSize;\r
+      EFI_FV_FILETYPE                    FoundType;\r
+      EFI_FV_FILE_ATTRIBUTES             FileAttributes;\r
+      UINT32                             AuthenticationStatus;\r
+\r
+      Status = gBS->HandleProtocol (\r
+                      FvHandle,\r
+                      &gEfiFirmwareVolume2ProtocolGuid,\r
+                      (VOID **)&FvProtocol\r
+                      );\r
       ASSERT_EFI_ERROR (Status);\r
 \r
       FvFileNode = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)Node2;\r
@@ -604,48 +684,53 @@ RemoveStaleFvFileOptions (
     // Delete the boot option.\r
     //\r
     Status = EfiBootManagerDeleteLoadOptionVariable (\r
-               BootOptions[Index].OptionNumber, LoadOptionTypeBoot);\r
+               BootOptions[Index].OptionNumber,\r
+               LoadOptionTypeBoot\r
+               );\r
     DEBUG_CODE_BEGIN ();\r
-      CHAR16 *DevicePathString;\r
-\r
-      DevicePathString = ConvertDevicePathToText(BootOptions[Index].FilePath,\r
-                           FALSE, FALSE);\r
-      DEBUG ((\r
-        EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,\r
-        "%a: removing stale Boot#%04x %s: %r\n",\r
-        __FUNCTION__,\r
-        (UINT32)BootOptions[Index].OptionNumber,\r
-        DevicePathString == NULL ? L"<unavailable>" : DevicePathString,\r
-        Status\r
-        ));\r
-      if (DevicePathString != NULL) {\r
-        FreePool (DevicePathString);\r
-      }\r
+    CHAR16  *DevicePathString;\r
+\r
+    DevicePathString = ConvertDevicePathToText (\r
+                         BootOptions[Index].FilePath,\r
+                         FALSE,\r
+                         FALSE\r
+                         );\r
+    DEBUG ((\r
+      EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,\r
+      "%a: removing stale Boot#%04x %s: %r\n",\r
+      __FUNCTION__,\r
+      (UINT32)BootOptions[Index].OptionNumber,\r
+      DevicePathString == NULL ? L"<unavailable>" : DevicePathString,\r
+      Status\r
+      ));\r
+    if (DevicePathString != NULL) {\r
+      FreePool (DevicePathString);\r
+    }\r
+\r
     DEBUG_CODE_END ();\r
   }\r
 \r
   EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
 }\r
 \r
-\r
 STATIC\r
 VOID\r
 PlatformRegisterOptionsAndKeys (\r
   VOID\r
   )\r
 {\r
-  EFI_STATUS                   Status;\r
-  EFI_INPUT_KEY                Enter;\r
-  EFI_INPUT_KEY                F2;\r
-  EFI_INPUT_KEY                Esc;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION BootOption;\r
+  EFI_STATUS                    Status;\r
+  EFI_INPUT_KEY                 Enter;\r
+  EFI_INPUT_KEY                 F2;\r
+  EFI_INPUT_KEY                 Esc;\r
+  EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;\r
 \r
   //\r
   // Register ENTER as CONTINUE key\r
   //\r
   Enter.ScanCode    = SCAN_NULL;\r
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;\r
-  Status = EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);\r
+  Status            = EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
@@ -655,22 +740,30 @@ PlatformRegisterOptionsAndKeys (
   F2.UnicodeChar  = CHAR_NULL;\r
   Esc.ScanCode    = SCAN_ESC;\r
   Esc.UnicodeChar = CHAR_NULL;\r
-  Status = EfiBootManagerGetBootManagerMenu (&BootOption);\r
+  Status          = EfiBootManagerGetBootManagerMenu (&BootOption);\r
   ASSERT_EFI_ERROR (Status);\r
   Status = EfiBootManagerAddKeyOptionVariable (\r
-             NULL, (UINT16) BootOption.OptionNumber, 0, &F2, NULL\r
+             NULL,\r
+             (UINT16)BootOption.OptionNumber,\r
+             0,\r
+             &F2,\r
+             NULL\r
              );\r
   ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);\r
   Status = EfiBootManagerAddKeyOptionVariable (\r
-             NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL\r
+             NULL,\r
+             (UINT16)BootOption.OptionNumber,\r
+             0,\r
+             &Esc,\r
+             NULL\r
              );\r
   ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);\r
 }\r
 \r
-\r
 //\r
 // BDS Platform Functions\r
 //\r
+\r
 /**\r
   Do the platform init, can be customized by OEM/IBV\r
   Possible things that can be done in PlatformBootManagerBeforeConsole:\r
@@ -688,9 +781,9 @@ PlatformBootManagerBeforeConsole (
   VOID\r
   )\r
 {\r
-  UINT16        FrontPageTimeout;\r
-  RETURN_STATUS PcdStatus;\r
-  EFI_STATUS    Status;\r
+  UINT16         FrontPageTimeout;\r
+  RETURN_STATUS  PcdStatus;\r
+  EFI_STATUS     Status;\r
 \r
   //\r
   // Signal EndOfDxe PI Event\r
@@ -735,26 +828,40 @@ PlatformBootManagerBeforeConsole (
   //\r
   // Add the hardcoded short-form USB keyboard device path to ConIn.\r
   //\r
-  EfiBootManagerUpdateConsoleVariable (ConIn,\r
-    (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, NULL);\r
+  EfiBootManagerUpdateConsoleVariable (\r
+    ConIn,\r
+    (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard,\r
+    NULL\r
+    );\r
 \r
   //\r
   // Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.\r
   //\r
-  CopyGuid (&mSerialConsole.TermType.Guid,\r
-    PcdGetPtr (PcdTerminalTypeGuidBuffer));\r
-  EfiBootManagerUpdateConsoleVariable (ConIn,\r
-    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
-  EfiBootManagerUpdateConsoleVariable (ConOut,\r
-    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
-  EfiBootManagerUpdateConsoleVariable (ErrOut,\r
-    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
+  CopyGuid (\r
+    &mSerialConsole.TermType.Guid,\r
+    PcdGetPtr (PcdTerminalTypeGuidBuffer)\r
+    );\r
+  EfiBootManagerUpdateConsoleVariable (\r
+    ConIn,\r
+    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole,\r
+    NULL\r
+    );\r
+  EfiBootManagerUpdateConsoleVariable (\r
+    ConOut,\r
+    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole,\r
+    NULL\r
+    );\r
+  EfiBootManagerUpdateConsoleVariable (\r
+    ErrOut,\r
+    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole,\r
+    NULL\r
+    );\r
 \r
   //\r
   // Set the front page timeout from the QEMU configuration.\r
   //\r
   FrontPageTimeout = GetFrontPageTimeoutFromQemu ();\r
-  PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout);\r
+  PcdStatus        = PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout);\r
   ASSERT_RETURN_ERROR (PcdStatus);\r
   //\r
   // Reflect the PCD in the standard Timeout variable.\r
@@ -812,7 +919,7 @@ PlatformBootManagerAfterConsole (
   VOID\r
   )\r
 {\r
-  RETURN_STATUS Status;\r
+  RETURN_STATUS  Status;\r
 \r
   //\r
   // Show the splash screen.\r
@@ -848,7 +955,9 @@ PlatformBootManagerAfterConsole (
   // Register UEFI Shell\r
   //\r
   PlatformRegisterFvBootOption (\r
-    &gUefiShellFileGuid, L"EFI Internal Shell", LOAD_OPTION_ACTIVE\r
+    &gUefiShellFileGuid,\r
+    L"EFI Internal Shell",\r
+    LOAD_OPTION_ACTIVE\r
     );\r
 \r
   RemoveStaleFvFileOptions ();\r
@@ -866,12 +975,12 @@ PlatformBootManagerAfterConsole (
 VOID\r
 EFIAPI\r
 PlatformBootManagerWaitCallback (\r
-  UINT16          TimeoutRemain\r
+  UINT16  TimeoutRemain\r
   )\r
 {\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;\r
-  UINT16                              TimeoutInitial;\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  Black;\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  White;\r
+  UINT16                               TimeoutInitial;\r
 \r
   TimeoutInitial = PcdGet16 (PcdPlatformBootTimeOut);\r
 \r
@@ -909,10 +1018,10 @@ PlatformBootManagerUnableToBoot (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                   Status;\r
-  EFI_INPUT_KEY                Key;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;\r
-  UINTN                        Index;\r
+  EFI_STATUS                    Status;\r
+  EFI_INPUT_KEY                 Key;\r
+  EFI_BOOT_MANAGER_LOAD_OPTION  BootManagerMenu;\r
+  UINTN                         Index;\r
 \r
   //\r
   // BootManagerMenu doesn't contain the correct information when return status\r
@@ -922,6 +1031,7 @@ PlatformBootManagerUnableToBoot (
   if (EFI_ERROR (Status)) {\r
     return;\r
   }\r
+\r
   //\r
   // Normally BdsDxe does not print anything to the system console, but this is\r
   // a last resort -- the end-user will likely not see any DEBUG messages\r
@@ -951,7 +1061,7 @@ PlatformBootManagerUnableToBoot (
     }\r
   }\r
 \r
-  for (;;) {\r
+  for ( ; ;) {\r
     EfiBootManagerBoot (&BootManagerMenu);\r
   }\r
 }\r
index e9c110a0ed7559eb66db54f055be675ce071105b..c66b7c7b21fcee043d277cecc67e10669442cb37 100644 (file)
@@ -40,8 +40,8 @@ TryRunningQemuKernel (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                Status;\r
-  EFI_HANDLE                KernelImageHandle;\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  KernelImageHandle;\r
 \r
   Status = QemuLoadKernelImage (&KernelImageHandle);\r
   if (EFI_ERROR (Status)) {\r
@@ -51,18 +51,24 @@ TryRunningQemuKernel (
   //\r
   // Signal the EFI_EVENT_GROUP_READY_TO_BOOT event.\r
   //\r
-  EfiSignalEventReadyToBoot();\r
+  EfiSignalEventReadyToBoot ();\r
 \r
-  REPORT_STATUS_CODE (EFI_PROGRESS_CODE,\r
-    (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT));\r
+  REPORT_STATUS_CODE (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)\r
+    );\r
 \r
   //\r
   // Start the image.\r
   //\r
   Status = QemuStartKernelImage (&KernelImageHandle);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: QemuStartKernelImage(): %r\n", __FUNCTION__,\r
-      Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: QemuStartKernelImage(): %r\n",\r
+      __FUNCTION__,\r
+      Status\r
+      ));\r
   }\r
 \r
   QemuUnloadKernelImage (KernelImageHandle);\r
index 83f346157f7ef5e5fb8967505abbd64893bd0587..bb71fee64920005acb78216b514e7cddcc7cda0f 100644 (file)
 #include <Guid/EarlyPL011BaseAddress.h>\r
 #include <Guid/FdtHob.h>\r
 \r
-STATIC CONST EFI_PEI_PPI_DESCRIPTOR mTpm2DiscoveredPpi = {\r
+STATIC CONST EFI_PEI_PPI_DESCRIPTOR  mTpm2DiscoveredPpi = {\r
   EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
   &gOvmfTpmDiscoveredPpiGuid,\r
   NULL\r
 };\r
 \r
-STATIC CONST EFI_PEI_PPI_DESCRIPTOR mTpm2InitializationDonePpi = {\r
+STATIC CONST EFI_PEI_PPI_DESCRIPTOR  mTpm2InitializationDonePpi = {\r
   EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
   &gPeiTpmInitializationDonePpiGuid,\r
   NULL\r
@@ -37,33 +37,33 @@ PlatformPeim (
   VOID\r
   )\r
 {\r
-  VOID               *Base;\r
-  VOID               *NewBase;\r
-  UINTN              FdtSize;\r
-  UINTN              FdtPages;\r
-  UINT64             *FdtHobData;\r
-  UINT64             *UartHobData;\r
-  INT32              Node, Prev;\r
-  INT32              Parent, Depth;\r
-  CONST CHAR8        *Compatible;\r
-  CONST CHAR8        *CompItem;\r
-  CONST CHAR8        *NodeStatus;\r
-  INT32              Len;\r
-  INT32              RangesLen;\r
-  INT32              StatusLen;\r
-  CONST UINT64       *RegProp;\r
-  CONST UINT32       *RangesProp;\r
-  UINT64             UartBase;\r
-  UINT64             TpmBase;\r
-  EFI_STATUS         Status;\r
-\r
-  Base = (VOID*)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
+  VOID          *Base;\r
+  VOID          *NewBase;\r
+  UINTN         FdtSize;\r
+  UINTN         FdtPages;\r
+  UINT64        *FdtHobData;\r
+  UINT64        *UartHobData;\r
+  INT32         Node, Prev;\r
+  INT32         Parent, Depth;\r
+  CONST CHAR8   *Compatible;\r
+  CONST CHAR8   *CompItem;\r
+  CONST CHAR8   *NodeStatus;\r
+  INT32         Len;\r
+  INT32         RangesLen;\r
+  INT32         StatusLen;\r
+  CONST UINT64  *RegProp;\r
+  CONST UINT32  *RangesProp;\r
+  UINT64        UartBase;\r
+  UINT64        TpmBase;\r
+  EFI_STATUS    Status;\r
+\r
+  Base = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
   ASSERT (Base != NULL);\r
   ASSERT (fdt_check_header (Base) == 0);\r
 \r
-  FdtSize = fdt_totalsize (Base) + PcdGet32 (PcdDeviceTreeAllocationPadding);\r
+  FdtSize  = fdt_totalsize (Base) + PcdGet32 (PcdDeviceTreeAllocationPadding);\r
   FdtPages = EFI_SIZE_TO_PAGES (FdtSize);\r
-  NewBase = AllocatePages (FdtPages);\r
+  NewBase  = AllocatePages (FdtPages);\r
   ASSERT (NewBase != NULL);\r
   fdt_open_into (Base, NewBase, EFI_PAGES_TO_SIZE (FdtPages));\r
 \r
@@ -82,7 +82,7 @@ PlatformPeim (
   //\r
   Parent = 0;\r
 \r
-  for (Prev = Depth = 0;; Prev = Node) {\r
+  for (Prev = Depth = 0; ; Prev = Node) {\r
     Node = fdt_next_node (Base, Prev, &Depth);\r
     if (Node < 0) {\r
       break;\r
@@ -98,11 +98,11 @@ PlatformPeim (
     // Iterate over the NULL-separated items in the compatible string\r
     //\r
     for (CompItem = Compatible; CompItem != NULL && CompItem < Compatible + Len;\r
-      CompItem += 1 + AsciiStrLen (CompItem)) {\r
-\r
+         CompItem += 1 + AsciiStrLen (CompItem))\r
+    {\r
       if (AsciiStrCmp (CompItem, "arm,pl011") == 0) {\r
         NodeStatus = fdt_getprop (Base, Node, "status", &StatusLen);\r
-        if (NodeStatus != NULL && AsciiStrCmp (NodeStatus, "okay") != 0) {\r
+        if ((NodeStatus != NULL) && (AsciiStrCmp (NodeStatus, "okay") != 0)) {\r
           continue;\r
         }\r
 \r
@@ -116,8 +116,8 @@ PlatformPeim (
         *UartHobData = UartBase;\r
         break;\r
       } else if (FeaturePcdGet (PcdTpm2SupportEnabled) &&\r
-                 AsciiStrCmp (CompItem, "tcg,tpm-tis-mmio") == 0) {\r
-\r
+                 (AsciiStrCmp (CompItem, "tcg,tpm-tis-mmio") == 0))\r
+      {\r
         RegProp = fdt_getprop (Base, Node, "reg", &Len);\r
         ASSERT (Len == 8 || Len == 16);\r
         if (Len == 8) {\r
@@ -145,9 +145,12 @@ PlatformPeim (
             // assume a single translated range with 2 cells for the parent base\r
             //\r
             if (RangesLen != Len + 2 * sizeof (UINT32)) {\r
-              DEBUG ((DEBUG_WARN,\r
+              DEBUG ((\r
+                DEBUG_WARN,\r
                 "%a: 'ranges' property has unexpected size %d\n",\r
-                __FUNCTION__, RangesLen));\r
+                __FUNCTION__,\r
+                RangesLen\r
+                ));\r
               break;\r
             }\r
 \r
@@ -161,9 +164,10 @@ PlatformPeim (
             // advance RangesProp to the parent bus address\r
             //\r
             RangesProp = (UINT32 *)((UINT8 *)RangesProp + Len / 2);\r
-            TpmBase += fdt64_to_cpu (ReadUnaligned64 ((UINT64 *)RangesProp));\r
+            TpmBase   += fdt64_to_cpu (ReadUnaligned64 ((UINT64 *)RangesProp));\r
           }\r
         }\r
+\r
         break;\r
       }\r
     }\r
@@ -180,6 +184,7 @@ PlatformPeim (
     } else {\r
       Status = PeiServicesInstallPpi (&mTpm2InitializationDonePpi);\r
     }\r
+\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
index 7ae837b186d311f74cbb8dc72b5d382dfe8d20b4..cf569bed99c4cb831b1b91a952433292d419a386 100644 (file)
@@ -13,7 +13,7 @@
 #include <Library/MemoryAllocationLib.h>\r
 \r
 // Number of Virtual Memory Map Descriptors\r
-#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS          5\r
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS  5\r
 \r
 //\r
 // mach-virt's core peripherals such as the UART, the GIC and the RTC are\r
@@ -21,8 +21,8 @@
 // in its entirety rather than device by device. Note that it does not\r
 // cover any of the NOR flash banks or PCI resource windows.\r
 //\r
-#define MACH_VIRT_PERIPH_BASE       0x08000000\r
-#define MACH_VIRT_PERIPH_SIZE       SIZE_128MB\r
+#define MACH_VIRT_PERIPH_BASE  0x08000000\r
+#define MACH_VIRT_PERIPH_SIZE  SIZE_128MB\r
 \r
 /**\r
   Return the Virtual Memory Map of your platform\r
 **/\r
 VOID\r
 ArmVirtGetMemoryMap (\r
-  OUT ARM_MEMORY_REGION_DESCRIPTOR   **VirtualMemoryMap\r
+  OUT ARM_MEMORY_REGION_DESCRIPTOR  **VirtualMemoryMap\r
   )\r
 {\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
 \r
   ASSERT (VirtualMemoryMap != NULL);\r
 \r
-  VirtualMemoryTable = AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *\r
-                                     MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS);\r
+  VirtualMemoryTable = AllocatePool (\r
+                         sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *\r
+                         MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS\r
+                         );\r
 \r
   if (VirtualMemoryTable == NULL) {\r
     DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION__));\r
@@ -60,14 +62,17 @@ ArmVirtGetMemoryMap (
   VirtualMemoryTable[0].Length       = PcdGet64 (PcdSystemMemorySize);\r
   VirtualMemoryTable[0].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a: Dumping System DRAM Memory Map:\n"\r
-      "\tPhysicalBase: 0x%lX\n"\r
-      "\tVirtualBase: 0x%lX\n"\r
-      "\tLength: 0x%lX\n",\r
-      __FUNCTION__,\r
-      VirtualMemoryTable[0].PhysicalBase,\r
-      VirtualMemoryTable[0].VirtualBase,\r
-      VirtualMemoryTable[0].Length));\r
+  DEBUG ((\r
+    DEBUG_INFO,\r
+    "%a: Dumping System DRAM Memory Map:\n"\r
+    "\tPhysicalBase: 0x%lX\n"\r
+    "\tVirtualBase: 0x%lX\n"\r
+    "\tLength: 0x%lX\n",\r
+    __FUNCTION__,\r
+    VirtualMemoryTable[0].PhysicalBase,\r
+    VirtualMemoryTable[0].VirtualBase,\r
+    VirtualMemoryTable[0].Length\r
+    ));\r
 \r
   // Memory mapped peripherals (UART, RTC, GIC, virtio-mmio, etc)\r
   VirtualMemoryTable[1].PhysicalBase = MACH_VIRT_PERIPH_BASE;\r
index b32419b85cd3cc4764c419d3fdf07b9701539421..33d3597d57ab35c941609b502e574805243ea7bd 100644 (file)
@@ -17,14 +17,14 @@ QemuVirtMemInfoPeiLibConstructor (
   VOID\r
   )\r
 {\r
-  VOID          *DeviceTreeBase;\r
-  INT32         Node, Prev;\r
-  UINT64        NewBase, CurBase;\r
-  UINT64        NewSize, CurSize;\r
-  CONST CHAR8   *Type;\r
-  INT32         Len;\r
-  CONST UINT64  *RegProp;\r
-  RETURN_STATUS PcdStatus;\r
+  VOID           *DeviceTreeBase;\r
+  INT32          Node, Prev;\r
+  UINT64         NewBase, CurBase;\r
+  UINT64         NewSize, CurSize;\r
+  CONST CHAR8    *Type;\r
+  INT32          Len;\r
+  CONST UINT64   *RegProp;\r
+  RETURN_STATUS  PcdStatus;\r
 \r
   NewBase = 0;\r
   NewSize = 0;\r
@@ -40,7 +40,7 @@ QemuVirtMemInfoPeiLibConstructor (
   //\r
   // Look for the lowest memory node\r
   //\r
-  for (Prev = 0;; Prev = Node) {\r
+  for (Prev = 0; ; Prev = Node) {\r
     Node = fdt_next_node (DeviceTreeBase, Prev, NULL);\r
     if (Node < 0) {\r
       break;\r
@@ -50,27 +50,34 @@ QemuVirtMemInfoPeiLibConstructor (
     // Check for memory node\r
     //\r
     Type = fdt_getprop (DeviceTreeBase, Node, "device_type", &Len);\r
-    if (Type && AsciiStrnCmp (Type, "memory", Len) == 0) {\r
+    if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) {\r
       //\r
       // Get the 'reg' property of this node. For now, we will assume\r
       // two 8 byte quantities for base and size, respectively.\r
       //\r
       RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", &Len);\r
-      if (RegProp != 0 && Len == (2 * sizeof (UINT64))) {\r
-\r
+      if ((RegProp != 0) && (Len == (2 * sizeof (UINT64)))) {\r
         CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));\r
         CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));\r
 \r
-        DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n",\r
-          __FUNCTION__, CurBase, CurBase + CurSize - 1));\r
+        DEBUG ((\r
+          DEBUG_INFO,\r
+          "%a: System RAM @ 0x%lx - 0x%lx\n",\r
+          __FUNCTION__,\r
+          CurBase,\r
+          CurBase + CurSize - 1\r
+          ));\r
 \r
-        if (NewBase > CurBase || NewBase == 0) {\r
+        if ((NewBase > CurBase) || (NewBase == 0)) {\r
           NewBase = CurBase;\r
           NewSize = CurSize;\r
         }\r
       } else {\r
-        DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n",\r
-          __FUNCTION__));\r
+        DEBUG ((\r
+          DEBUG_ERROR,\r
+          "%a: Failed to parse FDT memory node\n",\r
+          __FUNCTION__\r
+          ));\r
       }\r
     }\r
   }\r
@@ -94,7 +101,8 @@ QemuVirtMemInfoPeiLibConstructor (
   ASSERT (\r
     (((UINT64)PcdGet64 (PcdFdBaseAddress) +\r
       (UINT64)PcdGet32 (PcdFdSize)) <= NewBase) ||\r
-    ((UINT64)PcdGet64 (PcdFdBaseAddress) >= (NewBase + NewSize)));\r
+    ((UINT64)PcdGet64 (PcdFdBaseAddress) >= (NewBase + NewSize))\r
+    );\r
 \r
   return RETURN_SUCCESS;\r
 }\r
index da01870cee69b651456bb001b4a0c8a3c5f29f1b..9559caa93fe7c15f6d010b846f4288dd2c74d964 100644 (file)
@@ -16,9 +16,9 @@ ArmGenericTimerEnableTimer (
   VOID\r
   )\r
 {\r
-  UINTN TimerCtrlReg;\r
+  UINTN  TimerCtrlReg;\r
 \r
-  TimerCtrlReg = ArmReadCntvCtl ();\r
+  TimerCtrlReg  = ArmReadCntvCtl ();\r
   TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;\r
   ArmWriteCntvCtl (TimerCtrlReg);\r
 }\r
@@ -29,9 +29,9 @@ ArmGenericTimerReenableTimer (
   VOID\r
   )\r
 {\r
-  UINTN TimerCtrlReg;\r
+  UINTN  TimerCtrlReg;\r
 \r
-  TimerCtrlReg = ArmReadCntvCtl ();\r
+  TimerCtrlReg  = ArmReadCntvCtl ();\r
   TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;\r
 \r
   //\r
@@ -50,9 +50,9 @@ ArmGenericTimerDisableTimer (
   VOID\r
   )\r
 {\r
-  UINTN TimerCtrlReg;\r
+  UINTN  TimerCtrlReg;\r
 \r
-  TimerCtrlReg = ArmReadCntvCtl ();\r
+  TimerCtrlReg  = ArmReadCntvCtl ();\r
   TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;\r
   ArmWriteCntvCtl (TimerCtrlReg);\r
 }\r
@@ -84,11 +84,10 @@ ArmGenericTimerGetTimerVal (
   return ArmReadCntvTval ();\r
 }\r
 \r
-\r
 VOID\r
 EFIAPI\r
 ArmGenericTimerSetTimerVal (\r
-  IN   UINTN   Value\r
+  IN   UINTN  Value\r
   )\r
 {\r
   ArmWriteCntvTval (Value);\r
@@ -115,7 +114,7 @@ ArmGenericTimerGetTimerCtrlReg (
 VOID\r
 EFIAPI\r
 ArmGenericTimerSetTimerCtrlReg (\r
-  UINTN Value\r
+  UINTN  Value\r
   )\r
 {\r
   ArmWriteCntvCtl (Value);\r
@@ -133,7 +132,7 @@ ArmGenericTimerGetCompareVal (
 VOID\r
 EFIAPI\r
 ArmGenericTimerSetCompareVal (\r
-  IN   UINT64   Value\r
+  IN   UINT64  Value\r
   )\r
 {\r
   ArmWriteCntvCval (Value);\r
index aa483b6d909a1ce882293693e67f28d09071ff66..ac0c75aecfe54090788836f2eea097f4abb112a3 100644 (file)
@@ -29,10 +29,10 @@ STATIC ARM_MEMORY_REGION_DESCRIPTOR  mVirtualMemoryTable[2];
 VOID\r
 EFIAPI\r
 ArmVirtGetMemoryMap (\r
-  OUT ARM_MEMORY_REGION_DESCRIPTOR   **VirtualMemoryMap\r
+  OUT ARM_MEMORY_REGION_DESCRIPTOR  **VirtualMemoryMap\r
   )\r
 {\r
-  EFI_PHYSICAL_ADDRESS TopOfAddressSpace;\r
+  EFI_PHYSICAL_ADDRESS  TopOfAddressSpace;\r
 \r
   ASSERT (VirtualMemoryMap != NULL);\r
 \r
index 63f5632f43329cce32c19012887ee76090e9994c..952d9bfc1f752c774224ebc3ba7c1a175f4b7838 100644 (file)
 EFI_STATUS\r
 EFIAPI\r
 PlatformHasAcpiDt (\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
-  FIRMWARE_CONFIG_ITEM FwCfgItem;\r
-  UINTN                FwCfgSize;\r
+  EFI_STATUS            Status;\r
+  FIRMWARE_CONFIG_ITEM  FwCfgItem;\r
+  UINTN                 FwCfgSize;\r
 \r
   //\r
   // If we fail to install any of the necessary protocols below, the OS will be\r
   // unbootable anyway (due to lacking hardware description), so tolerate no\r
   // errors here.\r
   //\r
-  if (MAX_UINTN == MAX_UINT64 &&\r
+  if ((MAX_UINTN == MAX_UINT64) &&\r
       !PcdGetBool (PcdForceNoAcpi) &&\r
       !EFI_ERROR (\r
          QemuFwCfgFindFile (\r
@@ -39,7 +39,8 @@ PlatformHasAcpiDt (
            &FwCfgItem,\r
            &FwCfgSize\r
            )\r
-         )) {\r
+         ))\r
+  {\r
     //\r
     // Only make ACPI available on 64-bit systems, and only if QEMU generates\r
     // (a subset of) the ACPI tables.\r
index 4754cba55c7bb408bd06a1881b8940fe36bf22b1..5a91f7e62da7f72a2074ed1f57c7d39509c66768 100644 (file)
@@ -14,11 +14,11 @@ FindMemnode (
   OUT UINT64  *SystemMemorySize\r
   )\r
 {\r
-  INT32         MemoryNode;\r
-  INT32         AddressCells;\r
-  INT32         SizeCells;\r
-  INT32         Length;\r
-  CONST INT32   *Prop;\r
+  INT32        MemoryNode;\r
+  INT32        AddressCells;\r
+  INT32        SizeCells;\r
+  INT32        Length;\r
+  CONST INT32  *Prop;\r
 \r
   if (fdt_check_header (DeviceTreeBlob) != 0) {\r
     return FALSE;\r
@@ -37,7 +37,7 @@ FindMemnode (
   // from the root node, or use the default if not provided.\r
   //\r
   AddressCells = 1;\r
-  SizeCells = 1;\r
+  SizeCells    = 1;\r
 \r
   Prop = fdt_getprop (DeviceTreeBlob, 0, "#address-cells", &Length);\r
   if (Length == 4) {\r
@@ -63,6 +63,7 @@ FindMemnode (
   if (AddressCells > 1) {\r
     *SystemMemoryBase = (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1]);\r
   }\r
+\r
   Prop += AddressCells;\r
 \r
   *SystemMemorySize = fdt32_to_cpu (Prop[0]);\r
@@ -75,10 +76,10 @@ FindMemnode (
 \r
 VOID\r
 CopyFdt (\r
-  IN    VOID    *FdtDest,\r
-  IN    VOID    *FdtSource\r
+  IN    VOID  *FdtDest,\r
+  IN    VOID  *FdtSource\r
   )\r
 {\r
-  fdt_pack(FdtSource);\r
+  fdt_pack (FdtSource);\r
   CopyMem (FdtDest, FdtSource, fdt_totalsize (FdtSource));\r
 }\r
index 4f0c3f98bad63d0682cccd76a0a062d1fd4f46ab..c15dc305fced65fb3f3fdc5ce4ce094efdf9f71a 100755 (executable)
@@ -30,27 +30,27 @@ ProcessLibraryConstructorList (
 \r
 VOID\r
 PrePiMain (\r
-  IN  UINTN                     UefiMemoryBase,\r
-  IN  UINTN                     StacksBase,\r
-  IN  UINT64                    StartTimeStamp\r
+  IN  UINTN   UefiMemoryBase,\r
+  IN  UINTN   StacksBase,\r
+  IN  UINT64  StartTimeStamp\r
   )\r
 {\r
-  EFI_HOB_HANDOFF_INFO_TABLE*   HobList;\r
-  EFI_STATUS                    Status;\r
-  CHAR8                         Buffer[100];\r
-  UINTN                         CharCount;\r
-  UINTN                         StacksSize;\r
+  EFI_HOB_HANDOFF_INFO_TABLE  *HobList;\r
+  EFI_STATUS                  Status;\r
+  CHAR8                       Buffer[100];\r
+  UINTN                       CharCount;\r
+  UINTN                       StacksSize;\r
 \r
   // Initialize the architecture specific bits\r
   ArchInitialize ();\r
 \r
   // Declare the PI/UEFI memory region\r
   HobList = HobConstructor (\r
-    (VOID*)UefiMemoryBase,\r
-    FixedPcdGet32 (PcdSystemMemoryUefiRegionSize),\r
-    (VOID*)UefiMemoryBase,\r
-    (VOID*)StacksBase  // The top of the UEFI Memory is reserved for the stacks\r
-    );\r
+              (VOID *)UefiMemoryBase,\r
+              FixedPcdGet32 (PcdSystemMemoryUefiRegionSize),\r
+              (VOID *)UefiMemoryBase,\r
+              (VOID *)StacksBase // The top of the UEFI Memory is reserved for the stacks\r
+              );\r
   PrePeiSetHobList (HobList);\r
 \r
   //\r
@@ -58,7 +58,7 @@ PrePiMain (
   // modifications we made with the caches and MMU off (such as the applied\r
   // relocations) don't become invisible once we turn them on.\r
   //\r
-  InvalidateDataCacheRange((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));\r
+  InvalidateDataCacheRange ((VOID *)(UINTN)PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize));\r
 \r
   // Initialize MMU and Memory HOBs (Resource Descriptor HOBs)\r
   Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));\r
@@ -66,15 +66,21 @@ PrePiMain (
 \r
   // Initialize the Serial Port\r
   SerialPortInitialize ();\r
-  CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"UEFI firmware (version %s built at %a on %a)\n\r",\r
-    (CHAR16*)PcdGetPtr(PcdFirmwareVersionString), __TIME__, __DATE__);\r
-  SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
+  CharCount = AsciiSPrint (\r
+                Buffer,\r
+                sizeof (Buffer),\r
+                "UEFI firmware (version %s built at %a on %a)\n\r",\r
+                (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),\r
+                __TIME__,\r
+                __DATE__\r
+                );\r
+  SerialPortWrite ((UINT8 *)Buffer, CharCount);\r
 \r
   // Create the Stacks HOB (reserve the memory for all stacks)\r
   StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize);\r
   BuildStackHob (StacksBase, StacksSize);\r
 \r
-  //TODO: Call CpuPei as a library\r
+  // TODO: Call CpuPei as a library\r
   BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize));\r
 \r
   // Set the Boot Mode\r
@@ -101,12 +107,12 @@ PrePiMain (
 \r
 VOID\r
 CEntryPoint (\r
-  IN  UINTN                     MpId,\r
-  IN  UINTN                     UefiMemoryBase,\r
-  IN  UINTN                     StacksBase\r
+  IN  UINTN  MpId,\r
+  IN  UINTN  UefiMemoryBase,\r
+  IN  UINTN  StacksBase\r
   )\r
 {\r
-  UINT64   StartTimeStamp;\r
+  UINT64  StartTimeStamp;\r
 \r
   if (PerformanceMeasurementEnabled ()) {\r
     // Initialize the Timer Library to setup the Timer HW controller\r
@@ -132,8 +138,8 @@ CEntryPoint (
 \r
 VOID\r
 RelocatePeCoffImage (\r
-  IN  EFI_PEI_FV_HANDLE             FwVolHeader,\r
-  IN  PE_COFF_LOADER_READ_FILE      ImageRead\r
+  IN  EFI_PEI_FV_HANDLE         FwVolHeader,\r
+  IN  PE_COFF_LOADER_READ_FILE  ImageRead\r
   )\r
 {\r
   EFI_PEI_FILE_HANDLE           FileHandle;\r
@@ -142,20 +148,24 @@ RelocatePeCoffImage (
   EFI_STATUS                    Status;\r
 \r
   FileHandle = NULL;\r
-  Status = FfsFindNextFile (EFI_FV_FILETYPE_SECURITY_CORE, FwVolHeader,\r
-             &FileHandle);\r
+  Status     = FfsFindNextFile (\r
+                 EFI_FV_FILETYPE_SECURITY_CORE,\r
+                 FwVolHeader,\r
+                 &FileHandle\r
+                 );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   Status = FfsFindSectionData (EFI_SECTION_PE32, FileHandle, &SectionData);\r
   if (EFI_ERROR (Status)) {\r
     Status = FfsFindSectionData (EFI_SECTION_TE, FileHandle, &SectionData);\r
   }\r
+\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   ZeroMem (&ImageContext, sizeof ImageContext);\r
 \r
-  ImageContext.Handle       = (EFI_HANDLE)SectionData;\r
-  ImageContext.ImageRead    = ImageRead;\r
+  ImageContext.Handle    = (EFI_HANDLE)SectionData;\r
+  ImageContext.ImageRead = ImageRead;\r
   PeCoffLoaderGetImageInfo (&ImageContext);\r
 \r
   if (ImageContext.ImageAddress != (UINTN)SectionData) {\r
index cc7a492388681e9391a8cd59e083186b63633d19..4bb9791e40b475c3bbca83dd60242a806e27a573 100644 (file)
@@ -30,16 +30,16 @@ TimerConstructor (
 \r
 VOID\r
 PrePiMain (\r
-  IN  UINTN                     UefiMemoryBase,\r
-  IN  UINTN                     StacksBase,\r
-  IN  UINT64                    StartTimeStamp\r
+  IN  UINTN   UefiMemoryBase,\r
+  IN  UINTN   StacksBase,\r
+  IN  UINT64  StartTimeStamp\r
   );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 MemoryPeim (\r
-  IN EFI_PHYSICAL_ADDRESS       UefiMemoryBase,\r
-  IN UINT64                     UefiMemorySize\r
+  IN EFI_PHYSICAL_ADDRESS  UefiMemoryBase,\r
+  IN UINT64                UefiMemorySize\r
   );\r
 \r
 EFI_STATUS\r
index 438b0ff0f0e2e2b4c74470b80d8ffbbdcc296c9f..96bc442f691264bcebe02400cab70ef8ff61f9b0 100644 (file)
@@ -32,33 +32,44 @@ STATIC
 EFI_STATUS\r
 EFIAPI\r
 GetXenArmAcpiRsdp (\r
-  OUT   EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER   **RsdpPtr\r
+  OUT   EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER  **RsdpPtr\r
   )\r
 {\r
-  EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER   *RsdpStructurePtr;\r
-  EFI_STATUS                                     Status;\r
-  FDT_CLIENT_PROTOCOL                            *FdtClient;\r
-  CONST UINT64                                   *Reg;\r
-  UINT32                                         RegSize;\r
-  UINTN                                          AddressCells, SizeCells;\r
-  UINT64                                         RegBase;\r
-  UINT8                                          Sum;\r
+  EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *RsdpStructurePtr;\r
+  EFI_STATUS                                    Status;\r
+  FDT_CLIENT_PROTOCOL                           *FdtClient;\r
+  CONST UINT64                                  *Reg;\r
+  UINT32                                        RegSize;\r
+  UINTN                                         AddressCells, SizeCells;\r
+  UINT64                                        RegBase;\r
+  UINT8                                         Sum;\r
 \r
   RsdpStructurePtr = NULL;\r
-  FdtClient = NULL;\r
+  FdtClient        = NULL;\r
   //\r
   // Get the RSDP structure address from DeviceTree\r
   //\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = FdtClient->FindCompatibleNodeReg (FdtClient, "xen,guest-acpi",\r
-                        (CONST VOID **)&Reg, &AddressCells, &SizeCells,\r
-                        &RegSize);\r
+  Status = FdtClient->FindCompatibleNodeReg (\r
+                        FdtClient,\r
+                        "xen,guest-acpi",\r
+                        (CONST VOID **)&Reg,\r
+                        &AddressCells,\r
+                        &SizeCells,\r
+                        &RegSize\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_WARN, "%a: No 'xen,guest-acpi' compatible DT node found\n",\r
-      __FUNCTION__));\r
+    DEBUG ((\r
+      DEBUG_WARN,\r
+      "%a: No 'xen,guest-acpi' compatible DT node found\n",\r
+      __FUNCTION__\r
+      ));\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -66,13 +77,15 @@ GetXenArmAcpiRsdp (
   ASSERT (SizeCells == 2);\r
   ASSERT (RegSize == 2 * sizeof (UINT64));\r
 \r
-  RegBase = SwapBytes64(Reg[0]);\r
+  RegBase          = SwapBytes64 (Reg[0]);\r
   RsdpStructurePtr =\r
     (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)RegBase;\r
 \r
-  if (RsdpStructurePtr && RsdpStructurePtr->Revision >= 2) {\r
-    Sum = CalculateSum8 ((CONST UINT8 *)RsdpStructurePtr,\r
-            sizeof (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER));\r
+  if (RsdpStructurePtr && (RsdpStructurePtr->Revision >= 2)) {\r
+    Sum = CalculateSum8 (\r
+            (CONST UINT8 *)RsdpStructurePtr,\r
+            sizeof (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER)\r
+            );\r
     if (Sum != 0) {\r
       return EFI_ABORTED;\r
     }\r
@@ -101,26 +114,26 @@ STATIC
 EFI_STATUS\r
 EFIAPI\r
 InstallXenArmTables (\r
-  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol\r
+  IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol\r
   )\r
 {\r
-  EFI_STATUS                                       Status;\r
-  UINTN                                            TableHandle;\r
-  VOID                                             *CurrentTableEntry;\r
-  UINTN                                            CurrentTablePointer;\r
-  EFI_ACPI_DESCRIPTION_HEADER                      *CurrentTable;\r
-  UINTN                                            Index;\r
-  UINTN                                            NumberOfTableEntries;\r
-  EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER     *XenAcpiRsdpStructurePtr;\r
-  EFI_ACPI_DESCRIPTION_HEADER                      *Xsdt;\r
-  EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE        *FadtTable;\r
-  EFI_ACPI_DESCRIPTION_HEADER                      *DsdtTable;\r
+  EFI_STATUS                                    Status;\r
+  UINTN                                         TableHandle;\r
+  VOID                                          *CurrentTableEntry;\r
+  UINTN                                         CurrentTablePointer;\r
+  EFI_ACPI_DESCRIPTION_HEADER                   *CurrentTable;\r
+  UINTN                                         Index;\r
+  UINTN                                         NumberOfTableEntries;\r
+  EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *XenAcpiRsdpStructurePtr;\r
+  EFI_ACPI_DESCRIPTION_HEADER                   *Xsdt;\r
+  EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE     *FadtTable;\r
+  EFI_ACPI_DESCRIPTION_HEADER                   *DsdtTable;\r
 \r
   XenAcpiRsdpStructurePtr = NULL;\r
-  FadtTable   = NULL;\r
-  DsdtTable   = NULL;\r
-  TableHandle = 0;\r
-  NumberOfTableEntries = 0;\r
+  FadtTable               = NULL;\r
+  DsdtTable               = NULL;\r
+  TableHandle             = 0;\r
+  NumberOfTableEntries    = 0;\r
 \r
   //\r
   // Try to find Xen ARM ACPI tables\r
@@ -139,11 +152,11 @@ InstallXenArmTables (
     // Retrieve the addresses of XSDT and\r
     // calculate the number of its table entries.\r
     //\r
-    Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN)\r
-             XenAcpiRsdpStructurePtr->XsdtAddress;\r
+    Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)\r
+           XenAcpiRsdpStructurePtr->XsdtAddress;\r
     NumberOfTableEntries = (Xsdt->Length -\r
-                             sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /\r
-                             sizeof (UINT64);\r
+                            sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /\r
+                           sizeof (UINT64);\r
     //\r
     // Install ACPI tables found in XSDT.\r
     //\r
@@ -151,21 +164,21 @@ InstallXenArmTables (
       //\r
       // Get the table entry from XSDT\r
       //\r
-      CurrentTableEntry = (VOID *) ((UINT8 *) Xsdt +\r
-                            sizeof (EFI_ACPI_DESCRIPTION_HEADER) +\r
-                            Index * sizeof (UINT64));\r
-      CurrentTablePointer = (UINTN) *(UINT64 *)CurrentTableEntry;\r
-      CurrentTable = (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer;\r
+      CurrentTableEntry = (VOID *)((UINT8 *)Xsdt +\r
+                                   sizeof (EFI_ACPI_DESCRIPTION_HEADER) +\r
+                                   Index * sizeof (UINT64));\r
+      CurrentTablePointer = (UINTN)*(UINT64 *)CurrentTableEntry;\r
+      CurrentTable        = (EFI_ACPI_DESCRIPTION_HEADER *)CurrentTablePointer;\r
 \r
       //\r
       // Install the XSDT tables\r
       //\r
       Status = AcpiProtocol->InstallAcpiTable (\r
-                 AcpiProtocol,\r
-                 CurrentTable,\r
-                 CurrentTable->Length,\r
-                 &TableHandle\r
-                 );\r
+                               AcpiProtocol,\r
+                               CurrentTable,\r
+                               CurrentTable->Length,\r
+                               &TableHandle\r
+                               );\r
 \r
       if (EFI_ERROR (Status)) {\r
         return Status;\r
@@ -174,10 +187,10 @@ InstallXenArmTables (
       //\r
       // Get the FACS and DSDT table address from the table FADT\r
       //\r
-      if (!AsciiStrnCmp ((CHAR8 *) &CurrentTable->Signature, "FACP", 4)) {\r
+      if (!AsciiStrnCmp ((CHAR8 *)&CurrentTable->Signature, "FACP", 4)) {\r
         FadtTable = (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *)\r
-                      (UINTN) CurrentTablePointer;\r
-        DsdtTable  = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) FadtTable->Dsdt;\r
+                    (UINTN)CurrentTablePointer;\r
+        DsdtTable = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)FadtTable->Dsdt;\r
       }\r
     }\r
   }\r
@@ -186,11 +199,11 @@ InstallXenArmTables (
   // Install DSDT table.\r
   //\r
   Status = AcpiProtocol->InstallAcpiTable (\r
-             AcpiProtocol,\r
-             DsdtTable,\r
-             DsdtTable->Length,\r
-             &TableHandle\r
-             );\r
+                           AcpiProtocol,\r
+                           DsdtTable,\r
+                           DsdtTable->Length,\r
+                           &TableHandle\r
+                           );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -204,15 +217,15 @@ FindAcpiTableProtocol (
   VOID\r
   )\r
 {\r
-  EFI_STATUS              Status;\r
-  EFI_ACPI_TABLE_PROTOCOL *AcpiTable;\r
+  EFI_STATUS               Status;\r
+  EFI_ACPI_TABLE_PROTOCOL  *AcpiTable;\r
 \r
   AcpiTable = NULL;\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiAcpiTableProtocolGuid,\r
-                  NULL,\r
-                  (VOID**)&AcpiTable\r
-                  );\r
+  Status    = gBS->LocateProtocol (\r
+                     &gEfiAcpiTableProtocolGuid,\r
+                     NULL,\r
+                     (VOID **)&AcpiTable\r
+                     );\r
   ASSERT_EFI_ERROR (Status);\r
   return AcpiTable;\r
 }\r
@@ -228,15 +241,14 @@ FindAcpiTableProtocol (
   @return EFI_OUT_OF_RESOURCES\r
 \r
 **/\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 XenAcpiPlatformEntryPoint (\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_STATUS  Status;\r
 \r
   Status = InstallXenArmTables (FindAcpiTableProtocol ());\r
   return Status;\r
index 3bda69257d35feb5fc21953505ca6be961d406f4..b629789371cb1a9a7073e8c005506845d8acb6e5 100644 (file)
 EFI_STATUS\r
 EFIAPI\r
 XenPlatformHasAcpiDt (\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_STATUS  Status;\r
 \r
   //\r
   // If we fail to install any of the necessary protocols below, the OS will be\r
index 5113c000b20304526169e602f0c7a83ca08a2b20..23d504cc64da362fe096d95634ece12bb84cce8c 100644 (file)
 EFI_STATUS\r
 EFIAPI\r
 InitializeXenioFdtDxe (\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
-  FDT_CLIENT_PROTOCOL   *FdtClient;\r
-  CONST UINT64          *Reg;\r
-  UINT32                RegSize;\r
-  UINTN                 AddressCells, SizeCells;\r
-  EFI_HANDLE            Handle;\r
-  UINT64                RegBase;\r
+  EFI_STATUS           Status;\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  CONST UINT64         *Reg;\r
+  UINT32               RegSize;\r
+  UINTN                AddressCells, SizeCells;\r
+  EFI_HANDLE           Handle;\r
+  UINT64               RegBase;\r
 \r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  Status = FdtClient->FindCompatibleNodeReg (FdtClient, "xen,xen",\r
-                        (CONST VOID **)&Reg, &AddressCells, &SizeCells,\r
-                        &RegSize);\r
+  Status = FdtClient->FindCompatibleNodeReg (\r
+                        FdtClient,\r
+                        "xen,xen",\r
+                        (CONST VOID **)&Reg,\r
+                        &AddressCells,\r
+                        &SizeCells,\r
+                        &RegSize\r
+                        );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_WARN, "%a: No 'xen,xen' compatible DT node found\n",\r
-      __FUNCTION__));\r
+    DEBUG ((\r
+      DEBUG_WARN,\r
+      "%a: No 'xen,xen' compatible DT node found\n",\r
+      __FUNCTION__\r
+      ));\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -52,11 +63,16 @@ InitializeXenioFdtDxe (
   // MMIO flavor of the XenBus root device I/O protocol\r
   //\r
   RegBase = SwapBytes64 (Reg[0]);\r
-  Handle = NULL;\r
-  Status = XenIoMmioInstall (&Handle, RegBase);\r
+  Handle  = NULL;\r
+  Status  = XenIoMmioInstall (&Handle, RegBase);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a: XenIoMmioInstall () failed on a new handle "\r
-      "(Status == %r)\n", __FUNCTION__, Status));\r
+    DEBUG ((\r
+      DEBUG_ERROR,\r
+      "%a: XenIoMmioInstall () failed on a new handle "\r
+      "(Status == %r)\n",\r
+      __FUNCTION__,\r
+      Status\r
+      ));\r
     return Status;\r
   }\r
 \r