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