2 Include file of PciSegmentPciRootBridgeIo Library.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __DXE_PCI_SEGMENT_LIB__
10 #define __DXE_PCI_SEGMENT_LIB__
13 #include <Protocol/PciRootBridgeIo.h>
15 #include <Library/PciSegmentLib.h>
16 #include <Library/BaseLib.h>
17 #include <Library/MemoryAllocationLib.h>
18 #include <Library/UefiBootServicesTableLib.h>
19 #include <Library/DebugLib.h>
21 #include <IndustryStandard/Acpi.h>
24 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*PciRootBridgeIo
;
28 } PCI_ROOT_BRIDGE_DATA
;
31 Assert the validity of a PCI Segment address.
32 A valid PCI Segment address should not contain 1's in bits 28..31 and 48..63
34 @param A The address to validate.
35 @param M Additional bits to assert to be zero.
38 #define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \
39 ASSERT (((A) & (0xffff0000f0000000ULL | (M))) == 0)
42 Translate PCI Lib address into format of PCI Root Bridge I/O Protocol
44 @param A The address that encodes the PCI Bus, Device, Function and
48 #define PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS(A) \
49 ((((UINT32)(A) << 4) & 0xff000000) | (((UINT32)(A) >> 4) & 0x00000700) | (((UINT32)(A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32)))