]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / PciSegmentLibSegmentInfo / PciSegmentLibCommon.h
1 /** @file
2 Provide common routines used by BasePciSegmentLibSegmentInfo and
3 DxeRuntimePciSegmentLibSegmentInfo libraries.
4
5 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _PCI_SEGMENT_LIB_COMMON_H_
11 #define _PCI_SEGMENT_LIB_COMMON_H_
12
13 #include <Base.h>
14 #include <IndustryStandard/PciExpress21.h>
15 #include <Library/BaseLib.h>
16 #include <Library/DebugLib.h>
17 #include <Library/IoLib.h>
18 #include <Library/PciSegmentLib.h>
19 #include <Library/PciSegmentInfoLib.h>
20
21 /**
22 Return the linear address for the physical address.
23
24 @param Address The physical address.
25
26 @retval The linear address.
27 **/
28 UINTN
29 PciSegmentLibVirtualAddress (
30 IN UINTN Address
31 );
32
33 /**
34 Internal function that converts PciSegmentLib format address that encodes the PCI Bus, Device,
35 Function and Register to ECAM (Enhanced Configuration Access Mechanism) address.
36
37 @param Address The address that encodes the PCI Bus, Device, Function and
38 Register.
39 @param SegmentInfo An array of PCI_SEGMENT_INFO holding the segment information.
40 @param Count Number of segments.
41
42 @retval ECAM address.
43 **/
44 UINTN
45 PciSegmentLibGetEcamAddress (
46 IN UINT64 Address,
47 IN CONST PCI_SEGMENT_INFO *SegmentInfo,
48 IN UINTN Count
49 );
50
51 #endif