]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/CpuIo.h
Fix formatting
[mirror_edk2.git] / MdePkg / Include / Ppi / CpuIo.h
1 /** @file
2 This PPI provides a set of memory and I/O-based services.
3 The perspective of the services is that of the processor, not the bus or system.
4
5 Copyright (c) 2006 - 2010, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 @par Revision Reference:
15 This PPI is introduced in PI 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[in] PeiServices An indirect pointer to the PEI Services Table
52 published by the PEI Foundation.
53 @param[in] This Pointer to local data for the interface.
54 @param[in] Width The width of the access. Enumerated in bytes.
55 @param[in] Address The physical address of the access.
56 @param[in] Count The number of accesses to perform.
57 @param[out] Buffer A pointer to the buffer of data.
58
59 @retval EFI_SUCCESS The function completed successfully.
60 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
61
62 **/
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM)(
66 IN CONST EFI_PEI_SERVICES **PeiServices,
67 IN CONST EFI_PEI_CPU_IO_PPI *This,
68 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,
69 IN UINT64 Address,
70 IN UINTN Count,
71 IN OUT VOID *Buffer
72 );
73
74 ///
75 /// *******************************************************
76 /// EFI_PEI_CPU_IO_PPI_ACCESS
77 /// *******************************************************
78 ///
79 typedef struct {
80 ///
81 /// This service provides the various modalities of memory and I/O read.
82 ///
83 EFI_PEI_CPU_IO_PPI_IO_MEM Read;
84 ///
85 /// This service provides the various modalities of memory and I/O write.
86 ///
87 EFI_PEI_CPU_IO_PPI_IO_MEM Write;
88 } EFI_PEI_CPU_IO_PPI_ACCESS;
89
90 /**
91 8-bit I/O read operations.
92
93 @param[in] PeiServices An indirect pointer to the PEI Services Table published
94 by the PEI Foundation.
95 @param[in] This Pointer to local data for the interface.
96 @param[in] Address The physical address of the access.
97
98 @return An 8-bit value returned from the I/O space.
99
100 **/
101 typedef
102 UINT8
103 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(
104 IN CONST EFI_PEI_SERVICES **PeiServices,
105 IN CONST EFI_PEI_CPU_IO_PPI *This,
106 IN UINT64 Address
107 );
108
109 /**
110 16-bit I/O read operations.
111
112 @param[in] PeiServices An indirect pointer to the PEI Services Table published
113 by the PEI Foundation.
114 @param[in] This Pointer to local data for the interface.
115 @param[in] Address The physical address of the access.
116
117 @return A 16-bit value returned from the I/O space.
118
119 **/
120 typedef
121 UINT16
122 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(
123 IN CONST EFI_PEI_SERVICES **PeiServices,
124 IN CONST EFI_PEI_CPU_IO_PPI *This,
125 IN UINT64 Address
126 );
127
128 /**
129 32-bit I/O read operations.
130
131 @param[in] PeiServices An indirect pointer to the PEI Services Table published
132 by the PEI Foundation.
133 @param[in] This Pointer to local data for the interface.
134 @param[in] Address The physical address of the access.
135
136 @return A 32-bit value returned from the I/O space.
137
138 **/
139 typedef
140 UINT32
141 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32)(
142 IN CONST EFI_PEI_SERVICES **PeiServices,
143 IN CONST EFI_PEI_CPU_IO_PPI *This,
144 IN UINT64 Address
145 );
146
147 /**
148 64-bit I/O read operations.
149
150 @param[in] PeiServices An indirect pointer to the PEI Services Table published
151 by the PEI Foundation.
152 @param[in] This Pointer to local data for the interface.
153 @param[in] Address The physical address of the access.
154
155 @return A 64-bit value returned from the I/O space.
156
157 **/
158 typedef
159 UINT64
160 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(
161 IN CONST EFI_PEI_SERVICES **PeiServices,
162 IN CONST EFI_PEI_CPU_IO_PPI *This,
163 IN UINT64 Address
164 );
165
166 /**
167 8-bit I/O write operations.
168
169 @param[in] PeiServices An indirect pointer to the PEI Services Table published
170 by the PEI Foundation.
171 @param[in] This Pointer to local data for the interface.
172 @param[in] Address The physical address of the access.
173 @param[in] Data The data to write.
174
175 **/
176 typedef
177 VOID
178 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(
179 IN CONST EFI_PEI_SERVICES **PeiServices,
180 IN CONST EFI_PEI_CPU_IO_PPI *This,
181 IN UINT64 Address,
182 IN UINT8 Data
183 );
184
185 /**
186 16-bit I/O write operations.
187
188 @param[in] PeiServices An indirect pointer to the PEI Services Table published
189 by the PEI Foundation.
190 @param[in] This Pointer to local data for the interface.
191 @param[in] Address The physical address of the access.
192 @param[in] Data The data to write.
193
194 **/
195 typedef
196 VOID
197 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(
198 IN CONST EFI_PEI_SERVICES **PeiServices,
199 IN CONST EFI_PEI_CPU_IO_PPI *This,
200 IN UINT64 Address,
201 IN UINT16 Data
202 );
203
204 /**
205 32-bit I/O write operations.
206
207 @param[in] PeiServices An indirect pointer to the PEI Services Table published
208 by the PEI Foundation.
209 @param[in] This Pointer to local data for the interface.
210 @param[in] Address The physical address of the access.
211 @param[in] Data The data to write.
212
213 **/
214 typedef
215 VOID
216 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(
217 IN CONST EFI_PEI_SERVICES **PeiServices,
218 IN CONST EFI_PEI_CPU_IO_PPI *This,
219 IN UINT64 Address,
220 IN UINT32 Data
221 );
222
223 /**
224 64-bit I/O write operations.
225
226 @param[in] PeiServices An indirect pointer to the PEI Services Table published
227 by the PEI Foundation.
228 @param[in] This Pointer to local data for the interface.
229 @param[in] Address The physical address of the access.
230 @param[in] Data The data to write.
231
232 **/
233 typedef
234 VOID
235 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(
236 IN CONST EFI_PEI_SERVICES **PeiServices,
237 IN CONST EFI_PEI_CPU_IO_PPI *This,
238 IN UINT64 Address,
239 IN UINT64 Data
240 );
241
242 /**
243 8-bit memory read operations.
244
245 @param[in] PeiServices An indirect pointer to the PEI Services Table published
246 by the PEI Foundation.
247 @param[in] This Pointer to local data for the interface.
248 @param[in] Address The physical address of the access.
249
250 @return An 8-bit value returned from the memory space.
251
252 **/
253 typedef
254 UINT8
255 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(
256 IN CONST EFI_PEI_SERVICES **PeiServices,
257 IN CONST EFI_PEI_CPU_IO_PPI *This,
258 IN UINT64 Address
259 );
260
261 /**
262 16-bit memory read operations.
263
264 @param[in] PeiServices An indirect pointer to the PEI Services Table published
265 by the PEI Foundation.
266 @param[in] This Pointer to local data for the interface.
267 @param[in] Address The physical address of the access.
268
269 @return A 16-bit value returned from the memory space.
270
271 **/
272 typedef
273 UINT16
274 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(
275 IN CONST EFI_PEI_SERVICES **PeiServices,
276 IN CONST EFI_PEI_CPU_IO_PPI *This,
277 IN UINT64 Address
278 );
279
280 /**
281 32-bit memory read operations.
282
283 @param[in] PeiServices An indirect pointer to the PEI Services Table published
284 by the PEI Foundation.
285 @param[in] This Pointer to local data for the interface.
286 @param[in] Address The physical address of the access.
287
288 @return A 32-bit value returned from the memory space.
289
290 **/
291 typedef
292 UINT32
293 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(
294 IN CONST EFI_PEI_SERVICES **PeiServices,
295 IN CONST EFI_PEI_CPU_IO_PPI *This,
296 IN UINT64 Address
297 );
298
299 /**
300 64-bit memory read operations.
301
302 @param[in] PeiServices An indirect pointer to the PEI Services Table published
303 by the PEI Foundation.
304 @param[in] This Pointer to local data for the interface.
305 @param[in] Address The physical address of the access.
306
307 @return A 64-bit value returned from the memory space.
308
309 **/
310 typedef
311 UINT64
312 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(
313 IN CONST EFI_PEI_SERVICES **PeiServices,
314 IN CONST EFI_PEI_CPU_IO_PPI *This,
315 IN UINT64 Address
316 );
317
318 /**
319 8-bit memory write operations.
320
321 @param[in] PeiServices An indirect pointer to the PEI Services Table published
322 by the PEI Foundation.
323 @param[in] This Pointer to local data for the interface.
324 @param[in] Address The physical address of the access.
325 @param[in] Data The data to write.
326
327 **/
328 typedef
329 VOID
330 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(
331 IN CONST EFI_PEI_SERVICES **PeiServices,
332 IN CONST EFI_PEI_CPU_IO_PPI *This,
333 IN UINT64 Address,
334 IN UINT8 Data
335 );
336
337 /**
338 16-bit memory write operations.
339
340 @param[in] PeiServices An indirect pointer to the PEI Services Table published
341 by the PEI Foundation.
342 @param[in] This Pointer to local data for the interface.
343 @param[in] Address The physical address of the access.
344 @param[in] Data The data to write.
345
346 **/
347 typedef
348 VOID
349 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(
350 IN CONST EFI_PEI_SERVICES **PeiServices,
351 IN CONST EFI_PEI_CPU_IO_PPI *This,
352 IN UINT64 Address,
353 IN UINT16 Data
354 );
355
356 /**
357 32-bit memory write operations.
358
359 @param[in] PeiServices An indirect pointer to the PEI Services Table published
360 by the PEI Foundation.
361 @param[in] This Pointer to local data for the interface.
362 @param[in] Address The physical address of the access.
363 @param[in] Data The data to write.
364
365 **/
366 typedef
367 VOID
368 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(
369 IN CONST EFI_PEI_SERVICES **PeiServices,
370 IN CONST EFI_PEI_CPU_IO_PPI *This,
371 IN UINT64 Address,
372 IN UINT32 Data
373 );
374
375 /**
376 64-bit memory write operations.
377
378 @param[in] PeiServices An indirect pointer to the PEI Services Table published
379 by the PEI Foundation.
380 @param[in] This Pointer to local data for the interface.
381 @param[in] Address The physical address of the access.
382 @param[in] Data The data to write.
383
384 **/
385 typedef
386 VOID
387 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(
388 IN CONST EFI_PEI_SERVICES **PeiServices,
389 IN CONST EFI_PEI_CPU_IO_PPI *This,
390 IN UINT64 Address,
391 IN UINT64 Data
392 );
393
394 ///
395 /// EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.
396 /// The perspective of the services is that of the processor, not the bus or system.
397 ///
398 struct _EFI_PEI_CPU_IO_PPI {
399 ///
400 /// Collection of memory-access services.
401 ///
402 EFI_PEI_CPU_IO_PPI_ACCESS Mem;
403 ///
404 /// Collection of I/O-access services.
405 ///
406 EFI_PEI_CPU_IO_PPI_ACCESS Io;
407
408 EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;
409 EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;
410 EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;
411 EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;
412
413 EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;
414 EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;
415 EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;
416 EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;
417
418 EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;
419 EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;
420 EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;
421 EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;
422
423 EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;
424 EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;
425 EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;
426 EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;
427 };
428
429 extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;
430
431 #endif