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