TianoCore EDK2 master
|
#include <Library/PciHostBridgeLib.h>
Go to the source code of this file.
Provide common utility functions to PciHostBridgeLib instances in ArmVirtPkg and OvmfPkg.
Copyright (C) 2016, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
Copyright (c) 2020, Huawei Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciHostBridgeUtilityLib.h.
VOID EFIAPI PciHostBridgeUtilityFreeRootBridges | ( | IN PCI_ROOT_BRIDGE * | Bridges, |
IN UINTN | Count | ||
) |
Utility function to free root bridge instances array from PciHostBridgeUtilityGetRootBridges().
[in] | Bridges | The root bridge instances array. |
[in] | Count | The count of the array. |
Definition at line 150 of file ArmVirtPciHostBridgeUtilityLib.c.
PCI_ROOT_BRIDGE *EFIAPI PciHostBridgeUtilityGetRootBridges | ( | OUT UINTN * | Count, |
IN UINT64 | Attributes, | ||
IN UINT64 | AllocationAttributes, | ||
IN BOOLEAN | DmaAbove4G, | ||
IN BOOLEAN | NoExtendedConfigSpace, | ||
IN UINTN | BusMin, | ||
IN UINTN | BusMax, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Io, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Mem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | MemAbove4G, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMemAbove4G | ||
) |
Utility function to return all the root bridge instances in an array.
[out] | Count | The number of root bridge instances. |
[in] | Attributes | Initial attributes. |
[in] | AllocAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | BusMin | Minimum Bus number, inclusive. |
[in] | BusMax | Maximum Bus number, inclusive. |
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
Utility function to return all the root bridge instances in an array.
[out] | Count | The number of root bridge instances. |
[in] | Attributes | Initial attributes. |
[in] | AllocationAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | BusMin | Minimum Bus number, inclusive. |
[in] | BusMax | Maximum Bus number, inclusive. |
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
Definition at line 85 of file ArmVirtPciHostBridgeUtilityLib.c.
EFI_STATUS EFIAPI PciHostBridgeUtilityInitRootBridge | ( | IN UINT64 | Supports, |
IN UINT64 | Attributes, | ||
IN UINT64 | AllocAttributes, | ||
IN BOOLEAN | DmaAbove4G, | ||
IN BOOLEAN | NoExtendedConfigSpace, | ||
IN UINT8 | RootBusNumber, | ||
IN UINT8 | MaxSubBusNumber, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Io, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Mem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | MemAbove4G, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMemAbove4G, | ||
OUT PCI_ROOT_BRIDGE * | RootBus | ||
) |
Utility function to initialize a PCI_ROOT_BRIDGE structure.
[in] | Supports | Supported attributes. |
[in] | Attributes | Initial attributes. |
[in] | AllocAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | RootBusNumber | The bus number to store in RootBus. |
[in] | MaxSubBusNumber | The inclusive maximum bus number that can be assigned to any subordinate bus found behind any PCI bridge hanging off this root bus. |
The caller is repsonsible for ensuring that RootBusNumber <= MaxSubBusNumber. If RootBusNumber equals MaxSubBusNumber, then the root bus has no room for subordinate buses.
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
[out] | RootBus | The PCI_ROOT_BRIDGE structure (allocated by the caller) that should be filled in by this function. |
EFI_SUCCESS | Initialization successful. A device path consisting of an ACPI device path node, with UID = RootBusNumber, has been allocated and linked into RootBus. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 113 of file PciHostBridgeUtilityLib.c.
VOID EFIAPI PciHostBridgeUtilityResourceConflict | ( | IN VOID * | Configuration | ) |
Utility function to inform the platform that the resource conflict happens.
[in] | Configuration | Pointer to PCI I/O and PCI memory resource descriptors. The Configuration contains the resources for all the root bridges. The resource for each root bridge is terminated with END descriptor and an additional END is appended indicating the end of the entire resources. The resource descriptor field values follow the description in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL .SubmitResources(). |
Definition at line 174 of file ArmVirtPciHostBridgeUtilityLib.c.
VOID EFIAPI PciHostBridgeUtilityUninitRootBridge | ( | IN PCI_ROOT_BRIDGE * | RootBus | ) |
Utility function to uninitialize a PCI_ROOT_BRIDGE structure set up with PciHostBridgeUtilityInitRootBridge().
[in] | RootBus | The PCI_ROOT_BRIDGE structure, allocated by the caller and initialized with PciHostBridgeUtilityInitRootBridge(), that should be uninitialized. This function doesn't free RootBus. |
Definition at line 187 of file PciHostBridgeUtilityLib.c.