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