]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/CpuIo.h
Fix doxygen issue:
[mirror_edk2.git] / MdePkg / Include / Ppi / CpuIo.h
1 /** @file
2 This file declares CPU IO PPI that abstracts CPU IO access
3
4 Copyright (c) 2006, 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 @par Revision Reference:
14 This PPI is defined in PI.
15 Version 1.0.
16
17 **/
18
19 #ifndef __PEI_CPUIO_PPI_H__
20 #define __PEI_CPUIO_PPI_H__
21
22 #include <ProcessorBind.h>
23 #include <Pi/PiPeiCis.h>
24
25 #define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \
26 { 0xe6af1f7b, 0xfc3f, 0x46da, {0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82 } }
27
28 typedef struct _EFI_PEI_CPU_IO_PPI EFI_PEI_CPU_IO_PPI;
29
30 //
31 // *******************************************************
32 // EFI_PEI_CPU_IO_PPI_WIDTH
33 // *******************************************************
34 //
35 typedef enum {
36 EfiPeiCpuIoWidthUint8,
37 EfiPeiCpuIoWidthUint16,
38 EfiPeiCpuIoWidthUint32,
39 EfiPeiCpuIoWidthUint64,
40 EfiPeiCpuIoWidthFifoUint8,
41 EfiPeiCpuIoWidthFifoUint16,
42 EfiPeiCpuIoWidthFifoUint32,
43 EfiPeiCpuIoWidthFifoUint64,
44 EfiPeiCpuIoWidthFillUint8,
45 EfiPeiCpuIoWidthFillUint16,
46 EfiPeiCpuIoWidthFillUint32,
47 EfiPeiCpuIoWidthFillUint64,
48 EfiPeiCpuIoWidthMaximum
49 } EFI_PEI_CPU_IO_PPI_WIDTH;
50
51 /**
52 Memory-based access services and I/O-based access services.
53
54 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
55 @param This Pointer to local data for the interface.
56 @param Width The width of the access. Enumerated in bytes.
57 @param Address The physical address of the access.
58 @param Count The number of accesses to perform.
59 @param Buffer A pointer to the buffer of data.
60
61 @retval EFI_SUCCESS The function completed successfully.
62 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
63
64 **/
65 typedef
66 EFI_STATUS
67 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM)(
68 IN EFI_PEI_SERVICES **PeiServices,
69 IN EFI_PEI_CPU_IO_PPI *This,
70 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,
71 IN UINT64 Address,
72 IN UINTN Count,
73 IN OUT VOID *Buffer
74 );
75
76 //
77 // *******************************************************
78 // EFI_PEI_CPU_IO_PPI_ACCESS
79 // *******************************************************
80 //
81 typedef struct {
82 EFI_PEI_CPU_IO_PPI_IO_MEM Read;
83 EFI_PEI_CPU_IO_PPI_IO_MEM Write;
84 } EFI_PEI_CPU_IO_PPI_ACCESS;
85
86 /**
87 8-bit I/O read operations.
88
89 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
90 @param This Pointer to local data for the interface.
91 @param Address The physical address of the access.
92
93 @return UINT8
94
95 **/
96 typedef
97 UINT8
98 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(
99 IN EFI_PEI_SERVICES **PeiServices,
100 IN EFI_PEI_CPU_IO_PPI *This,
101 IN UINT64 Address
102 );
103
104 /**
105 16-bit I/O read operations.
106
107 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
108 @param This Pointer to local data for the interface.
109 @param Address The physical address of the access.
110
111 @return UINT16
112
113 **/
114 typedef
115 UINT16
116 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(
117 IN EFI_PEI_SERVICES **PeiServices,
118 IN EFI_PEI_CPU_IO_PPI *This,
119 IN UINT64 Address
120 );
121
122 /**
123 32-bit I/O read operations.
124
125 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
126 @param This Pointer to local data for the interface.
127 @param Address The physical address of the access.
128
129 @return UINT32
130
131 **/
132 typedef
133 UINT32
134 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32)(
135 IN EFI_PEI_SERVICES **PeiServices,
136 IN EFI_PEI_CPU_IO_PPI *This,
137 IN UINT64 Address
138 );
139
140 /**
141 64-bit I/O read operations.
142
143 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
144 @param This Pointer to local data for the interface.
145 @param Address The physical address of the access.
146
147 @return UINT64
148
149 **/
150 typedef
151 UINT64
152 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(
153 IN EFI_PEI_SERVICES **PeiServices,
154 IN EFI_PEI_CPU_IO_PPI *This,
155 IN UINT64 Address
156 );
157
158 /**
159 8-bit I/O write operations.
160
161 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
162 @param This Pointer to local data for the interface.
163 @param Address The physical address of the access.
164 @param Data The data to write.
165
166 @return None
167
168 **/
169 typedef
170 VOID
171 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(
172 IN EFI_PEI_SERVICES **PeiServices,
173 IN EFI_PEI_CPU_IO_PPI *This,
174 IN UINT64 Address,
175 IN UINT8 Data
176 );
177
178 /**
179 16-bit I/O write operations.
180
181 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
182 @param This Pointer to local data for the interface.
183 @param Address The physical address of the access.
184 @param Data The data to write.
185
186 @return None
187
188 **/
189 typedef
190 VOID
191 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(
192 IN EFI_PEI_SERVICES **PeiServices,
193 IN EFI_PEI_CPU_IO_PPI *This,
194 IN UINT64 Address,
195 IN UINT16 Data
196 );
197
198 /**
199 32-bit I/O write operations.
200
201 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
202 @param This Pointer to local data for the interface.
203 @param Address The physical address of the access.
204 @param Data The data to write.
205
206 @return None
207
208 **/
209 typedef
210 VOID
211 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(
212 IN EFI_PEI_SERVICES **PeiServices,
213 IN EFI_PEI_CPU_IO_PPI *This,
214 IN UINT64 Address,
215 IN UINT32 Data
216 );
217
218 /**
219 64-bit I/O write operations.
220
221 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
222 @param This Pointer to local data for the interface.
223 @param Address The physical address of the access.
224 @param Data The data to write.
225
226 @return None
227
228 **/
229 typedef
230 VOID
231 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(
232 IN EFI_PEI_SERVICES **PeiServices,
233 IN EFI_PEI_CPU_IO_PPI *This,
234 IN UINT64 Address,
235 IN UINT64 Data
236 );
237
238 /**
239 8-bit Memory read operations.
240
241 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
242 @param This Pointer to local data for the interface.
243 @param Address The physical address of the access.
244
245 @return UINT8
246
247 **/
248 typedef
249 UINT8
250 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(
251 IN EFI_PEI_SERVICES **PeiServices,
252 IN EFI_PEI_CPU_IO_PPI *This,
253 IN UINT64 Address
254 );
255
256 /**
257 16-bit Memory read operations.
258
259 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
260 @param This Pointer to local data for the interface.
261 @param Address The physical address of the access.
262
263 @return UINT16
264
265 **/
266 typedef
267 UINT16
268 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(
269 IN EFI_PEI_SERVICES **PeiServices,
270 IN EFI_PEI_CPU_IO_PPI *This,
271 IN UINT64 Address
272 );
273
274 /**
275 32-bit Memory read operations.
276
277 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
278 @param This Pointer to local data for the interface.
279 @param Address The physical address of the access.
280
281 @return UINT32
282
283 **/
284 typedef
285 UINT32
286 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(
287 IN EFI_PEI_SERVICES **PeiServices,
288 IN EFI_PEI_CPU_IO_PPI *This,
289 IN UINT64 Address
290 );
291
292 /**
293 64-bit Memory read operations.
294
295 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
296 @param This Pointer to local data for the interface.
297 @param Address The physical address of the access.
298
299 @return UINT64
300
301 **/
302 typedef
303 UINT64
304 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(
305 IN EFI_PEI_SERVICES **PeiServices,
306 IN EFI_PEI_CPU_IO_PPI *This,
307 IN UINT64 Address
308 );
309
310 /**
311 8-bit Memory write operations.
312
313 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
314 @param This Pointer to local data for the interface.
315 @param Address The physical address of the access.
316 @param Data The data to write.
317
318 @return None
319
320 **/
321 typedef
322 VOID
323 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(
324 IN EFI_PEI_SERVICES **PeiServices,
325 IN EFI_PEI_CPU_IO_PPI *This,
326 IN UINT64 Address,
327 IN UINT8 Data
328 );
329
330 /**
331 16-bit Memory write operations.
332
333 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
334 @param This Pointer to local data for the interface.
335 @param Address The physical address of the access.
336 @param Data The data to write.
337
338 @return None
339
340 **/
341 typedef
342 VOID
343 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(
344 IN EFI_PEI_SERVICES **PeiServices,
345 IN EFI_PEI_CPU_IO_PPI *This,
346 IN UINT64 Address,
347 IN UINT16 Data
348 );
349
350 /**
351 32-bit Memory write operations.
352
353 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
354 @param This Pointer to local data for the interface.
355 @param Address The physical address of the access.
356 @param Data The data to write.
357
358 @return None
359
360 **/
361 typedef
362 VOID
363 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(
364 IN EFI_PEI_SERVICES **PeiServices,
365 IN EFI_PEI_CPU_IO_PPI *This,
366 IN UINT64 Address,
367 IN UINT32 Data
368 );
369
370 /**
371 64-bit Memory write operations.
372
373 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
374 @param This Pointer to local data for the interface.
375 @param Address The physical address of the access.
376 @param Data The data to write.
377
378 @return None
379
380 **/
381 typedef
382 VOID
383 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(
384 IN EFI_PEI_SERVICES **PeiServices,
385 IN EFI_PEI_CPU_IO_PPI *This,
386 IN UINT64 Address,
387 IN UINT64 Data
388 );
389
390 /**
391 @par Ppi Description:
392 EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.
393 The perspective of the services is that of the processor, not the bus or system.
394
395 @param Mem
396 Collection of memory-access services.
397
398 @param I/O
399 Collection of I/O-access services.
400
401 @param IoRead8
402 8-bit read service.
403
404 @param IoRead16
405 16-bit read service.
406
407 @param IoRead32
408 32-bit read service.
409
410 @param IoRead64
411 64-bit read service.
412
413 @param IoWrite8
414 8-bit write service.
415
416 @param IoWrite16
417 16-bit write service.
418
419 @param IoWrite32
420 32-bit write service.
421
422 @param IoWrite64
423 64-bit write service.
424
425 @param MemRead8
426 8-bit read service.
427
428 @param MemRead16
429 16-bit read service.
430
431 @param MemRead32
432 32-bit read service.
433
434 @param MemRead64
435 64-bit read service.
436
437 @param MemWrite8
438 8-bit write service.
439
440 @param MemWrite16
441 16-bit write service.
442
443 @param MemWrite32
444 32-bit write service.
445
446 @param MemWrite64
447 64-bit write service.
448
449 **/
450 struct _EFI_PEI_CPU_IO_PPI {
451 EFI_PEI_CPU_IO_PPI_ACCESS Mem;
452 EFI_PEI_CPU_IO_PPI_ACCESS Io;
453 EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;
454 EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;
455 EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;
456 EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;
457 EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;
458 EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;
459 EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;
460 EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;
461 EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;
462 EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;
463 EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;
464 EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;
465 EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;
466 EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;
467 EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;
468 EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;
469 };
470
471 extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;
472
473 #endif