]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
Revert "EhciDxe: Use common buffer for AsyncInterruptTransfer"
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciResourceSupport.c
index 8dbe9a00380f253873f245d2bcb98269d5e5f314..f3e51d61508512f4c6e9e309318b0edebfedbfff 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   PCI resouces support functions implemntation for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -389,18 +389,7 @@ CalculateResourceAperture (
   }\r
 \r
   //\r
-  // Adjust the bridge's alignment to the MAX (first) alignment of all children.\r
-  //\r
-  CurrentLink = Bridge->ChildList.ForwardLink;\r
-  if (CurrentLink != &Bridge->ChildList) {\r
-    Node = RESOURCE_NODE_FROM_LINK (CurrentLink);\r
-    if (Node->Alignment > Bridge->Alignment) {\r
-      Bridge->Alignment = Node->Alignment;\r
-    }\r
-  }\r
-\r
-  //\r
-  // At last, adjust the aperture with the bridge's alignment\r
+  // Adjust the aperture with the bridge's alignment\r
   //\r
   Aperture[PciResUsageTypical] = ALIGN_VALUE (Aperture[PciResUsageTypical], Bridge->Alignment + 1);\r
   Aperture[PciResUsagePadding] = ALIGN_VALUE (Aperture[PciResUsagePadding], Bridge->Alignment + 1);\r
@@ -410,6 +399,17 @@ CalculateResourceAperture (
   // Use the larger one between the padding resource and actual occupied resource.\r
   //\r
   Bridge->Length = MAX (Aperture[PciResUsageTypical], Aperture[PciResUsagePadding]);\r
+\r
+  //\r
+  // Adjust the bridge's alignment to the MAX (first) alignment of all children.\r
+  //\r
+  CurrentLink = Bridge->ChildList.ForwardLink;\r
+  if (CurrentLink != &Bridge->ChildList) {\r
+    Node = RESOURCE_NODE_FROM_LINK (CurrentLink);\r
+    if (Node->Alignment > Bridge->Alignment) {\r
+      Bridge->Alignment = Node->Alignment;\r
+    }\r
+  }\r
 }\r
 \r
 /**\r
@@ -1116,7 +1116,7 @@ DegradeResource (
         PMem64Node,\r
         TRUE\r
         );\r
-    } \r
+    }\r
 \r
     //\r
     // if both PMEM64 and PMEM32 requests from child devices, which can not be satisfied\r