VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h@ 109091

Last change on this file since 109091 was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/** @file
2 Include file of PciSegmentPciRootBridgeIo Library.
3
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __DXE_PCI_SEGMENT_LIB__
10#define __DXE_PCI_SEGMENT_LIB__
11
12#include <Protocol/PciRootBridgeIo.h>
13
14#include <Library/PciSegmentLib.h>
15#include <Library/BaseLib.h>
16#include <Library/MemoryAllocationLib.h>
17#include <Library/UefiBootServicesTableLib.h>
18#include <Library/DebugLib.h>
19
20#include <IndustryStandard/Acpi.h>
21
22typedef struct {
23 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
24 UINT32 SegmentNumber;
25 UINT64 MinBusNumber;
26 UINT64 MaxBusNumber;
27} PCI_ROOT_BRIDGE_DATA;
28
29/**
30 Assert the validity of a PCI Segment address.
31 A valid PCI Segment address should not contain 1's in bits 28..31 and 48..63
32
33 @param A The address to validate.
34 @param M Additional bits to assert to be zero.
35
36**/
37#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A, M) \
38 ASSERT (((A) & (0xffff0000f0000000ULL | (M))) == 0)
39
40/**
41 Translate PCI Lib address into format of PCI Root Bridge I/O Protocol
42
43 @param A The address that encodes the PCI Bus, Device, Function and
44 Register.
45
46**/
47#define PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS(A) \
48 ((((UINT32)(A) << 4) & 0xff000000) | (((UINT32)(A) >> 4) & 0x00000700) | (((UINT32)(A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32)))
49
50#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette