]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/CpuIo.h
Formalize comments for Protocols and PPIs.
[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 - 2008, 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 defined in PI.
16 Version 1.0.
17
18 **/
19
20 #ifndef __PEI_CPUIO_PPI_H__
21 #define __PEI_CPUIO_PPI_H__
22
23 #include <Pi/PiPeiCis.h>
24
25 #define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \
26 { 0xe6af1f7b, 0xfc3f, 0x46da, {0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82 } }
27
28 typedef struct _EFI_PEI_CPU_IO_PPI EFI_PEI_CPU_IO_PPI;
29
30 ///
31 /// *******************************************************
32 /// EFI_PEI_CPU_IO_PPI_WIDTH
33 /// *******************************************************
34 ///
35 typedef enum {
36 EfiPeiCpuIoWidthUint8,
37 EfiPeiCpuIoWidthUint16,
38 EfiPeiCpuIoWidthUint32,
39 EfiPeiCpuIoWidthUint64,
40 EfiPeiCpuIoWidthFifoUint8,
41 EfiPeiCpuIoWidthFifoUint16,
42 EfiPeiCpuIoWidthFifoUint32,
43 EfiPeiCpuIoWidthFifoUint64,
44 EfiPeiCpuIoWidthFillUint8,
45 EfiPeiCpuIoWidthFillUint16,
46 EfiPeiCpuIoWidthFillUint32,
47 EfiPeiCpuIoWidthFillUint64,
48 EfiPeiCpuIoWidthMaximum
49 } EFI_PEI_CPU_IO_PPI_WIDTH;
50
51 /**
52 Memory-based access services and I/O-based access services.
53
54 @param PeiServices An indirect pointer to the PEI Services Table
55 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 CONST EFI_PEI_SERVICES **PeiServices,
70 IN CONST 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 ///
84 /// This service provides the various modalities of memory and I/O read.
85 ///
86 EFI_PEI_CPU_IO_PPI_IO_MEM Read;
87 ///
88 /// This service provides the various modalities of memory and I/O write.
89 ///
90 EFI_PEI_CPU_IO_PPI_IO_MEM Write;
91 } EFI_PEI_CPU_IO_PPI_ACCESS;
92
93 /**
94 8-bit I/O read operations.
95
96 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
97 @param This Pointer to local data for the interface.
98 @param Address The physical address of the access.
99
100 @return An 8-bit value returned from the I/O space.
101
102 **/
103 typedef
104 UINT8
105 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(
106 IN CONST EFI_PEI_SERVICES **PeiServices,
107 IN CONST EFI_PEI_CPU_IO_PPI *This,
108 IN UINT64 Address
109 );
110
111 /**
112 16-bit I/O read operations.
113
114 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
115 @param This Pointer to local data for the interface.
116 @param Address The physical address of the access.
117
118 @return A 16-bit value returned from the I/O space.
119
120 **/
121 typedef
122 UINT16
123 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(
124 IN CONST EFI_PEI_SERVICES **PeiServices,
125 IN CONST EFI_PEI_CPU_IO_PPI *This,
126 IN UINT64 Address
127 );
128
129 /**
130 32-bit I/O read operations.
131
132 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
133 @param This Pointer to local data for the interface.
134 @param 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 PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
151 @param This Pointer to local data for the interface.
152 @param Address The physical address of the access.
153
154 @return A 64-bit value returned from the I/O space.
155
156 **/
157 typedef
158 UINT64
159 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(
160 IN CONST EFI_PEI_SERVICES **PeiServices,
161 IN CONST EFI_PEI_CPU_IO_PPI *This,
162 IN UINT64 Address
163 );
164
165 /**
166 8-bit I/O write operations.
167
168 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
169 @param This Pointer to local data for the interface.
170 @param Address The physical address of the access.
171 @param Data The data to write.
172
173 **/
174 typedef
175 VOID
176 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(
177 IN CONST EFI_PEI_SERVICES **PeiServices,
178 IN CONST EFI_PEI_CPU_IO_PPI *This,
179 IN UINT64 Address,
180 IN UINT8 Data
181 );
182
183 /**
184 16-bit I/O write operations.
185
186 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
187 @param This Pointer to local data for the interface.
188 @param Address The physical address of the access.
189 @param Data The data to write.
190
191 **/
192 typedef
193 VOID
194 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(
195 IN CONST EFI_PEI_SERVICES **PeiServices,
196 IN CONST EFI_PEI_CPU_IO_PPI *This,
197 IN UINT64 Address,
198 IN UINT16 Data
199 );
200
201 /**
202 32-bit I/O write operations.
203
204 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
205 @param This Pointer to local data for the interface.
206 @param Address The physical address of the access.
207 @param Data The data to write.
208
209 **/
210 typedef
211 VOID
212 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(
213 IN CONST EFI_PEI_SERVICES **PeiServices,
214 IN CONST 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 **/
228 typedef
229 VOID
230 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(
231 IN CONST EFI_PEI_SERVICES **PeiServices,
232 IN CONST 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 An 8-bit value returned from the memory space.
245
246 **/
247 typedef
248 UINT8
249 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(
250 IN CONST EFI_PEI_SERVICES **PeiServices,
251 IN CONST 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 A 16-bit value returned from the memory space.
263
264 **/
265 typedef
266 UINT16
267 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(
268 IN CONST EFI_PEI_SERVICES **PeiServices,
269 IN CONST 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 A 32-bit value returned from the memory space.
281
282 **/
283 typedef
284 UINT32
285 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(
286 IN CONST EFI_PEI_SERVICES **PeiServices,
287 IN CONST 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 A 64-bit value returned from the memory space.
299
300 **/
301 typedef
302 UINT64
303 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(
304 IN CONST EFI_PEI_SERVICES **PeiServices,
305 IN CONST 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 **/
318 typedef
319 VOID
320 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(
321 IN CONST EFI_PEI_SERVICES **PeiServices,
322 IN CONST 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 **/
336 typedef
337 VOID
338 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(
339 IN CONST EFI_PEI_SERVICES **PeiServices,
340 IN CONST EFI_PEI_CPU_IO_PPI *This,
341 IN UINT64 Address,
342 IN UINT16 Data
343 );
344
345 /**
346 32-bit memory write operations.
347
348 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
349 @param This Pointer to local data for the interface.
350 @param Address The physical address of the access.
351 @param Data The data to write.
352
353 **/
354 typedef
355 VOID
356 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(
357 IN CONST EFI_PEI_SERVICES **PeiServices,
358 IN CONST EFI_PEI_CPU_IO_PPI *This,
359 IN UINT64 Address,
360 IN UINT32 Data
361 );
362
363 /**
364 64-bit memory write operations.
365
366 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
367 @param This Pointer to local data for the interface.
368 @param Address The physical address of the access.
369 @param Data The data to write.
370
371 **/
372 typedef
373 VOID
374 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(
375 IN CONST EFI_PEI_SERVICES **PeiServices,
376 IN CONST EFI_PEI_CPU_IO_PPI *This,
377 IN UINT64 Address,
378 IN UINT64 Data
379 );
380
381 ///
382 /// EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.
383 /// The perspective of the services is that of the processor, not the bus or system.
384 ///
385 struct _EFI_PEI_CPU_IO_PPI {
386 EFI_PEI_CPU_IO_PPI_ACCESS Mem; ///< Collection of memory-access services.
387 EFI_PEI_CPU_IO_PPI_ACCESS Io; ///< Collection of I/O-access services.
388
389 EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;
390 EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;
391 EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;
392 EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;
393
394 EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;
395 EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;
396 EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;
397 EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;
398
399 EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;
400 EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;
401 EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;
402 EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;
403
404 EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;
405 EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;
406 EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;
407 EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;
408 };
409
410 extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;
411
412 #endif