2 Internal include file for the CPU I/O PPI.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _CPU_IO2_PEI_H_
10 #define _CPU_IO2_PEI_H_
14 #include <Ppi/CpuIo.h>
16 #include <Library/BaseLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/IoLib.h>
19 #include <Library/PeiServicesLib.h>
21 #define MAX_IO_PORT_ADDRESS 0xFFFF
24 Reads memory-mapped registers.
26 @param[in] PeiServices An indirect pointer to the PEI Services Table
27 published by the PEI Foundation.
28 @param[in] This Pointer to local data for the interface.
29 @param[in] Width The width of the access. Enumerated in bytes.
30 @param[in] Address The physical address of the access.
31 @param[in] Count The number of accesses to perform.
32 @param[out] Buffer A pointer to the buffer of data.
34 @retval EFI_SUCCESS The function completed successfully.
35 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
36 @retval EFI_INVALID_PARAMETER Buffer is NULL.
37 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
38 and Count is not valid for this EFI system.
43 CpuMemoryServiceRead (
44 IN CONST EFI_PEI_SERVICES
**PeiServices
,
45 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
46 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
53 Writes memory-mapped registers.
55 @param[in] PeiServices An indirect pointer to the PEI Services Table
56 published by the PEI Foundation.
57 @param[in] This Pointer to local data for the interface.
58 @param[in] Width The width of the access. Enumerated in bytes.
59 @param[in] Address The physical address of the access.
60 @param[in] Count The number of accesses to perform.
61 @param[in] Buffer A pointer to the buffer of data.
63 @retval EFI_SUCCESS The function completed successfully.
64 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
65 @retval EFI_INVALID_PARAMETER Buffer is NULL.
66 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
67 and Count is not valid for this EFI system.
72 CpuMemoryServiceWrite (
73 IN CONST EFI_PEI_SERVICES
**PeiServices
,
74 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
75 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
84 @param[in] PeiServices An indirect pointer to the PEI Services Table
85 published by the PEI Foundation.
86 @param[in] This Pointer to local data for the interface.
87 @param[in] Width The width of the access. Enumerated in bytes.
88 @param[in] Address The physical address of the access.
89 @param[in] Count The number of accesses to perform.
90 @param[out] Buffer A pointer to the buffer of data.
92 @retval EFI_SUCCESS The function completed successfully.
93 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
94 @retval EFI_INVALID_PARAMETER Buffer is NULL.
95 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
96 and Count is not valid for this EFI system.
102 IN CONST EFI_PEI_SERVICES
**PeiServices
,
103 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
104 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
113 @param[in] PeiServices An indirect pointer to the PEI Services Table
114 published by the PEI Foundation.
115 @param[in] This Pointer to local data for the interface.
116 @param[in] Width The width of the access. Enumerated in bytes.
117 @param[in] Address The physical address of the access.
118 @param[in] Count The number of accesses to perform.
119 @param[in] Buffer A pointer to the buffer of data.
121 @retval EFI_SUCCESS The function completed successfully.
122 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
123 @retval EFI_INVALID_PARAMETER Buffer is NULL.
124 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
125 and Count is not valid for this EFI system.
131 IN CONST EFI_PEI_SERVICES
**PeiServices
,
132 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
133 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
140 8-bit I/O read operations.
142 @param[in] PeiServices An indirect pointer to the PEI Services Table published
143 by the PEI Foundation.
144 @param[in] This Pointer to local data for the interface.
145 @param[in] Address The physical address of the access.
147 @return An 8-bit value returned from the I/O space.
152 IN CONST EFI_PEI_SERVICES
**PeiServices
,
153 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
158 16-bit I/O read operations.
160 @param[in] PeiServices An indirect pointer to the PEI Services Table published
161 by the PEI Foundation.
162 @param[in] This Pointer to local data for the interface.
163 @param[in] Address The physical address of the access.
165 @return A 16-bit value returned from the I/O space.
171 IN CONST EFI_PEI_SERVICES
**PeiServices
,
172 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
177 32-bit I/O read operations.
179 @param[in] PeiServices An indirect pointer to the PEI Services Table published
180 by the PEI Foundation.
181 @param[in] This Pointer to local data for the interface.
182 @param[in] Address The physical address of the access.
184 @return A 32-bit value returned from the I/O space.
190 IN CONST EFI_PEI_SERVICES
**PeiServices
,
191 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
196 64-bit I/O read operations.
198 @param[in] PeiServices An indirect pointer to the PEI Services Table published
199 by the PEI Foundation.
200 @param[in] This Pointer to local data for the interface.
201 @param[in] Address The physical address of the access.
203 @return A 64-bit value returned from the I/O space.
209 IN CONST EFI_PEI_SERVICES
**PeiServices
,
210 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
215 8-bit I/O write operations.
217 @param[in] PeiServices An indirect pointer to the PEI Services Table published
218 by the PEI Foundation.
219 @param[in] This Pointer to local data for the interface.
220 @param[in] Address The physical address of the access.
221 @param[in] Data The data to write.
227 IN CONST EFI_PEI_SERVICES
**PeiServices
,
228 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
234 16-bit I/O write operations.
236 @param[in] PeiServices An indirect pointer to the PEI Services Table published
237 by the PEI Foundation.
238 @param[in] This Pointer to local data for the interface.
239 @param[in] Address The physical address of the access.
240 @param[in] Data The data to write.
246 IN CONST EFI_PEI_SERVICES
**PeiServices
,
247 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
253 32-bit I/O write operations.
255 @param[in] PeiServices An indirect pointer to the PEI Services Table published
256 by the PEI Foundation.
257 @param[in] This Pointer to local data for the interface.
258 @param[in] Address The physical address of the access.
259 @param[in] Data The data to write.
265 IN CONST EFI_PEI_SERVICES
**PeiServices
,
266 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
272 64-bit I/O write operations.
274 @param[in] PeiServices An indirect pointer to the PEI Services Table published
275 by the PEI Foundation.
276 @param[in] This Pointer to local data for the interface.
277 @param[in] Address The physical address of the access.
278 @param[in] Data The data to write.
284 IN CONST EFI_PEI_SERVICES
**PeiServices
,
285 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
291 8-bit memory read operations.
293 @param[in] PeiServices An indirect pointer to the PEI Services Table published
294 by the PEI Foundation.
295 @param[in] This Pointer to local data for the interface.
296 @param[in] Address The physical address of the access.
298 @return An 8-bit value returned from the memory space.
304 IN CONST EFI_PEI_SERVICES
**PeiServices
,
305 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
310 16-bit memory read operations.
312 @param[in] PeiServices An indirect pointer to the PEI Services Table published
313 by the PEI Foundation.
314 @param[in] This Pointer to local data for the interface.
315 @param[in] Address The physical address of the access.
317 @return A 16-bit value returned from the memory space.
323 IN CONST EFI_PEI_SERVICES
**PeiServices
,
324 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
329 32-bit memory read operations.
331 @param[in] PeiServices An indirect pointer to the PEI Services Table published
332 by the PEI Foundation.
333 @param[in] This Pointer to local data for the interface.
334 @param[in] Address The physical address of the access.
336 @return A 32-bit value returned from the memory space.
342 IN CONST EFI_PEI_SERVICES
**PeiServices
,
343 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
348 64-bit memory read operations.
350 @param[in] PeiServices An indirect pointer to the PEI Services Table published
351 by the PEI Foundation.
352 @param[in] This Pointer to local data for the interface.
353 @param[in] Address The physical address of the access.
355 @return A 64-bit value returned from the memory space.
361 IN CONST EFI_PEI_SERVICES
**PeiServices
,
362 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
367 8-bit memory write operations.
369 @param[in] PeiServices An indirect pointer to the PEI Services Table published
370 by the PEI Foundation.
371 @param[in] This Pointer to local data for the interface.
372 @param[in] Address The physical address of the access.
373 @param[in] Data The data to write.
379 IN CONST EFI_PEI_SERVICES
**PeiServices
,
380 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
386 16-bit memory write operations.
388 @param[in] PeiServices An indirect pointer to the PEI Services Table published
389 by the PEI Foundation.
390 @param[in] This Pointer to local data for the interface.
391 @param[in] Address The physical address of the access.
392 @param[in] Data The data to write.
398 IN CONST EFI_PEI_SERVICES
**PeiServices
,
399 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
405 32-bit memory write operations.
407 @param[in] PeiServices An indirect pointer to the PEI Services Table published
408 by the PEI Foundation.
409 @param[in] This Pointer to local data for the interface.
410 @param[in] Address The physical address of the access.
411 @param[in] Data The data to write.
417 IN CONST EFI_PEI_SERVICES
**PeiServices
,
418 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
424 64-bit memory write operations.
426 @param[in] PeiServices An indirect pointer to the PEI Services Table published
427 by the PEI Foundation.
428 @param[in] This Pointer to local data for the interface.
429 @param[in] Address The physical address of the access.
430 @param[in] Data The data to write.
436 IN CONST EFI_PEI_SERVICES
**PeiServices
,
437 IN CONST EFI_PEI_CPU_IO_PPI
*This
,