]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / PciSegmentLibSegmentInfo / DxeRuntimePciSegmentLib.c
index 75931d46e0b52871f4ba8c19bb55e18b65b7f5bf..a6860b471f3a9d5217c8883ae0da38fc848021d3 100644 (file)
 /// Define table for mapping PCI Segment MMIO physical addresses to virtual addresses at OS runtime\r
 ///\r
 typedef struct {\r
-  UINTN  PhysicalAddress;\r
-  UINTN  VirtualAddress;\r
+  UINTN    PhysicalAddress;\r
+  UINTN    VirtualAddress;\r
 } PCI_SEGMENT_RUNTIME_REGISTRATION_TABLE;\r
 \r
 ///\r
 /// Set Virtual Address Map Event\r
 ///\r
-EFI_EVENT                               mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL;\r
+EFI_EVENT  mDxeRuntimePciSegmentLibVirtualNotifyEvent = NULL;\r
 \r
 ///\r
 /// The number of PCI devices that have been registered for runtime access.\r
 ///\r
-UINTN                                   mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0;\r
+UINTN  mDxeRuntimePciSegmentLibNumberOfRuntimeRanges = 0;\r
 \r
 ///\r
 /// The table of PCI devices that have been registered for runtime access.\r
@@ -44,7 +44,7 @@ PCI_SEGMENT_RUNTIME_REGISTRATION_TABLE  *mDxeRuntimePciSegmentLibRegistrationTab
 ///\r
 /// The table index of the most recent virtual address lookup.\r
 ///\r
-UINTN                                   mDxeRuntimePciSegmentLibLastRuntimeRange = 0;\r
+UINTN  mDxeRuntimePciSegmentLibLastRuntimeRange = 0;\r
 \r
 /**\r
   Convert the physical PCI Express MMIO addresses for all registered PCI devices\r
@@ -60,8 +60,8 @@ DxeRuntimePciSegmentLibVirtualNotify (
   IN VOID       *Context\r
   )\r
 {\r
-  UINTN         Index;\r
-  EFI_STATUS    Status;\r
+  UINTN       Index;\r
+  EFI_STATUS  Status;\r
 \r
   //\r
   // If there have been no runtime registrations, then just return\r
@@ -75,14 +75,14 @@ DxeRuntimePciSegmentLibVirtualNotify (
   // virtual addresses.\r
   //\r
   for (Index = 0; Index < mDxeRuntimePciSegmentLibNumberOfRuntimeRanges; Index++) {\r
-    Status = EfiConvertPointer (0, (VOID **) &(mDxeRuntimePciSegmentLibRegistrationTable[Index].VirtualAddress));\r
+    Status = EfiConvertPointer (0, (VOID **)&(mDxeRuntimePciSegmentLibRegistrationTable[Index].VirtualAddress));\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
   //\r
   // Convert table pointer that is allocated from EfiRuntimeServicesData to a virtual address.\r
   //\r
-  Status = EfiConvertPointer (0, (VOID **) &mDxeRuntimePciSegmentLibRegistrationTable);\r
+  Status = EfiConvertPointer (0, (VOID **)&mDxeRuntimePciSegmentLibRegistrationTable);\r
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
@@ -194,7 +194,7 @@ PciSegmentRegisterForRuntimeAccess (
   // Convert Address to a ECAM address at the beginning of the PCI Configuration\r
   // header for the specified PCI Bus/Dev/Func\r
   //\r
-  Address &= ~(UINTN)EFI_PAGE_MASK;\r
+  Address    &= ~(UINTN)EFI_PAGE_MASK;\r
   SegmentInfo = GetPciSegmentInfo (&Count);\r
   EcamAddress = PciSegmentLibGetEcamAddress (Address, SegmentInfo, Count);\r
 \r
@@ -204,9 +204,11 @@ PciSegmentRegisterForRuntimeAccess (
   if (EfiAtRuntime ()) {\r
     return RETURN_UNSUPPORTED;\r
   }\r
+\r
   if (sizeof (UINTN) == sizeof (UINT32)) {\r
     ASSERT (EcamAddress < BASE_4GB);\r
   }\r
+\r
   Address = (UINTN)EcamAddress;\r
 \r
   //\r
@@ -246,7 +248,8 @@ PciSegmentRegisterForRuntimeAccess (
   if (NewTable == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
   }\r
-  mDxeRuntimePciSegmentLibRegistrationTable = NewTable;\r
+\r
+  mDxeRuntimePciSegmentLibRegistrationTable                                                                = NewTable;\r
   mDxeRuntimePciSegmentLibRegistrationTable[mDxeRuntimePciSegmentLibNumberOfRuntimeRanges].PhysicalAddress = Address;\r
   mDxeRuntimePciSegmentLibRegistrationTable[mDxeRuntimePciSegmentLibNumberOfRuntimeRanges].VirtualAddress  = Address;\r
   mDxeRuntimePciSegmentLibNumberOfRuntimeRanges++;\r
@@ -263,10 +266,11 @@ PciSegmentRegisterForRuntimeAccess (
 **/\r
 UINTN\r
 PciSegmentLibVirtualAddress (\r
-  IN UINTN                     Address\r
+  IN UINTN  Address\r
   )\r
 {\r
-  UINTN                        Index;\r
+  UINTN  Index;\r
+\r
   //\r
   // If SetVirtualAddressMap() has not been called, then just return the physical address\r
   //\r