MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 25 Feb 2016 09:13:31 +0000 (17:13 +0800)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 26 Feb 2016 12:31:51 +0000 (13:31 +0100)
commit6474f1f156eefa6886e594039f4d562e374ba344
tree53fa95d4843505033d2c9edea4c21348b7efb126
parent63b90643afb19f84e4cd3681a9a402ec65b1cf8d
MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent

The patch removes the assumption that the resources claimed by root
bridges should not exist. Because resources might have been added:
1. by platform modules either in PEI through resource HOB, or in DXE,
   before the PCI host bridge driver runs.
2. Resources claimed by different root bridges may overlap so that
   resource adding operation for latter root bridges may fail if
   we assume the resource should not exist.

In real world, this patch is to fit OVMF platform needs because
different root bridges in OVMF platform shares the same resources.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
[lersek@redhat.com: intersection-based implementation]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c