]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegmentLib.c
2 Instance of Base PCI Segment Library that support multi-segment PCI configuration access.
4 PCI Segment Library that consumes segment information provided by PciSegmentInfoLib to
5 support multi-segment PCI configuration access through enhanced configuration access mechanism.
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include "PciSegmentLibCommon.h"
15 Return the virtual address for the physical address.
17 @param Address The physical address.
19 @retval The virtual address.
22 PciSegmentLibVirtualAddress (
30 Register a PCI device so PCI configuration registers may be accessed after
31 SetVirtualAddressMap().
33 If any reserved bits in Address are set, then ASSERT().
35 @param Address The address that encodes the PCI Bus, Device, Function and
38 @retval RETURN_SUCCESS The PCI device was registered for runtime access.
39 @retval RETURN_UNSUPPORTED An attempt was made to call this function
40 after ExitBootServices().
41 @retval RETURN_UNSUPPORTED The resources required to access the PCI device
42 at runtime could not be mapped.
43 @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
44 complete the registration.
49 PciSegmentRegisterForRuntimeAccess (
54 // Use PciSegmentLibGetEcamAddress() to validate the Address.
58 PCI_SEGMENT_INFO
*SegmentInfo
;
60 SegmentInfo
= GetPciSegmentInfo (&Count
);
61 PciSegmentLibGetEcamAddress (Address
, SegmentInfo
, Count
);
63 return RETURN_SUCCESS
;