]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/PcatSingleSegmentPciCfgPei/PciCfgInternal.h
Remove ${WORKSPACE}
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / PcatSingleSegmentPciCfgPei / PciCfgInternal.h
CommitLineData
12232778 1/**\r
2\r
3 Copyright (c) 2006 - 2007, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8\r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12**/\r
13\r
14#ifndef __PCICFGPPI_INTERLNAL_H_\r
15#define __PCICFGPPI_INTERLNAL_H_\r
16\r
17#include <PiPei.h>\r
18#include <FrameworkPei.h>\r
19\r
20#include <Ppi/PciCfg2.h>\r
21#include <Ppi/PciCfg.h>\r
22\r
23#include <Library/BaseLib.h>\r
24#include <Library/PcdLib.h>\r
25#include <Library/DebugLib.h>\r
26#include <Library/PciLib.h>\r
27#include <Library/PeimEntryPoint.h>\r
28\r
29#include <IndustryStandard\Pci.h>\r
30\r
31#define COMMON_TO_PCILIB_ADDRESS(A) (UINTN)PCI_LIB_ADDRESS( \\r
32 ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &A)->Bus, \\r
33 ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &A)->Device, \\r
34 ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &A)->Function, \\r
35 ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &A)->Register \\r
36 )\r
37\r
38\r
39/**\r
40 Reads from a given location in the PCI configuration space.\r
41\r
42 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
43\r
44 @param This Pointer to local data for the interface.\r
45\r
46 @param Width The width of the access. Enumerated in bytes.\r
47 See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
48\r
49 @param Address The physical address of the access. The format of\r
50 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
51\r
52 @param Buffer A pointer to the buffer of data..\r
53\r
54\r
55 @retval EFI_SUCCESS The function completed successfully.\r
56\r
57 @retval EFI_DEVICE_ERROR There was a problem with the transaction.\r
58\r
59 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this\r
60 time.\r
61\r
62**/\r
63EFI_STATUS\r
64EFIAPI \r
65PciCfg2Read (\r
66 IN CONST EFI_PEI_SERVICES **PeiServices,\r
67 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
68 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
69 IN UINT64 Address,\r
70 IN OUT VOID *Buffer\r
71);\r
72\r
73/**\r
74 Write to a given location in the PCI configuration space.\r
75\r
76 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
77\r
78 @param This Pointer to local data for the interface.\r
79\r
80 @param Width The width of the access. Enumerated in bytes.\r
81 See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
82\r
83 @param Address The physical address of the access. The format of\r
84 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
85\r
86 @param Buffer A pointer to the buffer of data..\r
87\r
88\r
89 @retval EFI_SUCCESS The function completed successfully.\r
90\r
91 @retval EFI_DEVICE_ERROR There was a problem with the transaction.\r
92\r
93 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this\r
94 time.\r
95\r
96**/\r
97EFI_STATUS\r
98EFIAPI \r
99PciCfg2Write (\r
100 IN CONST EFI_PEI_SERVICES **PeiServices,\r
101 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
102 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
103 IN UINT64 Address,\r
104 IN OUT VOID *Buffer\r
105);\r
106\r
107\r
108/**\r
109 PCI read-modify-write operation.\r
110\r
111 @param PeiServices An indirect pointer to the PEI Services Table\r
112 published by the PEI Foundation.\r
113\r
114 @param This Pointer to local data for the interface.\r
115\r
116 @param Width The width of the access. Enumerated in bytes. Type\r
117 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r
118\r
119 @param Address The physical address of the access.\r
120\r
121 @param SetBits Points to value to bitwise-OR with the read configuration value.\r
122\r
123 The size of the value is determined by Width.\r
124\r
125 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.\r
126 The size of the value is determined by Width.\r
127\r
128\r
129 @retval EFI_SUCCESS The function completed successfully.\r
130\r
131 @retval EFI_DEVICE_ERROR There was a problem with the transaction.\r
132\r
133 @retval EFI_DEVICE_NOT_READY The device is not capable of supporting\r
134 the operation at this time.\r
135\r
136**/\r
137EFI_STATUS\r
138EFIAPI \r
139PciCfg2Modify (\r
140 IN CONST EFI_PEI_SERVICES **PeiServices,\r
141 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
142 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
143 IN UINT64 Address,\r
144 IN CONST VOID *SetBits,\r
145 IN CONST VOID *ClearBits\r
146);\r
147\r
148\r
149\r
150/**\r
151 PCI read operation.\r
152\r
153 @param PeiServices An indirect pointer to the PEI Services Table\r
154 published by the PEI Foundation.\r
155 @param This Pointer to local data for the interface.\r
156 @param Width The width of the access. Enumerated in bytes.\r
157 @param Address The physical address of the access.\r
158 @param Buffer A pointer to the buffer of data.\r
159\r
160 @retval EFI_SUCCESS The function completed successfully.\r
161 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
162\r
163**/\r
164EFI_STATUS\r
165EFIAPI \r
166PciCfgRead (\r
167 IN EFI_PEI_SERVICES **PeiServices,\r
168 IN EFI_PEI_PCI_CFG_PPI *This,\r
169 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
170 IN UINT64 Address,\r
171 IN OUT VOID *Buffer\r
172 );\r
173\r
174/**\r
175 PCI write operation.\r
176\r
177 @param PeiServices An indirect pointer to the PEI Services Table\r
178 published by the PEI Foundation.\r
179 @param This Pointer to local data for the interface.\r
180 @param Width The width of the access. Enumerated in bytes.\r
181 @param Address The physical address of the access.\r
182 @param Buffer A pointer to the buffer of data.\r
183\r
184 @retval EFI_SUCCESS The function completed successfully.\r
185 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
186\r
187**/\r
188EFI_STATUS\r
189EFIAPI \r
190PciCfgWrite (\r
191 IN EFI_PEI_SERVICES **PeiServices,\r
192 IN EFI_PEI_PCI_CFG_PPI *This,\r
193 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
194 IN UINT64 Address,\r
195 IN OUT VOID *Buffer\r
196 );\r
197\r
198/**\r
199 PCI read-modify-write operation.\r
200\r
201 @param PeiServices An indirect pointer to the PEI Services Table\r
202 published by the PEI Foundation.\r
203 @param This Pointer to local data for the interface.\r
204 @param Width The width of the access. Enumerated in bytes.\r
205 @param Address The physical address of the access.\r
206 @param SetBits Value of the bits to set.\r
207 @param ClearBits Value of the bits to clear.\r
208\r
209 @retval EFI_SUCCESS The function completed successfully.\r
210\r
211**/\r
212EFI_STATUS\r
213EFIAPI \r
214PciCfgModify (\r
215 IN EFI_PEI_SERVICES **PeiServices,\r
216 IN EFI_PEI_PCI_CFG_PPI *This,\r
217 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
218 IN UINT64 Address,\r
219 IN UINTN SetBits,\r
220 IN UINTN ClearBits\r
221 );\r
222\r
223//\r
224// Global Variables\r
225//\r
226extern EFI_PEI_PCI_CFG_PPI gPciCfgPpi;\r
227extern EFI_PEI_PPI_DESCRIPTOR gPciCfgPpiList;\r
228\r
229\r
230#endif\r