From e5ceb6c9d39086460e6b5933e40815be57684b84 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 23 Feb 2015 16:04:00 +0000 Subject: ArmVirtualizationPkg/PciHostBridgeDxe: handle 0 in GetProposedResources() 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 Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16908 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c index bf78ded541..6332f79cbc 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c @@ -1079,7 +1079,15 @@ GetProposedResources( } if (Number == 0) { - return EFI_INVALID_PARAMETER; + EFI_ACPI_END_TAG_DESCRIPTOR *End; + + End = AllocateZeroPool (sizeof *End); + if (End == NULL) { + return EFI_OUT_OF_RESOURCES; + } + End->Desc = ACPI_END_TAG_DESCRIPTOR; + *Configuration = End; + return EFI_SUCCESS; } Buffer = AllocateZeroPool (Number * sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof(EFI_ACPI_END_TAG_DESCRIPTOR)); -- cgit v1.2.3