]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.h
MdePkg/PciSegmentLib: Add instances that consumes PciSegmentInfoLib
[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 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _PCI_SEGMENT_LIB_COMMON_H_
17 #define _PCI_SEGMENT_LIB_COMMON_H_
18
19 #include <Base.h>
20 #include <IndustryStandard/PciExpress21.h>
21 #include <Library/BaseLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/IoLib.h>
24 #include <Library/PciSegmentLib.h>
25 #include <Library/PciSegmentInfoLib.h>
26
27 /**
28 Return the linear address for the physical address.
29
30 @param Address The physical address.
31
32 @retval The linear address.
33 **/
34 UINTN
35 PciSegmentLibVirtualAddress (
36 IN UINTN Address
37 );
38
39 /**
40 Internal function that converts PciSegmentLib format address that encodes the PCI Bus, Device,
41 Function and Register to ECAM (Enhanced Configuration Access Mechanism) address.
42
43 @param Address The address that encodes the PCI Bus, Device, Function and
44 Register.
45 @param SegmentInfo An array of PCI_SEGMENT_INFO holding the segment information.
46 @param Count Number of segments.
47
48 @retval ECAM address.
49 **/
50 UINTN
51 PciSegmentLibGetEcamAddress (
52 IN UINT64 Address,
53 IN CONST PCI_SEGMENT_INFO *SegmentInfo,
54 IN UINTN Count
55 );
56
57 #endif