013c111 ArmVirtualizationPkg: clone BasePciExpressLib, cache PCIe config base

Authored and Committed by lersek 9 years ago
    ArmVirtualizationPkg: clone BasePciExpressLib, cache PCIe config base
    
    The BarExisted() function in
    "MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c" raises the TPL to
    TPL_HIGH_LEVEL before accessing PCI config space.
    
    The PciExpressLib instance under "MdePkg/Library/BasePciExpressLib" --
    serving the PCI config space access -- calls
    PcdGet64(PcdPciExpressBaseAddress) in turn, for each such call.
    
    The PcdGet64() function, when issued at TPL_HIGH_LEVEL, triggers an
    ASSERT(). PcdGet64() is based on a protocol in this UEFI phase, and
    protocol handler services are not allowed above TPL_NOTIFY (see Table 23
    "TPL Restrictions" in the UEFI spec).
    
    Clone the library, and in a new constructor, cache the PCD in a global
    variable.
    
    Contributed-under: TianoCore Contribution Agreement 1.0
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>