]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/CpuIo.h
Grammatical and disclaimer changes (does not follow internal C coding stds.)
[mirror_edk2.git] / MdePkg / Include / Ppi / CpuIo.h
CommitLineData
5879b875 1/** @file\r
80ae2a58 2 This PPI provides a set of memory and I/O-based services. \r
d7132512 3 The perspective of the services is that of the processor, not the bus or system.\r
5879b875 4\r
af2dc6a7 5Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved<BR>\r
6This program and the accompanying materials are licensed and made available under \r
7the terms and conditions of the BSD License that accompanies this distribution. \r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php. \r
5879b875 10\r
af2dc6a7 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
5879b875 13\r
5879b875 14 @par Revision Reference:\r
0047820e 15 This PPI is introduced in PI Version 1.0.\r
5879b875 16 \r
17**/\r
18\r
19#ifndef __PEI_CPUIO_PPI_H__\r
20#define __PEI_CPUIO_PPI_H__\r
21\r
22#define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \\r
23 { 0xe6af1f7b, 0xfc3f, 0x46da, {0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82 } }\r
24\r
25typedef struct _EFI_PEI_CPU_IO_PPI EFI_PEI_CPU_IO_PPI;\r
26\r
06889842 27///\r
af2dc6a7 28/// EFI_PEI_CPU_IO_PPI_WIDTH.\r
06889842 29///\r
5879b875 30typedef enum {\r
31 EfiPeiCpuIoWidthUint8,\r
32 EfiPeiCpuIoWidthUint16,\r
33 EfiPeiCpuIoWidthUint32,\r
34 EfiPeiCpuIoWidthUint64,\r
35 EfiPeiCpuIoWidthFifoUint8,\r
36 EfiPeiCpuIoWidthFifoUint16,\r
37 EfiPeiCpuIoWidthFifoUint32,\r
38 EfiPeiCpuIoWidthFifoUint64,\r
39 EfiPeiCpuIoWidthFillUint8,\r
40 EfiPeiCpuIoWidthFillUint16,\r
41 EfiPeiCpuIoWidthFillUint32,\r
42 EfiPeiCpuIoWidthFillUint64,\r
43 EfiPeiCpuIoWidthMaximum\r
44} EFI_PEI_CPU_IO_PPI_WIDTH;\r
45\r
46/**\r
47 Memory-based access services and I/O-based access services.\r
48\r
7c1c4dcf 49 @param[in] PeiServices An indirect pointer to the PEI Services Table\r
50 published by the PEI Foundation.\r
af2dc6a7 51 @param[in] This The pointer to local data for the interface.\r
7c1c4dcf 52 @param[in] Width The width of the access. Enumerated in bytes.\r
53 @param[in] Address The physical address of the access.\r
54 @param[in] Count The number of accesses to perform.\r
55 @param[in, out] Buffer A pointer to the buffer of data.\r
5879b875 56\r
7c1c4dcf 57 @retval EFI_SUCCESS The function completed successfully.\r
58 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
5879b875 59\r
60**/\r
61typedef\r
62EFI_STATUS\r
8b13229b 63(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM)(\r
7c1c4dcf 64 IN CONST EFI_PEI_SERVICES **PeiServices,\r
65 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
66 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
67 IN UINT64 Address,\r
68 IN UINTN Count,\r
69 IN OUT VOID *Buffer\r
5879b875 70 );\r
71\r
06889842 72///\r
06889842 73/// EFI_PEI_CPU_IO_PPI_ACCESS\r
06889842 74///\r
5879b875 75typedef struct {\r
dafa11b1 76 ///\r
77 /// This service provides the various modalities of memory and I/O read.\r
78 ///\r
7c1c4dcf 79 EFI_PEI_CPU_IO_PPI_IO_MEM Read;\r
dafa11b1 80 ///\r
81 /// This service provides the various modalities of memory and I/O write.\r
82 ///\r
7c1c4dcf 83 EFI_PEI_CPU_IO_PPI_IO_MEM Write;\r
5879b875 84} EFI_PEI_CPU_IO_PPI_ACCESS;\r
85\r
86/**\r
87 8-bit I/O read operations.\r
88\r
80ae2a58 89 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
90 by the PEI Foundation.\r
af2dc6a7 91 @param[in] This The pointer to local data for the interface.\r
80ae2a58 92 @param[in] Address The physical address of the access.\r
5879b875 93\r
7c1c4dcf 94 @return An 8-bit value returned from the I/O space.\r
5879b875 95\r
96**/\r
97typedef\r
98UINT8\r
8b13229b 99(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(\r
7c1c4dcf 100 IN CONST EFI_PEI_SERVICES **PeiServices,\r
101 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
102 IN UINT64 Address\r
5879b875 103 );\r
104\r
105/**\r
106 16-bit I/O read operations.\r
107\r
80ae2a58 108 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
109 by the PEI Foundation.\r
af2dc6a7 110 @param[in] This The pointer to local data for the interface.\r
80ae2a58 111 @param[in] Address The physical address of the access.\r
5879b875 112\r
7c1c4dcf 113 @return A 16-bit value returned from the I/O space.\r
5879b875 114\r
115**/\r
116typedef\r
117UINT16\r
8b13229b 118(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(\r
7c1c4dcf 119 IN CONST EFI_PEI_SERVICES **PeiServices,\r
120 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
121 IN UINT64 Address\r
5879b875 122 );\r
123\r
124/**\r
125 32-bit I/O read operations.\r
126\r
80ae2a58 127 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
128 by the PEI Foundation.\r
af2dc6a7 129 @param[in] This The pointer to local data for the interface.\r
80ae2a58 130 @param[in] Address The physical address of the access.\r
5879b875 131\r
7c1c4dcf 132 @return A 32-bit value returned from the I/O space.\r
5879b875 133\r
134**/\r
135typedef\r
136UINT32\r
8b13229b 137(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32)(\r
7c1c4dcf 138 IN CONST EFI_PEI_SERVICES **PeiServices,\r
139 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
140 IN UINT64 Address\r
5879b875 141 );\r
142\r
143/**\r
144 64-bit I/O read operations.\r
145\r
80ae2a58 146 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
147 by the PEI Foundation.\r
af2dc6a7 148 @param[in] This The pointer to local data for the interface.\r
80ae2a58 149 @param[in] Address The physical address of the access.\r
5879b875 150\r
7c1c4dcf 151 @return A 64-bit value returned from the I/O space.\r
5879b875 152\r
153**/\r
154typedef\r
155UINT64\r
8b13229b 156(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(\r
7c1c4dcf 157 IN CONST EFI_PEI_SERVICES **PeiServices,\r
158 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
159 IN UINT64 Address\r
5879b875 160 );\r
161\r
162/**\r
163 8-bit I/O write operations.\r
164\r
80ae2a58 165 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
166 by the PEI Foundation.\r
af2dc6a7 167 @param[in] This The pointer to local data for the interface.\r
80ae2a58 168 @param[in] Address The physical address of the access.\r
169 @param[in] Data The data to write.\r
5879b875 170\r
5879b875 171**/\r
172typedef\r
173VOID\r
8b13229b 174(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(\r
7c1c4dcf 175 IN CONST EFI_PEI_SERVICES **PeiServices,\r
176 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
177 IN UINT64 Address,\r
178 IN UINT8 Data\r
5879b875 179 );\r
180\r
181/**\r
182 16-bit I/O write operations.\r
183\r
80ae2a58 184 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
185 by the PEI Foundation.\r
af2dc6a7 186 @param[in] This The pointer to local data for the interface.\r
80ae2a58 187 @param[in] Address The physical address of the access.\r
188 @param[in] Data The data to write.\r
5879b875 189\r
5879b875 190**/\r
191typedef\r
192VOID\r
8b13229b 193(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(\r
7c1c4dcf 194 IN CONST EFI_PEI_SERVICES **PeiServices,\r
195 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
196 IN UINT64 Address,\r
197 IN UINT16 Data\r
5879b875 198 );\r
199\r
200/**\r
201 32-bit I/O write operations.\r
202\r
80ae2a58 203 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
204 by the PEI Foundation.\r
af2dc6a7 205 @param[in] This The pointer to local data for the interface.\r
80ae2a58 206 @param[in] Address The physical address of the access.\r
207 @param[in] Data The data to write.\r
5879b875 208\r
5879b875 209**/\r
210typedef\r
211VOID\r
8b13229b 212(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(\r
7c1c4dcf 213 IN CONST EFI_PEI_SERVICES **PeiServices,\r
214 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
215 IN UINT64 Address,\r
216 IN UINT32 Data\r
5879b875 217 );\r
218\r
219/**\r
220 64-bit I/O write operations.\r
221\r
80ae2a58 222 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
223 by the PEI Foundation.\r
af2dc6a7 224 @param[in] This The pointer to local data for the interface.\r
80ae2a58 225 @param[in] Address The physical address of the access.\r
226 @param[in] Data The data to write.\r
5879b875 227\r
5879b875 228**/\r
229typedef\r
230VOID\r
8b13229b 231(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(\r
7c1c4dcf 232 IN CONST EFI_PEI_SERVICES **PeiServices,\r
233 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
234 IN UINT64 Address,\r
235 IN UINT64 Data\r
5879b875 236 );\r
237\r
238/**\r
dafa11b1 239 8-bit memory read operations.\r
5879b875 240\r
80ae2a58 241 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
242 by the PEI Foundation.\r
af2dc6a7 243 @param[in] This The pointer to local data for the interface.\r
80ae2a58 244 @param[in] Address The physical address of the access.\r
5879b875 245\r
7c1c4dcf 246 @return An 8-bit value returned from the memory space.\r
5879b875 247\r
248**/\r
249typedef\r
250UINT8\r
8b13229b 251(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(\r
7c1c4dcf 252 IN CONST EFI_PEI_SERVICES **PeiServices,\r
253 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
254 IN UINT64 Address\r
5879b875 255 );\r
256\r
257/**\r
dafa11b1 258 16-bit memory read operations.\r
5879b875 259\r
80ae2a58 260 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
261 by the PEI Foundation.\r
af2dc6a7 262 @param[in] This The pointer to local data for the interface.\r
80ae2a58 263 @param[in] Address The physical address of the access.\r
5879b875 264\r
7c1c4dcf 265 @return A 16-bit value returned from the memory space.\r
5879b875 266\r
267**/\r
268typedef\r
269UINT16\r
8b13229b 270(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(\r
7c1c4dcf 271 IN CONST EFI_PEI_SERVICES **PeiServices,\r
272 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
273 IN UINT64 Address\r
5879b875 274 );\r
275\r
276/**\r
dafa11b1 277 32-bit memory read operations.\r
5879b875 278\r
80ae2a58 279 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
280 by the PEI Foundation.\r
af2dc6a7 281 @param[in] This The pointer to local data for the interface.\r
80ae2a58 282 @param[in] Address The physical address of the access.\r
5879b875 283\r
7c1c4dcf 284 @return A 32-bit value returned from the memory space.\r
5879b875 285\r
286**/\r
287typedef\r
288UINT32\r
8b13229b 289(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(\r
7c1c4dcf 290 IN CONST EFI_PEI_SERVICES **PeiServices,\r
291 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
292 IN UINT64 Address\r
5879b875 293 );\r
294\r
295/**\r
dafa11b1 296 64-bit memory read operations.\r
5879b875 297\r
80ae2a58 298 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
299 by the PEI Foundation.\r
af2dc6a7 300 @param[in] This The pointer to local data for the interface.\r
80ae2a58 301 @param[in] Address The physical address of the access.\r
5879b875 302\r
7c1c4dcf 303 @return A 64-bit value returned from the memory space.\r
5879b875 304\r
305**/\r
306typedef\r
307UINT64\r
8b13229b 308(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(\r
7c1c4dcf 309 IN CONST EFI_PEI_SERVICES **PeiServices,\r
310 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
311 IN UINT64 Address\r
5879b875 312 );\r
313\r
314/**\r
dafa11b1 315 8-bit memory write operations.\r
5879b875 316\r
80ae2a58 317 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
318 by the PEI Foundation.\r
af2dc6a7 319 @param[in] This The pointer to local data for the interface.\r
80ae2a58 320 @param[in] Address The physical address of the access.\r
321 @param[in] Data The data to write.\r
5879b875 322\r
5879b875 323**/\r
324typedef\r
325VOID\r
8b13229b 326(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(\r
7c1c4dcf 327 IN CONST EFI_PEI_SERVICES **PeiServices,\r
328 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
329 IN UINT64 Address,\r
330 IN UINT8 Data\r
5879b875 331 );\r
332\r
333/**\r
dafa11b1 334 16-bit memory write operations.\r
5879b875 335\r
80ae2a58 336 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
337 by the PEI Foundation.\r
af2dc6a7 338 @param[in] This The pointer to local data for the interface.\r
80ae2a58 339 @param[in] Address The physical address of the access.\r
340 @param[in] Data The data to write.\r
5879b875 341\r
5879b875 342**/\r
343typedef\r
344VOID\r
8b13229b 345(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(\r
7c1c4dcf 346 IN CONST EFI_PEI_SERVICES **PeiServices,\r
347 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
348 IN UINT64 Address,\r
349 IN UINT16 Data\r
5879b875 350 );\r
351\r
352/**\r
dafa11b1 353 32-bit memory write operations.\r
5879b875 354\r
80ae2a58 355 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
356 by the PEI Foundation.\r
af2dc6a7 357 @param[in] This The pointer to local data for the interface.\r
80ae2a58 358 @param[in] Address The physical address of the access.\r
359 @param[in] Data The data to write.\r
5879b875 360\r
5879b875 361**/\r
362typedef\r
363VOID\r
8b13229b 364(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(\r
7c1c4dcf 365 IN CONST EFI_PEI_SERVICES **PeiServices,\r
366 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
367 IN UINT64 Address,\r
368 IN UINT32 Data\r
5879b875 369 );\r
370\r
371/**\r
dafa11b1 372 64-bit memory write operations.\r
5879b875 373\r
80ae2a58 374 @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
375 by the PEI Foundation.\r
af2dc6a7 376 @param[in] This The pointer to local data for the interface.\r
80ae2a58 377 @param[in] Address The physical address of the access.\r
378 @param[in] Data The data to write.\r
5879b875 379\r
5879b875 380**/\r
381typedef\r
382VOID\r
8b13229b 383(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(\r
7c1c4dcf 384 IN CONST EFI_PEI_SERVICES **PeiServices,\r
385 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
386 IN UINT64 Address,\r
387 IN UINT64 Data\r
5879b875 388 );\r
389\r
dafa11b1 390///\r
391/// EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.\r
af2dc6a7 392/// The perspective of the services is that of the processor, not that of the \r
393/// bus or system.\r
dafa11b1 394///\r
5879b875 395struct _EFI_PEI_CPU_IO_PPI {\r
80ae2a58 396 ///\r
397 /// Collection of memory-access services.\r
398 ///\r
399 EFI_PEI_CPU_IO_PPI_ACCESS Mem;\r
400 ///\r
401 /// Collection of I/O-access services.\r
402 ///\r
403 EFI_PEI_CPU_IO_PPI_ACCESS Io;\r
44717a39 404\r
5879b875 405 EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;\r
406 EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;\r
407 EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;\r
408 EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;\r
44717a39 409\r
5879b875 410 EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;\r
411 EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;\r
412 EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;\r
413 EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;\r
44717a39 414\r
5879b875 415 EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;\r
416 EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;\r
417 EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;\r
418 EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;\r
44717a39 419\r
5879b875 420 EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;\r
421 EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;\r
422 EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;\r
423 EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;\r
424};\r
425\r
3d806b5a 426extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;\r
5879b875 427\r
428#endif\r