]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
Remove ambiguous auto-increment usage. (gcc warning)
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciResourceSupport.c
index a6ae80f4c5939e6692de7f5dee4536e831cbb744..1db77d15aed767dfcebe9e148b75bf674bc17aa3 100644 (file)
@@ -1,4 +1,4 @@
-/*++\r
+/**@file\r
 \r
 Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -9,17 +9,7 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  PciResourceSupport.c\r
-\r
-Abstract:\r
-\r
-  PCI Bus Driver\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
 \r
 #include "pcibus.h"\r
 #include "PciResourceSupport.h"\r
@@ -652,6 +642,7 @@ Returns:
   Node    = NULL;\r
 \r
   Node    = AllocatePool (sizeof (PCI_RESOURCE_NODE));\r
+  ASSERT (Node != NULL);\r
   if (Node == NULL) {\r
     return NULL;\r
   }\r
@@ -662,6 +653,13 @@ Returns:
   Node->PciDev        = PciDev;\r
   Node->Length        = Length;\r
   Node->Alignment     = Alignment;\r
+  if(((ResType == PciBarTypeIo16) || (ResType == PciBarTypeIo32)) && ( Alignment == 0x0FFF))\r
+  {\r
+    if((PciDev->Decodes & EFI_BRIDGE_IOEN1K_DECODE_SUPPORTED) == EFI_BRIDGE_IOEN1K_DECODE_SUPPORTED)\r
+      Node->Alignment = 0x3FF;\r
+    else\r
+      Node->Alignment = 0xFFF;\r
+  }\r
   Node->Bar           = Bar;\r
   Node->ResType       = ResType;\r
   Node->Reserved      = FALSE;\r
@@ -1022,7 +1020,10 @@ Returns:
     //\r
     // if no PMem32 request, still keep PMem64. Otherwise degrade to PMem32\r
     //\r
-    if (PMem32Node != NULL) {\r
+    if (PMem32Node != NULL && PMem32Node->Length != 0 && Bridge->Parent != NULL ) { \r
+      //\r
+      // Fixed the issue that there is no resource for 64-bit (above 4G)\r
+      //\r
       MergeResourceTree (\r
         PMem32Node,\r
         PMem64Node,\r