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