2156f6b480f27de6dbc599c129785d8f70fd5ce9
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. 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.
18 Reads an 8-bit I/O port.
20 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
21 This function must guarantee that all I/O read and write operations are
24 If 8-bit I/O port operations are not supported, then ASSERT().
26 @param Port The I/O port to read.
28 @return The value read.
37 EFI_PEI_SERVICES
**PeiServices
;
38 EFI_PEI_CPU_IO_PPI
*CpuIo
;
40 PeiServices
= GetPeiServicesTablePointer ();
41 CpuIo
= (*PeiServices
)->CpuIo
;
43 ASSERT (CpuIo
!= NULL
);
45 return CpuIo
->IoRead8 (PeiServices
, CpuIo
, (UINT64
) Port
);
49 Writes an 8-bit I/O port.
51 Writes the 8-bit I/O port specified by Port with the value specified by Value
52 and returns Value. This function must guarantee that all I/O read and write
53 operations are serialized.
55 If 8-bit I/O port operations are not supported, then ASSERT().
57 @param Port The I/O port to write.
58 @param Value The value to write to the I/O port.
60 @return The value written the I/O port.
70 EFI_PEI_SERVICES
**PeiServices
;
71 EFI_PEI_CPU_IO_PPI
*CpuIo
;
73 PeiServices
= GetPeiServicesTablePointer ();
74 CpuIo
= (*PeiServices
)->CpuIo
;
76 ASSERT (CpuIo
!= NULL
);
78 CpuIo
->IoWrite8 (PeiServices
, CpuIo
, (UINT64
) Port
, Value
);
83 Reads a 16-bit I/O port.
85 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
86 This function must guarantee that all I/O read and write operations are
89 If 16-bit I/O port operations are not supported, then ASSERT().
91 @param Port The I/O port to read.
93 @return The value read.
102 EFI_PEI_SERVICES
**PeiServices
;
103 EFI_PEI_CPU_IO_PPI
*CpuIo
;
105 PeiServices
= GetPeiServicesTablePointer ();
106 CpuIo
= (*PeiServices
)->CpuIo
;
108 ASSERT (CpuIo
!= NULL
);
110 return CpuIo
->IoRead16 (PeiServices
, CpuIo
, (UINT64
) Port
);
114 Writes a 16-bit I/O port.
116 Writes the 16-bit I/O port specified by Port with the value specified by Value
117 and returns Value. This function must guarantee that all I/O read and write
118 operations are serialized.
120 If 16-bit I/O port operations are not supported, then ASSERT().
122 @param Port The I/O port to write.
123 @param Value The value to write to the I/O port.
125 @return The value written the I/O port.
135 EFI_PEI_SERVICES
**PeiServices
;
136 EFI_PEI_CPU_IO_PPI
*CpuIo
;
138 PeiServices
= GetPeiServicesTablePointer ();
139 CpuIo
= (*PeiServices
)->CpuIo
;
141 ASSERT (CpuIo
!= NULL
);
143 CpuIo
->IoWrite16 (PeiServices
, CpuIo
, (UINT64
) Port
, Value
);
148 Reads a 32-bit I/O port.
150 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
151 This function must guarantee that all I/O read and write operations are
154 If 32-bit I/O port operations are not supported, then ASSERT().
156 @param Port The I/O port to read.
158 @return The value read.
167 EFI_PEI_SERVICES
**PeiServices
;
168 EFI_PEI_CPU_IO_PPI
*CpuIo
;
170 PeiServices
= GetPeiServicesTablePointer ();
171 CpuIo
= (*PeiServices
)->CpuIo
;
173 ASSERT (CpuIo
!= NULL
);
175 return CpuIo
->IoRead32 (PeiServices
, CpuIo
, (UINT64
) Port
);
179 Writes a 32-bit I/O port.
181 Writes the 32-bit I/O port specified by Port with the value specified by Value
182 and returns Value. This function must guarantee that all I/O read and write
183 operations are serialized.
185 If 32-bit I/O port operations are not supported, then ASSERT().
187 @param Port The I/O port to write.
188 @param Value The value to write to the I/O port.
190 @return The value written the I/O port.
200 EFI_PEI_SERVICES
**PeiServices
;
201 EFI_PEI_CPU_IO_PPI
*CpuIo
;
203 PeiServices
= GetPeiServicesTablePointer ();
204 CpuIo
= (*PeiServices
)->CpuIo
;
206 ASSERT (CpuIo
!= NULL
);
208 CpuIo
->IoWrite32 (PeiServices
, CpuIo
, (UINT64
) Port
, Value
);
213 Reads a 64-bit I/O port.
215 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
216 This function must guarantee that all I/O read and write operations are
219 If 64-bit I/O port operations are not supported, then ASSERT().
221 @param Port The I/O port to read.
223 @return The value read.
232 EFI_PEI_SERVICES
**PeiServices
;
233 EFI_PEI_CPU_IO_PPI
*CpuIo
;
235 PeiServices
= GetPeiServicesTablePointer ();
236 CpuIo
= (*PeiServices
)->CpuIo
;
238 ASSERT (CpuIo
!= NULL
);
240 return CpuIo
->IoRead64 (PeiServices
, CpuIo
, (UINT64
) Port
);
244 Writes a 64-bit I/O port.
246 Writes the 64-bit I/O port specified by Port with the value specified by Value
247 and returns Value. This function must guarantee that all I/O read and write
248 operations are serialized.
250 If 64-bit I/O port operations are not supported, then ASSERT().
252 @param Port The I/O port to write.
253 @param Value The value to write to the I/O port.
255 @return The value written the I/O port.
265 EFI_PEI_SERVICES
**PeiServices
;
266 EFI_PEI_CPU_IO_PPI
*CpuIo
;
268 PeiServices
= GetPeiServicesTablePointer ();
269 CpuIo
= (*PeiServices
)->CpuIo
;
271 ASSERT (CpuIo
!= NULL
);
273 CpuIo
->IoWrite64 (PeiServices
, CpuIo
, (UINT64
) Port
, Value
);
278 Reads an 8-bit MMIO register.
280 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
281 returned. This function must guarantee that all MMIO read and write
282 operations are serialized.
284 If 8-bit MMIO register operations are not supported, then ASSERT().
286 @param Address The MMIO register to read.
288 @return The value read.
297 EFI_PEI_SERVICES
**PeiServices
;
298 EFI_PEI_CPU_IO_PPI
*CpuIo
;
300 PeiServices
= GetPeiServicesTablePointer ();
301 CpuIo
= (*PeiServices
)->CpuIo
;
303 ASSERT (CpuIo
!= NULL
);
305 return CpuIo
->MemRead8 (PeiServices
, CpuIo
, (UINT64
) Address
);
309 Writes an 8-bit MMIO register.
311 Writes the 8-bit MMIO register specified by Address with the value specified
312 by Value and returns Value. This function must guarantee that all MMIO read
313 and write operations are serialized.
315 If 8-bit MMIO register operations are not supported, then ASSERT().
317 @param Address The MMIO register to write.
318 @param Value The value to write to the MMIO register.
328 EFI_PEI_SERVICES
**PeiServices
;
329 EFI_PEI_CPU_IO_PPI
*CpuIo
;
331 PeiServices
= GetPeiServicesTablePointer ();
332 CpuIo
= (*PeiServices
)->CpuIo
;
334 ASSERT (CpuIo
!= NULL
);
336 CpuIo
->MemWrite8 (PeiServices
, CpuIo
, (UINT64
) Address
, Value
);
341 Reads a 16-bit MMIO register.
343 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
344 returned. This function must guarantee that all MMIO read and write
345 operations are serialized.
347 If 16-bit MMIO register operations are not supported, then ASSERT().
349 @param Address The MMIO register to read.
351 @return The value read.
360 EFI_PEI_SERVICES
**PeiServices
;
361 EFI_PEI_CPU_IO_PPI
*CpuIo
;
363 PeiServices
= GetPeiServicesTablePointer ();
364 CpuIo
= (*PeiServices
)->CpuIo
;
366 ASSERT (CpuIo
!= NULL
);
368 return CpuIo
->MemRead16 (PeiServices
, CpuIo
, (UINT64
) Address
);
373 Writes a 16-bit MMIO register.
375 Writes the 16-bit MMIO register specified by Address with the value specified
376 by Value and returns Value. This function must guarantee that all MMIO read
377 and write operations are serialized.
379 If 16-bit MMIO register operations are not supported, then ASSERT().
381 @param Address The MMIO register to write.
382 @param Value The value to write to the MMIO register.
392 EFI_PEI_SERVICES
**PeiServices
;
393 EFI_PEI_CPU_IO_PPI
*CpuIo
;
395 PeiServices
= GetPeiServicesTablePointer ();
396 CpuIo
= (*PeiServices
)->CpuIo
;
398 ASSERT (CpuIo
!= NULL
);
400 CpuIo
->MemWrite16 (PeiServices
, CpuIo
, (UINT64
) Address
, Value
);
405 Reads a 32-bit MMIO register.
407 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
408 returned. This function must guarantee that all MMIO read and write
409 operations are serialized.
411 If 32-bit MMIO register operations are not supported, then ASSERT().
413 @param Address The MMIO register to read.
415 @return The value read.
424 EFI_PEI_SERVICES
**PeiServices
;
425 EFI_PEI_CPU_IO_PPI
*CpuIo
;
427 PeiServices
= GetPeiServicesTablePointer ();
428 CpuIo
= (*PeiServices
)->CpuIo
;
430 ASSERT (CpuIo
!= NULL
);
432 return CpuIo
->MemRead32 (PeiServices
, CpuIo
, (UINT64
) Address
);
437 Writes a 32-bit MMIO register.
439 Writes the 32-bit MMIO register specified by Address with the value specified
440 by Value and returns Value. This function must guarantee that all MMIO read
441 and write operations are serialized.
443 If 32-bit MMIO register operations are not supported, then ASSERT().
445 @param Address The MMIO register to write.
446 @param Value The value to write to the MMIO register.
456 EFI_PEI_SERVICES
**PeiServices
;
457 EFI_PEI_CPU_IO_PPI
*CpuIo
;
459 PeiServices
= GetPeiServicesTablePointer ();
460 CpuIo
= (*PeiServices
)->CpuIo
;
462 ASSERT (CpuIo
!= NULL
);
464 CpuIo
->MemWrite32 (PeiServices
, CpuIo
, (UINT64
) Address
, Value
);
469 Reads a 64-bit MMIO register.
471 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
472 returned. This function must guarantee that all MMIO read and write
473 operations are serialized.
475 If 64-bit MMIO register operations are not supported, then ASSERT().
477 @param Address The MMIO register to read.
479 @return The value read.
488 EFI_PEI_SERVICES
**PeiServices
;
489 EFI_PEI_CPU_IO_PPI
*CpuIo
;
491 PeiServices
= GetPeiServicesTablePointer ();
492 CpuIo
= (*PeiServices
)->CpuIo
;
494 ASSERT (CpuIo
!= NULL
);
496 return CpuIo
->MemRead64 (PeiServices
, CpuIo
, (UINT64
) Address
);
501 Writes a 64-bit MMIO register.
503 Writes the 64-bit MMIO register specified by Address with the value specified
504 by Value and returns Value. This function must guarantee that all MMIO read
505 and write operations are serialized.
507 If 64-bit MMIO register operations are not supported, then ASSERT().
509 @param Address The MMIO register to write.
510 @param Value The value to write to the MMIO register.
520 EFI_PEI_SERVICES
**PeiServices
;
521 EFI_PEI_CPU_IO_PPI
*CpuIo
;
523 PeiServices
= GetPeiServicesTablePointer ();
524 CpuIo
= (*PeiServices
)->CpuIo
;
526 ASSERT (CpuIo
!= NULL
);
528 CpuIo
->MemWrite64 (PeiServices
, CpuIo
, (UINT64
) Address
, Value
);