]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
Refine soma code to make code run safely.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciEnumerator.c
index 6c1de3f3e6a8d7821d953de000a7bb24339899b0..09b58ac0ded6608db1e484defe2300cc509a7667 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   PCI eunmeration implementation on entire PCI bus system for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2009, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -126,6 +126,7 @@ PciEnumerator (
 \r
   gFullEnumeration = FALSE;\r
 \r
+  Handle = NULL;\r
   Status = gBS->InstallProtocolInterface (\r
                   &Handle,\r
                   &gEfiPciEnumerationCompleteProtocolGuid,\r
@@ -474,6 +475,7 @@ DetermineRootBridgeAttributes (
   }\r
 \r
   if ((Attributes & EFI_PCI_HOST_BRIDGE_MEM64_DECODE) != 0) {\r
+    RootBridgeDev->Decodes |= EFI_BRIDGE_MEM64_DECODE_SUPPORTED;\r
     RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM64_DECODE_SUPPORTED;\r
   }\r
 \r
@@ -981,7 +983,7 @@ PciHostBridgeAdjustAllocation (
       // Have no way to get ReqRes, AllocRes & Bar here\r
       //\r
       ZeroMem (&AllocFailExtendedData, sizeof (AllocFailExtendedData));\r
-      AllocFailExtendedData.DevicePathSize = sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
+      AllocFailExtendedData.DevicePathSize = (UINT16) sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
       AllocFailExtendedData.DevicePath     = (UINT8 *) PciResNode->PciDev->DevicePath;\r
       AllocFailExtendedData.Bar            = PciResNode->Bar;\r
 \r
@@ -1106,7 +1108,7 @@ ConstructAcpiResourceRequestor (
     //\r
     if ((Aperture & 0x01) != 0) {\r
       Ptr->Desc     = ACPI_ADDRESS_SPACE_DESCRIPTOR;\r
-      Ptr->Len      = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3;\r
+      Ptr->Len      = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3);\r
       //\r
       // Io\r
       //\r
@@ -1427,7 +1429,7 @@ PciBridgeResourceAllocator (
   IoBridge = CreateResourceNode (\r
                Bridge,\r
                0,\r
-               0xFFF,\r
+               Bridge->BridgeIoAlignment,\r
                0,\r
                PciBarTypeIo16,\r
                PciResUsageTypical\r