]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/CpuIo.h
UEFI Capsule HOB updating includes:
[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 - 2009, 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 PeiServices An indirect pointer to the PEI Services Table
52 published by the PEI Foundation.
53 @param This Pointer to local data for the interface.
54 @param Width The width of the access. Enumerated in bytes.
55 @param Address The physical address of the access.
56 @param Count The number of accesses to perform.
57 @param 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 PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
94 @param This Pointer to local data for the interface.
95 @param Address The physical address of the access.
96
97 @return An 8-bit value returned from the I/O space.
98
99 **/
100 typedef
101 UINT8
102 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(
103 IN CONST EFI_PEI_SERVICES **PeiServices,
104 IN CONST EFI_PEI_CPU_IO_PPI *This,
105 IN UINT64 Address
106 );
107
108 /**
109 16-bit I/O read operations.
110
111 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
112 @param This Pointer to local data for the interface.
113 @param Address The physical address of the access.
114
115 @return A 16-bit value returned from the I/O space.
116
117 **/
118 typedef
119 UINT16
120 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(
121 IN CONST EFI_PEI_SERVICES **PeiServices,
122 IN CONST EFI_PEI_CPU_IO_PPI *This,
123 IN UINT64 Address
124 );
125
126 /**
127 32-bit I/O read operations.
128
129 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
130 @param This Pointer to local data for the interface.
131 @param Address The physical address of the access.
132
133 @return A 32-bit value returned from the I/O space.
134
135 **/
136 typedef
137 UINT32
138 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32)(
139 IN CONST EFI_PEI_SERVICES **PeiServices,
140 IN CONST EFI_PEI_CPU_IO_PPI *This,
141 IN UINT64 Address
142 );
143
144 /**
145 64-bit I/O read operations.
146
147 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
148 @param This Pointer to local data for the interface.
149 @param Address The physical address of the access.
150
151 @return A 64-bit value returned from the I/O space.
152
153 **/
154 typedef
155 UINT64
156 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(
157 IN CONST EFI_PEI_SERVICES **PeiServices,
158 IN CONST EFI_PEI_CPU_IO_PPI *This,
159 IN UINT64 Address
160 );
161
162 /**
163 8-bit I/O write operations.
164
165 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
166 @param This Pointer to local data for the interface.
167 @param Address The physical address of the access.
168 @param Data The data to write.
169
170 **/
171 typedef
172 VOID
173 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(
174 IN CONST EFI_PEI_SERVICES **PeiServices,
175 IN CONST EFI_PEI_CPU_IO_PPI *This,
176 IN UINT64 Address,
177 IN UINT8 Data
178 );
179
180 /**
181 16-bit I/O write operations.
182
183 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
184 @param This Pointer to local data for the interface.
185 @param Address The physical address of the access.
186 @param Data The data to write.
187
188 **/
189 typedef
190 VOID
191 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(
192 IN CONST EFI_PEI_SERVICES **PeiServices,
193 IN CONST EFI_PEI_CPU_IO_PPI *This,
194 IN UINT64 Address,
195 IN UINT16 Data
196 );
197
198 /**
199 32-bit I/O write operations.
200
201 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
202 @param This Pointer to local data for the interface.
203 @param Address The physical address of the access.
204 @param Data The data to write.
205
206 **/
207 typedef
208 VOID
209 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(
210 IN CONST EFI_PEI_SERVICES **PeiServices,
211 IN CONST EFI_PEI_CPU_IO_PPI *This,
212 IN UINT64 Address,
213 IN UINT32 Data
214 );
215
216 /**
217 64-bit I/O write operations.
218
219 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
220 @param This Pointer to local data for the interface.
221 @param Address The physical address of the access.
222 @param Data The data to write.
223
224 **/
225 typedef
226 VOID
227 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(
228 IN CONST EFI_PEI_SERVICES **PeiServices,
229 IN CONST EFI_PEI_CPU_IO_PPI *This,
230 IN UINT64 Address,
231 IN UINT64 Data
232 );
233
234 /**
235 8-bit memory read operations.
236
237 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
238 @param This Pointer to local data for the interface.
239 @param Address The physical address of the access.
240
241 @return An 8-bit value returned from the memory space.
242
243 **/
244 typedef
245 UINT8
246 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(
247 IN CONST EFI_PEI_SERVICES **PeiServices,
248 IN CONST EFI_PEI_CPU_IO_PPI *This,
249 IN UINT64 Address
250 );
251
252 /**
253 16-bit memory read operations.
254
255 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
256 @param This Pointer to local data for the interface.
257 @param Address The physical address of the access.
258
259 @return A 16-bit value returned from the memory space.
260
261 **/
262 typedef
263 UINT16
264 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(
265 IN CONST EFI_PEI_SERVICES **PeiServices,
266 IN CONST EFI_PEI_CPU_IO_PPI *This,
267 IN UINT64 Address
268 );
269
270 /**
271 32-bit memory read operations.
272
273 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
274 @param This Pointer to local data for the interface.
275 @param Address The physical address of the access.
276
277 @return A 32-bit value returned from the memory space.
278
279 **/
280 typedef
281 UINT32
282 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(
283 IN CONST EFI_PEI_SERVICES **PeiServices,
284 IN CONST EFI_PEI_CPU_IO_PPI *This,
285 IN UINT64 Address
286 );
287
288 /**
289 64-bit memory read operations.
290
291 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
292 @param This Pointer to local data for the interface.
293 @param Address The physical address of the access.
294
295 @return A 64-bit value returned from the memory space.
296
297 **/
298 typedef
299 UINT64
300 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(
301 IN CONST EFI_PEI_SERVICES **PeiServices,
302 IN CONST EFI_PEI_CPU_IO_PPI *This,
303 IN UINT64 Address
304 );
305
306 /**
307 8-bit memory write operations.
308
309 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
310 @param This Pointer to local data for the interface.
311 @param Address The physical address of the access.
312 @param Data The data to write.
313
314 **/
315 typedef
316 VOID
317 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(
318 IN CONST EFI_PEI_SERVICES **PeiServices,
319 IN CONST EFI_PEI_CPU_IO_PPI *This,
320 IN UINT64 Address,
321 IN UINT8 Data
322 );
323
324 /**
325 16-bit memory write operations.
326
327 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
328 @param This Pointer to local data for the interface.
329 @param Address The physical address of the access.
330 @param Data The data to write.
331
332 **/
333 typedef
334 VOID
335 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(
336 IN CONST EFI_PEI_SERVICES **PeiServices,
337 IN CONST EFI_PEI_CPU_IO_PPI *This,
338 IN UINT64 Address,
339 IN UINT16 Data
340 );
341
342 /**
343 32-bit memory write operations.
344
345 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
346 @param This Pointer to local data for the interface.
347 @param Address The physical address of the access.
348 @param Data The data to write.
349
350 **/
351 typedef
352 VOID
353 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(
354 IN CONST EFI_PEI_SERVICES **PeiServices,
355 IN CONST EFI_PEI_CPU_IO_PPI *This,
356 IN UINT64 Address,
357 IN UINT32 Data
358 );
359
360 /**
361 64-bit memory write operations.
362
363 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
364 @param This Pointer to local data for the interface.
365 @param Address The physical address of the access.
366 @param Data The data to write.
367
368 **/
369 typedef
370 VOID
371 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(
372 IN CONST EFI_PEI_SERVICES **PeiServices,
373 IN CONST EFI_PEI_CPU_IO_PPI *This,
374 IN UINT64 Address,
375 IN UINT64 Data
376 );
377
378 ///
379 /// EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.
380 /// The perspective of the services is that of the processor, not the bus or system.
381 ///
382 struct _EFI_PEI_CPU_IO_PPI {
383 EFI_PEI_CPU_IO_PPI_ACCESS Mem; ///< Collection of memory-access services.
384 EFI_PEI_CPU_IO_PPI_ACCESS Io; ///< Collection of I/O-access services.
385
386 EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;
387 EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;
388 EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;
389 EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;
390
391 EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;
392 EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;
393 EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;
394 EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;
395
396 EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;
397 EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;
398 EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;
399 EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;
400
401 EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;
402 EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;
403 EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;
404 EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;
405 };
406
407 extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;
408
409 #endif