]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
OvmfPkg: introduce PciCapPciSegmentLib
[mirror_edk2.git] / OvmfPkg / Library / BasePciCapPciSegmentLib / BasePciCapPciSegmentLib.h
1 /** @file
2 Plug a PciSegmentLib backend into PciCapLib, for config space access --
3 internal macro and type definitions.
4
5 Copyright (C) 2018, Red Hat, Inc.
6
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 **/
15
16 #ifndef __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__
17 #define __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__
18
19 #include <Library/DebugLib.h>
20
21 #include <Library/PciCapPciSegmentLib.h>
22
23 #define SEGMENT_DEV_SIG SIGNATURE_64 ('P', 'C', 'P', 'S', 'G', 'M', 'N', 'T')
24
25 typedef struct {
26 //
27 // Signature identifying the derived class.
28 //
29 UINT64 Signature;
30 //
31 // Members added by the derived class, specific to the use of PciSegmentLib.
32 //
33 PCI_CAP_DOMAIN MaxDomain;
34 UINT16 SegmentNr;
35 UINT8 BusNr;
36 UINT8 DeviceNr;
37 UINT8 FunctionNr;
38 //
39 // Base class.
40 //
41 PCI_CAP_DEV BaseDevice;
42 } SEGMENT_DEV;
43
44 #define SEGMENT_DEV_FROM_PCI_CAP_DEV(PciDevice) \
45 CR (PciDevice, SEGMENT_DEV, BaseDevice, SEGMENT_DEV_SIG)
46
47 #endif // __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__