2 Internal include file for the CPU I/O PPI.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _CPU_IO2_PEI_H_
16 #define _CPU_IO2_PEI_H_
20 #include <Ppi/CpuIo.h>
22 #include <Library/BaseLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/IoLib.h>
25 #include <Library/PeiServicesLib.h>
27 #define MAX_IO_PORT_ADDRESS 0xFFFF
30 Reads memory-mapped registers.
32 @param[in] PeiServices An indirect pointer to the PEI Services Table
33 published by the PEI Foundation.
34 @param[in] This Pointer to local data for the interface.
35 @param[in] Width The width of the access. Enumerated in bytes.
36 @param[in] Address The physical address of the access.
37 @param[in] Count The number of accesses to perform.
38 @param[out] Buffer A pointer to the buffer of data.
40 @retval EFI_SUCCESS The function completed successfully.
41 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
42 @retval EFI_INVALID_PARAMETER Buffer is NULL.
43 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
44 and Count is not valid for this EFI system.
49 CpuMemoryServiceRead (
50 IN CONST EFI_PEI_SERVICES
**PeiServices
,
51 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
52 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
59 Writes memory-mapped registers.
61 @param[in] PeiServices An indirect pointer to the PEI Services Table
62 published by the PEI Foundation.
63 @param[in] This Pointer to local data for the interface.
64 @param[in] Width The width of the access. Enumerated in bytes.
65 @param[in] Address The physical address of the access.
66 @param[in] Count The number of accesses to perform.
67 @param[in] Buffer A pointer to the buffer of data.
69 @retval EFI_SUCCESS The function completed successfully.
70 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
71 @retval EFI_INVALID_PARAMETER Buffer is NULL.
72 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
73 and Count is not valid for this EFI system.
78 CpuMemoryServiceWrite (
79 IN CONST EFI_PEI_SERVICES
**PeiServices
,
80 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
81 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
90 @param[in] PeiServices An indirect pointer to the PEI Services Table
91 published by the PEI Foundation.
92 @param[in] This Pointer to local data for the interface.
93 @param[in] Width The width of the access. Enumerated in bytes.
94 @param[in] Address The physical address of the access.
95 @param[in] Count The number of accesses to perform.
96 @param[out] Buffer A pointer to the buffer of data.
98 @retval EFI_SUCCESS The function completed successfully.
99 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
100 @retval EFI_INVALID_PARAMETER Buffer is NULL.
101 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
102 and Count is not valid for this EFI system.
108 IN CONST EFI_PEI_SERVICES
**PeiServices
,
109 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
110 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
119 @param[in] PeiServices An indirect pointer to the PEI Services Table
120 published by the PEI Foundation.
121 @param[in] This Pointer to local data for the interface.
122 @param[in] Width The width of the access. Enumerated in bytes.
123 @param[in] Address The physical address of the access.
124 @param[in] Count The number of accesses to perform.
125 @param[in] Buffer A pointer to the buffer of data.
127 @retval EFI_SUCCESS The function completed successfully.
128 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
129 @retval EFI_INVALID_PARAMETER Buffer is NULL.
130 @retval EFI_UNSUPPORTED The address range specified by Address, Width,
131 and Count is not valid for this EFI system.
137 IN CONST EFI_PEI_SERVICES
**PeiServices
,
138 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
139 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
146 8-bit I/O read operations.
148 @param[in] PeiServices An indirect pointer to the PEI Services Table published
149 by the PEI Foundation.
150 @param[in] This Pointer to local data for the interface.
151 @param[in] Address The physical address of the access.
153 @return An 8-bit value returned from the I/O space.
158 IN CONST EFI_PEI_SERVICES
**PeiServices
,
159 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
164 16-bit I/O read operations.
166 @param[in] PeiServices An indirect pointer to the PEI Services Table published
167 by the PEI Foundation.
168 @param[in] This Pointer to local data for the interface.
169 @param[in] Address The physical address of the access.
171 @return A 16-bit value returned from the I/O space.
177 IN CONST EFI_PEI_SERVICES
**PeiServices
,
178 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
183 32-bit I/O read operations.
185 @param[in] PeiServices An indirect pointer to the PEI Services Table published
186 by the PEI Foundation.
187 @param[in] This Pointer to local data for the interface.
188 @param[in] Address The physical address of the access.
190 @return A 32-bit value returned from the I/O space.
196 IN CONST EFI_PEI_SERVICES
**PeiServices
,
197 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
202 64-bit I/O read operations.
204 @param[in] PeiServices An indirect pointer to the PEI Services Table published
205 by the PEI Foundation.
206 @param[in] This Pointer to local data for the interface.
207 @param[in] Address The physical address of the access.
209 @return A 64-bit value returned from the I/O space.
215 IN CONST EFI_PEI_SERVICES
**PeiServices
,
216 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
221 8-bit I/O write operations.
223 @param[in] PeiServices An indirect pointer to the PEI Services Table published
224 by the PEI Foundation.
225 @param[in] This Pointer to local data for the interface.
226 @param[in] Address The physical address of the access.
227 @param[in] Data The data to write.
233 IN CONST EFI_PEI_SERVICES
**PeiServices
,
234 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
240 16-bit I/O write operations.
242 @param[in] PeiServices An indirect pointer to the PEI Services Table published
243 by the PEI Foundation.
244 @param[in] This Pointer to local data for the interface.
245 @param[in] Address The physical address of the access.
246 @param[in] Data The data to write.
252 IN CONST EFI_PEI_SERVICES
**PeiServices
,
253 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
259 32-bit I/O write operations.
261 @param[in] PeiServices An indirect pointer to the PEI Services Table published
262 by the PEI Foundation.
263 @param[in] This Pointer to local data for the interface.
264 @param[in] Address The physical address of the access.
265 @param[in] Data The data to write.
271 IN CONST EFI_PEI_SERVICES
**PeiServices
,
272 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
278 64-bit I/O write operations.
280 @param[in] PeiServices An indirect pointer to the PEI Services Table published
281 by the PEI Foundation.
282 @param[in] This Pointer to local data for the interface.
283 @param[in] Address The physical address of the access.
284 @param[in] Data The data to write.
290 IN CONST EFI_PEI_SERVICES
**PeiServices
,
291 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
297 8-bit memory read operations.
299 @param[in] PeiServices An indirect pointer to the PEI Services Table published
300 by the PEI Foundation.
301 @param[in] This Pointer to local data for the interface.
302 @param[in] Address The physical address of the access.
304 @return An 8-bit value returned from the memory space.
310 IN CONST EFI_PEI_SERVICES
**PeiServices
,
311 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
316 16-bit memory read operations.
318 @param[in] PeiServices An indirect pointer to the PEI Services Table published
319 by the PEI Foundation.
320 @param[in] This Pointer to local data for the interface.
321 @param[in] Address The physical address of the access.
323 @return A 16-bit value returned from the memory space.
329 IN CONST EFI_PEI_SERVICES
**PeiServices
,
330 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
335 32-bit memory read operations.
337 @param[in] PeiServices An indirect pointer to the PEI Services Table published
338 by the PEI Foundation.
339 @param[in] This Pointer to local data for the interface.
340 @param[in] Address The physical address of the access.
342 @return A 32-bit value returned from the memory space.
348 IN CONST EFI_PEI_SERVICES
**PeiServices
,
349 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
354 64-bit memory read operations.
356 @param[in] PeiServices An indirect pointer to the PEI Services Table published
357 by the PEI Foundation.
358 @param[in] This Pointer to local data for the interface.
359 @param[in] Address The physical address of the access.
361 @return A 64-bit value returned from the memory space.
367 IN CONST EFI_PEI_SERVICES
**PeiServices
,
368 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
373 8-bit memory write operations.
375 @param[in] PeiServices An indirect pointer to the PEI Services Table published
376 by the PEI Foundation.
377 @param[in] This Pointer to local data for the interface.
378 @param[in] Address The physical address of the access.
379 @param[in] Data The data to write.
385 IN CONST EFI_PEI_SERVICES
**PeiServices
,
386 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
392 16-bit memory write operations.
394 @param[in] PeiServices An indirect pointer to the PEI Services Table published
395 by the PEI Foundation.
396 @param[in] This Pointer to local data for the interface.
397 @param[in] Address The physical address of the access.
398 @param[in] Data The data to write.
404 IN CONST EFI_PEI_SERVICES
**PeiServices
,
405 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
411 32-bit memory write operations.
413 @param[in] PeiServices An indirect pointer to the PEI Services Table published
414 by the PEI Foundation.
415 @param[in] This Pointer to local data for the interface.
416 @param[in] Address The physical address of the access.
417 @param[in] Data The data to write.
423 IN CONST EFI_PEI_SERVICES
**PeiServices
,
424 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
430 64-bit memory write operations.
432 @param[in] PeiServices An indirect pointer to the PEI Services Table published
433 by the PEI Foundation.
434 @param[in] This Pointer to local data for the interface.
435 @param[in] Address The physical address of the access.
436 @param[in] Data The data to write.
442 IN CONST EFI_PEI_SERVICES
**PeiServices
,
443 IN CONST EFI_PEI_CPU_IO_PPI
*This
,