]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/PciCfg.h
Clean the public header files to remove the unnecessary include files.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / PciCfg.h
1 /** @file
2 This file declares PciCfg PPI used to access PCI configuration space in PEI
3
4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: PciCfg.h
14
15 @par Revision Reference:
16 This PPI is defined in PEI CIS
17 Version 0.91.
18
19 **/
20
21 #ifndef __PEI_PCI_CFG_H__
22 #define __PEI_PCI_CFG_H__
23
24 #include <Ppi/PciCfg2.h>
25 //
26 // Get the common definitions for EFI_PEI_PCI_CFG_PPI_WIDTH.
27 //
28
29 #define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
30 { \
31 0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \
32 }
33
34 typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
35
36 #define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \
37 (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \
38 ) & 0x00000000ffffffff
39
40 /**
41 PCI read and write operation.
42
43 @param PeiServices An indirect pointer to the PEI Services Table
44 published by the PEI Foundation.
45 @param This Pointer to local data for the interface.
46 @param Width The width of the access. Enumerated in bytes.
47 @param Address The physical address of the access.
48 @param Buffer A pointer to the buffer of data.
49
50 @retval EFI_SUCCESS The function completed successfully.
51 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
52
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *EFI_PEI_PCI_CFG_PPI_IO)(
57 IN EFI_PEI_SERVICES **PeiServices,
58 IN EFI_PEI_PCI_CFG_PPI *This,
59 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
60 IN UINT64 Address,
61 IN OUT VOID *Buffer
62 );
63
64 /**
65 PCI read-modify-write operation.
66
67 @param PeiServices An indirect pointer to the PEI Services Table
68 published by the PEI Foundation.
69 @param This Pointer to local data for the interface.
70 @param Width The width of the access. Enumerated in bytes.
71 @param Address The physical address of the access.
72 @param SetBits Value of the bits to set.
73 @param ClearBits Value of the bits to clear.
74
75 @retval EFI_SUCCESS The function completed successfully.
76
77 **/
78 typedef
79 EFI_STATUS
80 (EFIAPI *EFI_PEI_PCI_CFG_PPI_RW)(
81 IN EFI_PEI_SERVICES **PeiServices,
82 IN EFI_PEI_PCI_CFG_PPI *This,
83 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
84 IN UINT64 Address,
85 IN UINTN SetBits,
86 IN UINTN ClearBits
87 );
88
89 /**
90 The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
91 controllers behind a PCI root bridge controller.
92 **/
93 struct _EFI_PEI_PCI_CFG_PPI {
94 ///
95 /// PCI read services. See the Read() function description.
96 ///
97 EFI_PEI_PCI_CFG_PPI_IO Read;
98
99 ///
100 /// PCI write services. See the Write() function description.
101 ///
102 EFI_PEI_PCI_CFG_PPI_IO Write;
103
104 ///
105 /// PCI read-modify-write services. See the Modify() function description.
106 ///
107 EFI_PEI_PCI_CFG_PPI_RW Modify;
108 };
109
110 extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid;
111
112 #endif