]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Include / EfiPciCfg.h
CommitLineData
3eb9473e 1/*++\r
2\r
3e99020d 3Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
f57387d5 4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiPciCfg.h\r
15\r
16Abstract:\r
17\r
18 Abstract the common fields of PciCfg definition between Framework 0.9x\r
19 and PI 1.0.\r
20 \r
21--*/\r
22\r
23#ifndef _EFI_PCI_CFG_H_\r
24#define _EFI_PCI_CFG_H_\r
25\r
26//\r
27// Framework specification 0.9x definition.\r
28//\r
29typedef enum {\r
30 PeiPciCfgWidthUint8 = 0,\r
31 PeiPciCfgWidthUint16 = 1,\r
32 PeiPciCfgWidthUint32 = 2,\r
33 PeiPciCfgWidthUint64 = 3,\r
34 PeiPciCfgWidthMaximum\r
35} PEI_PCI_CFG_PPI_WIDTH;\r
36\r
37#define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \\r
38 (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \\r
39 ) & 0x00000000ffffffff\r
40\r
41//\r
42// PI 1.0 definition.\r
43//\r
44typedef enum {\r
45 EfiPeiPciCfgWidthUint8 = 0,\r
46 EfiPeiPciCfgWidthUint16 = 1,\r
47 EfiPeiPciCfgWidthUint32 = 2,\r
48 EfiPeiPciCfgWidthUint64 = 3,\r
49 EfiPeiPciCfgWidthMaximum\r
50} EFI_PEI_PCI_CFG_PPI_WIDTH;\r
51\r
52#define EFI_PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) \\r
3e99020d
LG
53 (UINT64) ((((UINTN) (bus)) << 24) | \\r
54 (((UINTN) (dev)) << 16) | \\r
55 (((UINTN) (func)) << 8) | \\r
56 ((reg) < 256 ? ((UINTN) (reg)): ((UINT64) (reg) << 32)))\r
3eb9473e 57\r
58#if (PI_SPECIFICATION_VERSION < 0x00010000)\r
59\r
60typedef struct {\r
61 UINT8 Register;\r
62 UINT8 Function;\r
63 UINT8 Device;\r
64 UINT8 Bus;\r
65 UINT8 Reserved[4];\r
66} PEI_PCI_CFG_PPI_PCI_ADDRESS;\r
67\r
68typedef PEI_PCI_CFG_PPI_PCI_ADDRESS EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;\r
69\r
70#else\r
71\r
72typedef struct {\r
73 UINT8 Register;\r
74 UINT8 Function;\r
75 UINT8 Device;\r
76 UINT8 Bus;\r
77 UINT32 ExtendedRegister;\r
78} EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;\r
79#endif\r
80\r
81#endif\r