VirtualBox

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

Last change on this file since 89916 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), 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
13#include <Protocol/PciRootBridgeIo.h>
14
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>
20
21#include <IndustryStandard/Acpi.h>
22
23typedef struct {
24 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
25 UINT32 SegmentNumber;
26 UINT64 MinBusNumber;
27 UINT64 MaxBusNumber;
28} PCI_ROOT_BRIDGE_DATA;
29
30/**
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
33
34 @param A The address to validate.
35 @param M Additional bits to assert to be zero.
36
37**/
38#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \
39 ASSERT (((A) & (0xffff0000f0000000ULL | (M))) == 0)
40
41/**
42 Translate PCI Lib address into format of PCI Root Bridge I/O Protocol
43
44 @param A The address that encodes the PCI Bus, Device, Function and
45 Register.
46
47**/
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)))
50
51#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