]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/IncompPciDeviceSupport: Use correct descriptor length
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 13 Jun 2018 08:53:17 +0000 (16:53 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 14 Jun 2018 08:38:15 +0000 (16:38 +0800)
Per PI spec, the Length value is the length of the ACPI descriptor
in bytes, excluding the first two fields.
The patch fixes the code to report the correct descriptor length
by excluding 3-byte first two fields.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c

index 149662d14dc17f8c22c3a97cf7e791ddb3c6debf..da8daba87d80f26d9f69ebcd5dad8f99896183a5 100644 (file)
@@ -5,7 +5,7 @@
   Incompatible PCI Device Support protocol allows the PCI bus driver to support\r
   resource allocation for some PCI devices that do not comply with the PCI Specification.\r
 \r
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 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
@@ -344,7 +344,7 @@ PCheckDevice (
         Dsc = (EFI_PCI_RESOUCE_DESCRIPTOR *) (ListPtr + 1);\r
 \r
         AcpiPtr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR;\r
-        AcpiPtr->Len = (UINT16) sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR);\r
+        AcpiPtr->Len = (UINT16) sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3;\r
         AcpiPtr->ResType = (UINT8) Dsc->ResType;\r
         AcpiPtr->GenFlag = (UINT8) Dsc->GenFlag;\r
         AcpiPtr->SpecificFlag = (UINT8) Dsc->SpecificFlag;\r