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