]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtualizationPkg/PciHostBridgeDxe: handle 0 in GetProposedResources()
authorLaszlo Ersek <lersek@redhat.com>
Mon, 23 Feb 2015 16:04:00 +0000 (16:04 +0000)
committerlersek <lersek@Edk2>
Mon, 23 Feb 2015 16:04:00 +0000 (16:04 +0000)
When there are no devices connected to the root bridge, no resources are
needed. GetProposedResources() currently considers this an invalid
condition (the PI spec doesn't regulate it).

Emitting an empty set of EFI_ACPI_ADDRESS_SPACE_DESCRIPTORs, followed by
the required EFI_ACPI_END_TAG_DESCRIPTOR, allows
PciHostBridgeResourceAllocator() [MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c]
to advance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <Olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16908 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c

index bf78ded541fe8249637f177d6038e0bb7bd14fae..6332f79cbc533a73d65dddc50980472b252a1fd7 100644 (file)
@@ -1079,7 +1079,15 @@ GetProposedResources(
       }\r
       \r
       if (Number ==  0) {\r
-        return EFI_INVALID_PARAMETER;\r
+        EFI_ACPI_END_TAG_DESCRIPTOR *End;\r
+\r
+        End = AllocateZeroPool (sizeof *End);\r
+        if (End == NULL) {\r
+          return EFI_OUT_OF_RESOURCES;\r
+        }\r
+        End->Desc = ACPI_END_TAG_DESCRIPTOR;\r
+        *Configuration = End;\r
+        return EFI_SUCCESS;\r
       }\r
 \r
       Buffer = AllocateZeroPool (Number * sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof(EFI_ACPI_END_TAG_DESCRIPTOR));\r