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