]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/S3IoLib.h
2 I/O and MMIO Library Services that do I/O and also enable the I/O operation
3 to be replayed during an S3 resume. This library class maps directly on top
6 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions
10 of the BSD License which accompanies this distribution. The
11 full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #ifndef __S3_IO_LIB_H__
20 #define __S3_IO_LIB_H__
23 Reads an 8-bit I/O port and saves the value in the S3 script to be replayed
26 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
27 This function must guarantee that all I/O read and write operations are
30 If 8-bit I/O port operations are not supported, then ASSERT().
32 @param[in] Port The I/O port to read.
34 @return The value read.
44 Writes an 8-bit I/O port, and saves the value in the S3 script to be replayed
47 Writes the 8-bit I/O port specified by Port with the value specified by Value
48 and returns Value. This function must guarantee that all I/O read and write
49 operations are serialized.
51 If 8-bit I/O port operations are not supported, then ASSERT().
53 @param[in] Port The I/O port to write.
54 @param[in] Value The value to write to the I/O port.
56 @return The value written the I/O port.
67 Reads an 8-bit I/O port, performs a bitwise OR, writes the
68 result back to the 8-bit I/O port, and saves the value in the S3 script to be
69 replayed on S3 resume.
71 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
72 between the read result and the value specified by OrData, and writes the
73 result to the 8-bit I/O port specified by Port. The value written to the I/O
74 port is returned. This function must guarantee that all I/O read and write
75 operations are serialized.
77 If 8-bit I/O port operations are not supported, then ASSERT().
79 @param[in] Port The I/O port to write.
80 @param[in] OrData The value to OR with the read value from the I/O port.
82 @return The value written back to the I/O port.
93 Reads an 8-bit I/O port, performs a bitwise AND, writes the result back
94 to the 8-bit I/O port, and saves the value in the S3 script to be replayed
97 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
98 the read result and the value specified by AndData, and writes the result to
99 the 8-bit I/O port specified by Port. The value written to the I/O port is
100 returned. This function must guarantee that all I/O read and write operations
103 If 8-bit I/O port operations are not supported, then ASSERT().
105 @param[in] Port The I/O port to write.
106 @param[in] AndData The value to AND with the read value from the I/O port.
108 @return The value written back to the I/O port.
119 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
120 inclusive OR, writes the result back to the 8-bit I/O port, and saves
121 the value in the S3 script to be replayed on S3 resume.
123 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
124 the read result and the value specified by AndData, performs a bitwise OR
125 between the result of the AND operation and the value specified by OrData,
126 and writes the result to the 8-bit I/O port specified by Port. The value
127 written to the I/O port is returned. This function must guarantee that all
128 I/O read and write operations are serialized.
130 If 8-bit I/O port operations are not supported, then ASSERT().
132 @param[in] Port The I/O port to write.
133 @param[in] AndData The value to AND with the read value from the I/O port.
134 @param[in] OrData The value to OR with the result of the AND operation.
136 @return The value written back to the I/O port.
148 Reads a bit field of an I/O register, and saves the value in the S3 script to
149 be replayed on S3 resume.
151 Reads the bit field in an 8-bit I/O register. The bit field is specified by
152 the StartBit and the EndBit. The value of the bit field is returned.
154 If 8-bit I/O port operations are not supported, then ASSERT().
155 If StartBit is greater than 7, then ASSERT().
156 If EndBit is greater than 7, then ASSERT().
157 If EndBit is less than StartBit, then ASSERT().
159 @param[in] Port The I/O port to read.
160 @param[in] StartBit The ordinal of the least significant bit in the bit field.
162 @param[in] EndBit The ordinal of the most significant bit in the bit field.
165 @return The value read.
177 Writes a bit field to an I/O register and saves the value in the S3 script to
178 be replayed on S3 resume.
180 Writes Value to the bit field of the I/O register. The bit field is specified
181 by the StartBit and the EndBit. All other bits in the destination I/O
182 register are preserved. The value written to the I/O port is returned.
183 Remaining bits in Value are stripped.
185 If 8-bit I/O port operations are not supported, then ASSERT().
186 If StartBit is greater than 7, then ASSERT().
187 If EndBit is greater than 7, then ASSERT().
188 If EndBit is less than StartBit, then ASSERT().
190 @param[in] Port The I/O port to write.
191 @param[in] StartBit The ordinal of the least significant bit in the bit field.
193 @param[in] EndBit The ordinal of the most significant bit in the bit field.
195 @param[in] Value New value of the bit field.
197 @return The value written back to the I/O port.
210 Reads a bit field in an 8-bit port, performs a bitwise OR, writes the
211 result back to the bit field in the 8-bit port, and saves the value in the
212 S3 script to be replayed on S3 resume.
214 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
215 between the read result and the value specified by OrData, and writes the
216 result to the 8-bit I/O port specified by Port. The value written to the I/O
217 port is returned. This function must guarantee that all I/O read and write
218 operations are serialized. Extra left bits in OrData are stripped.
220 If 8-bit I/O port operations are not supported, then ASSERT().
221 If StartBit is greater than 7, then ASSERT().
222 If EndBit is greater than 7, then ASSERT().
223 If EndBit is less than StartBit, then ASSERT().
225 @param[in] Port The I/O port to write.
226 @param[in] StartBit The ordinal of the least significant bit in the bit field.
228 @param[in] EndBit The ordinal of the most significant bit in the bit field.
230 @param[in] OrData The value to OR with the read value from the I/O port.
232 @return The value written back to the I/O port.
245 Reads a bit field in an 8-bit port, performs a bitwise AND, writes the
246 result back to the bit field in the 8-bit port, and saves the value in the
247 S3 script to be replayed on S3 resume.
249 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
250 the read result and the value specified by AndData, and writes the result to
251 the 8-bit I/O port specified by Port. The value written to the I/O port is
252 returned. This function must guarantee that all I/O read and write operations
253 are serialized. Extra left bits in AndData are stripped.
255 If 8-bit I/O port operations are not supported, then ASSERT().
256 If StartBit is greater than 7, then ASSERT().
257 If EndBit is greater than 7, then ASSERT().
258 If EndBit is less than StartBit, then ASSERT().
260 @param[in] Port The I/O port to write.
261 @param[in] StartBit The ordinal of the least significant bit in the bit field.
263 @param[in] EndBit The ordinal of the most significant bit in the bit field.
265 @param[in] AndData The value to AND with the read value from the I/O port.
267 @return The value written back to the I/O port.
280 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
281 bitwise OR, writes the result back to the bit field in the
282 8-bit port, and saves the value in the S3 script to be replayed on S3 resume.
284 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
285 by a bitwise OR between the read result and the value specified by
286 AndData, and writes the result to the 8-bit I/O port specified by Port. The
287 value written to the I/O port is returned. This function must guarantee that
288 all I/O read and write operations are serialized. Extra left bits in both
289 AndData and OrData are stripped.
291 If 8-bit I/O port operations are not supported, then ASSERT().
292 If StartBit is greater than 7, then ASSERT().
293 If EndBit is greater than 7, then ASSERT().
294 If EndBit is less than StartBit, then ASSERT().
296 @param[in] Port The I/O port to write.
297 @param[in] StartBit The ordinal of the least significant bit in the bit field.
299 @param[in] EndBit The ordinal of the most significant bit in the bit field.
301 @param[in] AndData The value to AND with the read value from the I/O port.
302 @param[in] OrData The value to OR with the result of the AND operation.
304 @return The value written back to the I/O port.
309 S3IoBitFieldAndThenOr8 (
318 Reads a 16-bit I/O port, and saves the value in the S3 script to be replayed
321 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
322 This function must guarantee that all I/O read and write operations are
325 If 16-bit I/O port operations are not supported, then ASSERT().
327 @param[in] Port The I/O port to read.
329 @return The value read.
339 Writes a 16-bit I/O port, and saves the value in the S3 script to be replayed
342 Writes the 16-bit I/O port specified by Port with the value specified by Value
343 and returns Value. This function must guarantee that all I/O read and write
344 operations are serialized.
346 If 16-bit I/O port operations are not supported, then ASSERT().
348 @param[in] Port The I/O port to write.
349 @param[in] Value The value to write to the I/O port.
351 @return The value written the I/O port.
362 Reads a 16-bit I/O port, performs a bitwise OR, writes the
363 result back to the 16-bit I/O port, and saves the value in the S3 script to
364 be replayed on S3 resume.
366 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
367 between the read result and the value specified by OrData, and writes the
368 result to the 16-bit I/O port specified by Port. The value written to the I/O
369 port is returned. This function must guarantee that all I/O read and write
370 operations are serialized.
372 If 16-bit I/O port operations are not supported, then ASSERT().
374 @param[in] Port The I/O port to write.
375 @param[in] OrData The value to OR with the read value from the I/O port.
377 @return The value written back to the I/O port.
388 Reads a 16-bit I/O port, performs a bitwise AND, writes the result back
389 to the 16-bit I/O port , and saves the value in the S3 script to be replayed
392 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
393 the read result and the value specified by AndData, and writes the result to
394 the 16-bit I/O port specified by Port. The value written to the I/O port is
395 returned. This function must guarantee that all I/O read and write operations
398 If 16-bit I/O port operations are not supported, then ASSERT().
400 @param[in] Port The I/O port to write.
401 @param[in] AndData The value to AND with the read value from the I/O port.
403 @return The value written back to the I/O port.
414 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
415 inclusive OR, writes the result back to the 16-bit I/O port, and saves
416 the value in the S3 script to be replayed on S3 resume.
418 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
419 the read result and the value specified by AndData, performs a bitwise OR
420 between the result of the AND operation and the value specified by OrData,
421 and writes the result to the 16-bit I/O port specified by Port. The value
422 written to the I/O port is returned. This function must guarantee that all
423 I/O read and write operations are serialized.
425 If 16-bit I/O port operations are not supported, then ASSERT().
427 @param[in] Port The I/O port to write.
428 @param[in] AndData The value to AND with the read value from the I/O port.
429 @param[in] OrData The value to OR with the result of the AND operation.
431 @return The value written back to the I/O port.
443 Reads a bit field of an I/O register saves the value in the S3 script to be
444 replayed on S3 resume.
446 Reads the bit field in a 16-bit I/O register. The bit field is specified by
447 the StartBit and the EndBit. The value of the bit field is returned.
449 If 16-bit I/O port operations are not supported, then ASSERT().
450 If StartBit is greater than 15, then ASSERT().
451 If EndBit is greater than 15, then ASSERT().
452 If EndBit is less than StartBit, then ASSERT().
454 @param[in] Port The I/O port to read.
455 @param[in] StartBit The ordinal of the least significant bit in the bit field.
457 @param[in] EndBit The ordinal of the most significant bit in the bit field.
460 @return The value read.
472 Writes a bit field to an I/O register, and saves the value in the S3 script
473 to be replayed on S3 resume.
475 Writes Value to the bit field of the I/O register. The bit field is specified
476 by the StartBit and the EndBit. All other bits in the destination I/O
477 register are preserved. The value written to the I/O port is returned. Extra
478 left bits in Value are stripped.
480 If 16-bit I/O port operations are not supported, then ASSERT().
481 If StartBit is greater than 15, then ASSERT().
482 If EndBit is greater than 15, then ASSERT().
483 If EndBit is less than StartBit, then ASSERT().
485 @param[in] Port The I/O port to write.
486 @param[in] StartBit The ordinal of the least significant bit in the bit field.
488 @param[in] EndBit The ordinal of the most significant bit in the bit field.
490 @param[in] Value New value of the bit field.
492 @return The value written back to the I/O port.
497 S3IoBitFieldWrite16 (
505 Reads a bit field in a 16-bit port, performs a bitwise OR, writes the
506 result back to the bit field in the 16-bit port, and saves the value in the
507 S3 script to be replayed on S3 resume.
509 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
510 between the read result and the value specified by OrData, and writes the
511 result to the 16-bit I/O port specified by Port. The value written to the I/O
512 port is returned. This function must guarantee that all I/O read and write
513 operations are serialized. Extra left bits in OrData are stripped.
515 If 16-bit I/O port operations are not supported, then ASSERT().
516 If StartBit is greater than 15, then ASSERT().
517 If EndBit is greater than 15, then ASSERT().
518 If EndBit is less than StartBit, then ASSERT().
520 @param[in] Port The I/O port to write.
521 @param[in] StartBit The ordinal of the least significant bit in the bit field.
523 @param[in] EndBit The ordinal of the most significant bit in the bit field.
525 @param[in] OrData The value to OR with the read value from the I/O port.
527 @return The value written back to the I/O port.
540 Reads a bit field in a 16-bit port, performs a bitwise AND, writes the
541 result back to the bit field in the 16-bit port, and saves the value in the
542 S3 script to be replayed on S3 resume.
544 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
545 the read result and the value specified by AndData, and writes the result to
546 the 16-bit I/O port specified by Port. The value written to the I/O port is
547 returned. This function must guarantee that all I/O read and write operations
548 are serialized. Extra left bits in AndData are stripped.
550 If 16-bit I/O port operations are not supported, then ASSERT().
551 If StartBit is greater than 15, then ASSERT().
552 If EndBit is greater than 15, then ASSERT().
553 If EndBit is less than StartBit, then ASSERT().
555 @param[in] Port The I/O port to write.
556 @param[in] StartBit The ordinal of the least significant bit in the bit field.
558 @param[in] EndBit The ordinal of the most significant bit in the bit field.
560 @param[in] AndData The value to AND with the read value from the I/O port.
562 @return The value written back to the I/O port.
575 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
576 bitwise OR, writes the result back to the bit field in the
577 16-bit port, and saves the value in the S3 script to be replayed on S3
580 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
581 by a bitwise OR between the read result and the value specified by
582 AndData, and writes the result to the 16-bit I/O port specified by Port. The
583 value written to the I/O port is returned. This function must guarantee that
584 all I/O read and write operations are serialized. Extra left bits in both
585 AndData and OrData are stripped.
587 If 16-bit I/O port operations are not supported, then ASSERT().
588 If StartBit is greater than 15, then ASSERT().
589 If EndBit is greater than 15, then ASSERT().
590 If EndBit is less than StartBit, then ASSERT().
592 @param[in] Port The I/O port to write.
593 @param[in] StartBit The ordinal of the least significant bit in the bit field.
595 @param[in] EndBit The ordinal of the most significant bit in the bit field.
597 @param[in] AndData The value to AND with the read value from the I/O port.
598 @param[in] OrData The value to OR with the result of the AND operation.
600 @return The value written back to the I/O port.
605 S3IoBitFieldAndThenOr16 (
614 Reads a 32-bit I/O port, and saves the value in the S3 script to be replayed
617 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
618 This function must guarantee that all I/O read and write operations are
621 If 32-bit I/O port operations are not supported, then ASSERT().
623 @param[in] Port The I/O port to read.
625 @return The value read.
635 Writes a 32-bit I/O port, and saves the value in the S3 script to be replayed
638 Writes the 32-bit I/O port specified by Port with the value specified by Value
639 and returns Value. This function must guarantee that all I/O read and write
640 operations are serialized.
642 If 32-bit I/O port operations are not supported, then ASSERT().
644 @param[in] Port The I/O port to write.
645 @param[in] Value The value to write to the I/O port.
647 @return The value written the I/O port.
658 Reads a 32-bit I/O port, performs a bitwise OR, writes the
659 result back to the 32-bit I/O port, and saves the value in the S3 script to
660 be replayed on S3 resume.
662 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
663 between the read result and the value specified by OrData, and writes the
664 result to the 32-bit I/O port specified by Port. The value written to the I/O
665 port is returned. This function must guarantee that all I/O read and write
666 operations are serialized.
668 If 32-bit I/O port operations are not supported, then ASSERT().
670 @param[in] Port The I/O port to write.
671 @param[in] OrData The value to OR with the read value from the I/O port.
673 @return The value written back to the I/O port.
684 Reads a 32-bit I/O port, performs a bitwise AND, writes the result back
685 to the 32-bit I/O port, and saves the value in the S3 script to be replayed
688 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
689 the read result and the value specified by AndData, and writes the result to
690 the 32-bit I/O port specified by Port. The value written to the I/O port is
691 returned. This function must guarantee that all I/O read and write operations
694 If 32-bit I/O port operations are not supported, then ASSERT().
696 @param[in] Port The I/O port to write.
697 @param[in] AndData The value to AND with the read value from the I/O port.
699 @return The value written back to the I/O port.
710 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
711 inclusive OR, writes the result back to the 32-bit I/O port, and saves
712 the value in the S3 script to be replayed on S3 resume.
714 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
715 the read result and the value specified by AndData, performs a bitwise OR
716 between the result of the AND operation and the value specified by OrData,
717 and writes the result to the 32-bit I/O port specified by Port. The value
718 written to the I/O port is returned. This function must guarantee that all
719 I/O read and write operations are serialized.
721 If 32-bit I/O port operations are not supported, then ASSERT().
723 @param[in] Port The I/O port to write.
724 @param[in] AndData The value to AND with the read value from the I/O port.
725 @param[in] OrData The value to OR with the result of the AND operation.
727 @return The value written back to the I/O port.
739 Reads a bit field of an I/O register, and saves the value in the S3 script to
740 be replayed on S3 resume.
742 Reads the bit field in a 32-bit I/O register. The bit field is specified by
743 the StartBit and the EndBit. The value of the bit field is returned.
745 If 32-bit I/O port operations are not supported, then ASSERT().
746 If StartBit is greater than 31, then ASSERT().
747 If EndBit is greater than 31, then ASSERT().
748 If EndBit is less than StartBit, then ASSERT().
750 @param[in] Port The I/O port to read.
751 @param[in] StartBit The ordinal of the least significant bit in the bit field.
753 @param[in] EndBit The ordinal of the most significant bit in the bit field.
756 @return The value read.
768 Writes a bit field to an I/O register, and saves the value in the S3 script to
769 be replayed on S3 resume.
771 Writes Value to the bit field of the I/O register. The bit field is specified
772 by the StartBit and the EndBit. All other bits in the destination I/O
773 register are preserved. The value written to the I/O port is returned. Extra
774 left bits in Value are stripped.
776 If 32-bit I/O port operations are not supported, then ASSERT().
777 If StartBit is greater than 31, then ASSERT().
778 If EndBit is greater than 31, then ASSERT().
779 If EndBit is less than StartBit, then ASSERT().
781 @param[in] Port The I/O port to write.
782 @param[in] StartBit The ordinal of the least significant bit in the bit field.
784 @param[in] EndBit The ordinal of the most significant bit in the bit field.
786 @param[in] Value New value of the bit field.
788 @return The value written back to the I/O port.
793 S3IoBitFieldWrite32 (
801 Reads a bit field in a 32-bit port, performs a bitwise OR, writes the
802 result back to the bit field in the 32-bit port, and saves the value in the
803 S3 script to be replayed on S3 resume.
805 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
806 between the read result and the value specified by OrData, and writes the
807 result to the 32-bit I/O port specified by Port. The value written to the I/O
808 port is returned. This function must guarantee that all I/O read and write
809 operations are serialized. Extra left bits in OrData are stripped.
811 If 32-bit I/O port operations are not supported, then ASSERT().
812 If StartBit is greater than 31, then ASSERT().
813 If EndBit is greater than 31, then ASSERT().
814 If EndBit is less than StartBit, then ASSERT().
816 @param[in] Port The I/O port to write.
817 @param[in] StartBit The ordinal of the least significant bit in the bit field.
819 @param[in] EndBit The ordinal of the most significant bit in the bit field.
821 @param[in] OrData The value to OR with the read value from the I/O port.
823 @return The value written back to the I/O port.
836 Reads a bit field in a 32-bit port, performs a bitwise AND, writes the
837 result back to the bit field in the 32-bit port, and saves the value in the
838 S3 script to be replayed on S3 resume.
840 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
841 the read result and the value specified by AndData, and writes the result to
842 the 32-bit I/O port specified by Port. The value written to the I/O port is
843 returned. This function must guarantee that all I/O read and write operations
844 are serialized. Extra left bits in AndData are stripped.
846 If 32-bit I/O port operations are not supported, then ASSERT().
847 If StartBit is greater than 31, then ASSERT().
848 If EndBit is greater than 31, then ASSERT().
849 If EndBit is less than StartBit, then ASSERT().
851 @param[in] Port The I/O port to write.
852 @param[in] StartBit The ordinal of the least significant bit in the bit field.
854 @param[in] EndBit The ordinal of the most significant bit in the bit field.
856 @param[in] AndData The value to AND with the read value from the I/O port.
858 @return The value written back to the I/O port.
871 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
872 bitwise OR, writes the result back to the bit field in the
873 32-bit port, and saves the value in the S3 script to be replayed on S3
876 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
877 by a bitwise OR between the read result and the value specified by
878 AndData, and writes the result to the 32-bit I/O port specified by Port. The
879 value written to the I/O port is returned. This function must guarantee that
880 all I/O read and write operations are serialized. Extra left bits in both
881 AndData and OrData are stripped.
883 If 32-bit I/O port operations are not supported, then ASSERT().
884 If StartBit is greater than 31, then ASSERT().
885 If EndBit is greater than 31, then ASSERT().
886 If EndBit is less than StartBit, then ASSERT().
888 @param[in] Port The I/O port to write.
889 @param[in] StartBit The ordinal of the least significant bit in the bit field.
891 @param[in] EndBit The ordinal of the most significant bit in the bit field.
893 @param[in] AndData The value to AND with the read value from the I/O port.
894 @param[in] OrData The value to OR with the result of the AND operation.
896 @return The value written back to the I/O port.
901 S3IoBitFieldAndThenOr32 (
910 Reads a 64-bit I/O port, and saves the value in the S3 script to be replayed
913 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
914 This function must guarantee that all I/O read and write operations are
917 If 64-bit I/O port operations are not supported, then ASSERT().
919 @param[in] Port The I/O port to read.
921 @return The value read.
931 Writes a 64-bit I/O port, and saves the value in the S3 script to be replayed
934 Writes the 64-bit I/O port specified by Port with the value specified by Value
935 and returns Value. This function must guarantee that all I/O read and write
936 operations are serialized.
938 If 64-bit I/O port operations are not supported, then ASSERT().
940 @param[in] Port The I/O port to write.
941 @param[in] Value The value to write to the I/O port.
943 @return The value written to the I/O port.
954 Reads a 64-bit I/O port, performs a bitwise OR, writes the
955 result back to the 64-bit I/O port, and saves the value in the S3 script to
956 be replayed on S3 resume.
958 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
959 between the read result and the value specified by OrData, and writes the
960 result to the 64-bit I/O port specified by Port. The value written to the I/O
961 port is returned. This function must guarantee that all I/O read and write
962 operations are serialized.
964 If 64-bit I/O port operations are not supported, then ASSERT().
966 @param[in] Port The I/O port to write.
967 @param[in] OrData The value to OR with the read value from the I/O port.
969 @return The value written back to the I/O port.
980 Reads a 64-bit I/O port, performs a bitwise AND, writes the result back
981 to the 64-bit I/O port, and saves the value in the S3 script to be replayed
984 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
985 the read result and the value specified by AndData, and writes the result to
986 the 64-bit I/O port specified by Port. The value written to the I/O port is
987 returned. This function must guarantee that all I/O read and write operations
990 If 64-bit I/O port operations are not supported, then ASSERT().
992 @param[in] Port The I/O port to write.
993 @param[in] AndData The value to AND with the read value from the I/O port.
995 @return The value written back to the I/O port.
1006 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
1007 inclusive OR, writes the result back to the 64-bit I/O port, and saves
1008 the value in the S3 script to be replayed on S3 resume.
1010 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1011 the read result and the value specified by AndData, performs a bitwise OR
1012 between the result of the AND operation and the value specified by OrData,
1013 and writes the result to the 64-bit I/O port specified by Port. The value
1014 written to the I/O port is returned. This function must guarantee that all
1015 I/O read and write operations are serialized.
1017 If 64-bit I/O port operations are not supported, then ASSERT().
1019 @param[in] Port The I/O port to write.
1020 @param[in] AndData The value to AND with the read value from the I/O port.
1021 @param[in] OrData The value to OR with the result of the AND operation.
1023 @return The value written back to the I/O port.
1035 Reads a bit field of an I/O register, and saves the value in the S3 script to
1036 be replayed on S3 resume.
1038 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1039 the StartBit and the EndBit. The value of the bit field is returned.
1041 If 64-bit I/O port operations are not supported, then ASSERT().
1042 If StartBit is greater than 63, then ASSERT().
1043 If EndBit is greater than 63, then ASSERT().
1044 If EndBit is less than StartBit, then ASSERT().
1046 @param[in] Port The I/O port to read.
1047 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1049 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1052 @return The value read.
1057 S3IoBitFieldRead64 (
1064 Writes a bit field to an I/O register, and saves the value in the S3 script to
1065 be replayed on S3 resume.
1067 Writes Value to the bit field of the I/O register. The bit field is specified
1068 by the StartBit and the EndBit. All other bits in the destination I/O
1069 register are preserved. The value written to the I/O port is returned. Extra
1070 left bits in Value are stripped.
1072 If 64-bit I/O port operations are not supported, then ASSERT().
1073 If StartBit is greater than 63, then ASSERT().
1074 If EndBit is greater than 63, then ASSERT().
1075 If EndBit is less than StartBit, then ASSERT().
1077 @param[in] Port The I/O port to write.
1078 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1080 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1082 @param[in] Value New value of the bit field.
1084 @return The value written back to the I/O port.
1089 S3IoBitFieldWrite64 (
1097 Reads a bit field in a 64-bit port, performs a bitwise OR, writes the
1098 result back to the bit field in the 64-bit port, and saves the value in the
1099 S3 script to be replayed on S3 resume.
1101 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1102 between the read result and the value specified by OrData, and writes the
1103 result to the 64-bit I/O port specified by Port. The value written to the I/O
1104 port is returned. This function must guarantee that all I/O read and write
1105 operations are serialized. Extra left bits in OrData are stripped.
1107 If 64-bit I/O port operations are not supported, then ASSERT().
1108 If StartBit is greater than 63, then ASSERT().
1109 If EndBit is greater than 63, then ASSERT().
1110 If EndBit is less than StartBit, then ASSERT().
1112 @param[in] Port The I/O port to write.
1113 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1115 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1117 @param[in] OrData The value to OR with the read value from the I/O port.
1119 @return The value written back to the I/O port.
1132 Reads a bit field in a 64-bit port, performs a bitwise AND, writes the
1133 result back to the bit field in the 64-bit port, and saves the value in the
1134 S3 script to be replayed on S3 resume.
1136 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1137 the read result and the value specified by AndData, and writes the result to
1138 the 64-bit I/O port specified by Port. The value written to the I/O port is
1139 returned. This function must guarantee that all I/O read and write operations
1140 are serialized. Extra left bits in AndData are stripped.
1142 If 64-bit I/O port operations are not supported, then ASSERT().
1143 If StartBit is greater than 63, then ASSERT().
1144 If EndBit is greater than 63, then ASSERT().
1145 If EndBit is less than StartBit, then ASSERT().
1147 @param[in] Port The I/O port to write.
1148 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1150 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1152 @param[in] AndData The value to AND with the read value from the I/O port.
1154 @return The value written back to the I/O port.
1167 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1168 bitwise OR, writes the result back to the bit field in the
1169 64-bit port, and saves the value in the S3 script to be replayed on S3
1172 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1173 by a bitwise OR between the read result and the value specified by
1174 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1175 value written to the I/O port is returned. This function must guarantee that
1176 all I/O read and write operations are serialized. Extra left bits in both
1177 AndData and OrData are stripped.
1179 If 64-bit I/O port operations are not supported, then ASSERT().
1180 If StartBit is greater than 63, then ASSERT().
1181 If EndBit is greater than 63, then ASSERT().
1182 If EndBit is less than StartBit, then ASSERT().
1184 @param[in] Port The I/O port to write.
1185 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1187 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1189 @param[in] AndData The value to AND with the read value from the I/O port.
1190 @param[in] OrData The value to OR with the result of the AND operation.
1192 @return The value written back to the I/O port.
1197 S3IoBitFieldAndThenOr64 (
1206 Reads an 8-bit MMIO register, and saves the value in the S3 script to be
1207 replayed on S3 resume.
1209 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1210 returned. This function must guarantee that all MMIO read and write
1211 operations are serialized.
1213 If 8-bit MMIO register operations are not supported, then ASSERT().
1215 @param[in] Address The MMIO register to read.
1217 @return The value read.
1227 Writes an 8-bit MMIO register, and saves the value in the S3 script to be
1228 replayed on S3 resume.
1230 Writes the 8-bit MMIO register specified by Address with the value specified
1231 by Value and returns Value. This function must guarantee that all MMIO read
1232 and write operations are serialized.
1234 If 8-bit MMIO register operations are not supported, then ASSERT().
1236 @param[in] Address The MMIO register to write.
1237 @param[in] Value The value to write to the MMIO register.
1239 @return The value written the MMIO register.
1250 Reads an 8-bit MMIO register, performs a bitwise OR, writes the
1251 result back to the 8-bit MMIO register, and saves the value in the S3 script
1252 to be replayed on S3 resume.
1254 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1255 inclusive OR between the read result and the value specified by OrData, and
1256 writes the result to the 8-bit MMIO register specified by Address. The value
1257 written to the MMIO register is returned. This function must guarantee that
1258 all MMIO read and write operations are serialized.
1260 If 8-bit MMIO register operations are not supported, then ASSERT().
1262 @param[in] Address The MMIO register to write.
1263 @param[in] OrData The value to OR with the read value from the MMIO register.
1265 @return The value written back to the MMIO register.
1276 Reads an 8-bit MMIO register, performs a bitwise AND, writes the result
1277 back to the 8-bit MMIO register, and saves the value in the S3 script to be
1278 replayed on S3 resume.
1280 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1281 between the read result and the value specified by AndData, and writes the
1282 result to the 8-bit MMIO register specified by Address. The value written to
1283 the MMIO register is returned. This function must guarantee that all MMIO
1284 read and write operations are serialized.
1286 If 8-bit MMIO register operations are not supported, then ASSERT().
1288 @param[in] Address The MMIO register to write.
1289 @param[in] AndData The value to AND with the read value from the MMIO register.
1291 @return The value written back to the MMIO register.
1302 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1303 inclusive OR, writes the result back to the 8-bit MMIO register, and saves
1304 the value in the S3 script to be replayed on S3 resume.
1306 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1307 between the read result and the value specified by AndData, performs a
1308 bitwise OR between the result of the AND operation and the value specified by
1309 OrData, and writes the result to the 8-bit MMIO register specified by
1310 Address. The value written to the MMIO register is returned. This function
1311 must guarantee that all MMIO read and write operations are serialized.
1313 If 8-bit MMIO register operations are not supported, then ASSERT().
1315 @param[in] Address The MMIO register to write.
1316 @param[in] AndData The value to AND with the read value from the MMIO register.
1317 @param[in] OrData The value to OR with the result of the AND operation.
1319 @return The value written back to the MMIO register.
1331 Reads a bit field of a MMIO register, and saves the value in the S3 script to
1332 be replayed on S3 resume.
1334 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1335 the StartBit and the EndBit. The value of the bit field is returned.
1337 If 8-bit MMIO register operations are not supported, then ASSERT().
1338 If StartBit is greater than 7, then ASSERT().
1339 If EndBit is greater than 7, then ASSERT().
1340 If EndBit is less than StartBit, then ASSERT().
1342 @param[in] Address MMIO register to read.
1343 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1345 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1348 @return The value read.
1353 S3MmioBitFieldRead8 (
1360 Writes a bit field to an MMIO register, and saves the value in the S3 script to
1361 be replayed on S3 resume.
1363 Writes Value to the bit field of the MMIO register. The bit field is
1364 specified by the StartBit and the EndBit. All other bits in the destination
1365 MMIO register are preserved. The new value of the 8-bit register is returned.
1367 If 8-bit MMIO register operations are not supported, then ASSERT().
1368 If StartBit is greater than 7, then ASSERT().
1369 If EndBit is greater than 7, then ASSERT().
1370 If EndBit is less than StartBit, then ASSERT().
1372 @param[in] Address The MMIO register to write.
1373 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1375 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1377 @param[in] Value New value of the bit field.
1379 @return The value written back to the MMIO register.
1384 S3MmioBitFieldWrite8 (
1392 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR,
1393 writes the result back to the bit field in the 8-bit MMIO register, and saves
1394 the value in the S3 script to be replayed on S3 resume.
1396 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1397 inclusive OR between the read result and the value specified by OrData, and
1398 writes the result to the 8-bit MMIO register specified by Address. The value
1399 written to the MMIO register is returned. This function must guarantee that
1400 all MMIO read and write operations are serialized. Extra left bits in OrData
1403 If 8-bit MMIO register operations are not supported, then ASSERT().
1404 If StartBit is greater than 7, then ASSERT().
1405 If EndBit is greater than 7, then ASSERT().
1406 If EndBit is less than StartBit, then ASSERT().
1408 @param[in] Address The MMIO register to write.
1409 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1411 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1413 @param[in] OrData The value to OR with the read value from the MMIO register.
1415 @return The value written back to the MMIO register.
1428 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1429 writes the result back to the bit field in the 8-bit MMIO register, and saves
1430 the value in the S3 script to be replayed on S3 resume.
1432 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1433 between the read result and the value specified by AndData, and writes the
1434 result to the 8-bit MMIO register specified by Address. The value written to
1435 the MMIO register is returned. This function must guarantee that all MMIO
1436 read and write operations are serialized. Extra left bits in AndData are
1439 If 8-bit MMIO register operations are not supported, then ASSERT().
1440 If StartBit is greater than 7, then ASSERT().
1441 If EndBit is greater than 7, then ASSERT().
1442 If EndBit is less than StartBit, then ASSERT().
1444 @param[in] Address The MMIO register to write.
1445 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1447 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1449 @param[in] AndData The value to AND with the read value from the MMIO register.
1451 @return The value written back to the MMIO register.
1456 S3MmioBitFieldAnd8 (
1464 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1465 by a bitwise OR, writes the result back to the bit field in the
1466 8-bit MMIO register, and saves the value in the S3 script to be replayed
1469 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1470 followed by a bitwise OR between the read result and the value
1471 specified by AndData, and writes the result to the 8-bit MMIO register
1472 specified by Address. The value written to the MMIO register is returned.
1473 This function must guarantee that all MMIO read and write operations are
1474 serialized. Extra left bits in both AndData and OrData are stripped.
1476 If 8-bit MMIO register operations are not supported, then ASSERT().
1477 If StartBit is greater than 7, then ASSERT().
1478 If EndBit is greater than 7, then ASSERT().
1479 If EndBit is less than StartBit, then ASSERT().
1481 @param[in] Address The MMIO register to write.
1482 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1484 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1486 @param[in] AndData The value to AND with the read value from the MMIO register.
1487 @param[in] OrData The value to OR with the result of the AND operation.
1489 @return The value written back to the MMIO register.
1494 S3MmioBitFieldAndThenOr8 (
1503 Reads a 16-bit MMIO register, and saves the value in the S3 script to be replayed
1506 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1507 returned. This function must guarantee that all MMIO read and write
1508 operations are serialized.
1510 If 16-bit MMIO register operations are not supported, then ASSERT().
1512 @param[in] Address The MMIO register to read.
1514 @return The value read.
1524 Writes a 16-bit MMIO register, and saves the value in the S3 script to be replayed
1527 Writes the 16-bit MMIO register specified by Address with the value specified
1528 by Value and returns Value. This function must guarantee that all MMIO read
1529 and write operations are serialized, and saves the value in the S3 script to be
1530 replayed on S3 resume.
1532 If 16-bit MMIO register operations are not supported, then ASSERT().
1534 @param[in] Address The MMIO register to write.
1535 @param[in] Value The value to write to the MMIO register.
1537 @return The value written the MMIO register.
1548 Reads a 16-bit MMIO register, performs a bitwise OR, writes the
1549 result back to the 16-bit MMIO register, and saves the value in the S3 script
1550 to be replayed on S3 resume.
1552 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1553 inclusive OR between the read result and the value specified by OrData, and
1554 writes the result to the 16-bit MMIO register specified by Address. The value
1555 written to the MMIO register is returned. This function must guarantee that
1556 all MMIO read and write operations are serialized.
1558 If 16-bit MMIO register operations are not supported, then ASSERT().
1560 @param[in] Address The MMIO register to write.
1561 @param[in] OrData The value to OR with the read value from the MMIO register.
1563 @return The value written back to the MMIO register.
1574 Reads a 16-bit MMIO register, performs a bitwise AND, writes the result
1575 back to the 16-bit MMIO register, and saves the value in the S3 script to be
1576 replayed on S3 resume.
1578 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1579 between the read result and the value specified by AndData, and writes the
1580 result to the 16-bit MMIO register specified by Address. The value written to
1581 the MMIO register is returned. This function must guarantee that all MMIO
1582 read and write operations are serialized.
1584 If 16-bit MMIO register operations are not supported, then ASSERT().
1586 @param[in] Address The MMIO register to write.
1587 @param[in] AndData The value to AND with the read value from the MMIO register.
1589 @return The value written back to the MMIO register.
1600 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1601 inclusive OR, writes the result back to the 16-bit MMIO register, and
1602 saves the value in the S3 script to be replayed on S3 resume.
1604 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1605 between the read result and the value specified by AndData, performs a
1606 bitwise OR between the result of the AND operation and the value specified by
1607 OrData, and writes the result to the 16-bit MMIO register specified by
1608 Address. The value written to the MMIO register is returned. This function
1609 must guarantee that all MMIO read and write operations are serialized.
1611 If 16-bit MMIO register operations are not supported, then ASSERT().
1613 @param[in] Address The MMIO register to write.
1614 @param[in] AndData The value to AND with the read value from the MMIO register.
1615 @param[in] OrData The value to OR with the result of the AND operation.
1617 @return The value written back to the MMIO register.
1629 Reads a bit field of a MMIO register, and saves the value in the S3 script to
1630 be replayed on S3 resume.
1632 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1633 the StartBit and the EndBit. The value of the bit field is returned.
1635 If 16-bit MMIO register operations are not supported, then ASSERT().
1636 If StartBit is greater than 15, then ASSERT().
1637 If EndBit is greater than 15, then ASSERT().
1638 If EndBit is less than StartBit, then ASSERT().
1640 @param[in] Address MMIO register to read.
1641 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1643 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1646 @return The value read.
1651 S3MmioBitFieldRead16 (
1658 Writes a bit field to a MMIO register, and saves the value in the S3 script to
1659 be replayed on S3 resume.
1661 Writes Value to the bit field of the MMIO register. The bit field is
1662 specified by the StartBit and the EndBit. All other bits in the destination
1663 MMIO register are preserved. The new value of the 16-bit register is returned.
1665 If 16-bit MMIO register operations are not supported, then ASSERT().
1666 If StartBit is greater than 15, then ASSERT().
1667 If EndBit is greater than 15, then ASSERT().
1668 If EndBit is less than StartBit, then ASSERT().
1670 @param[in] Address The MMIO register to write.
1671 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1673 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1675 @param[in] Value New value of the bit field.
1677 @return The value written back to the MMIO register.
1682 S3MmioBitFieldWrite16 (
1690 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR,
1691 writes the result back to the bit field in the 16-bit MMIO register, and
1692 saves the value in the S3 script to be replayed on S3 resume.
1694 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1695 inclusive OR between the read result and the value specified by OrData, and
1696 writes the result to the 16-bit MMIO register specified by Address. The value
1697 written to the MMIO register is returned. This function must guarantee that
1698 all MMIO read and write operations are serialized. Extra left bits in OrData
1701 If 16-bit MMIO register operations are not supported, then ASSERT().
1702 If StartBit is greater than 15, then ASSERT().
1703 If EndBit is greater than 15, then ASSERT().
1704 If EndBit is less than StartBit, then ASSERT().
1706 @param[in] Address The MMIO register to write.
1707 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1709 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1711 @param[in] OrData The value to OR with the read value from the MMIO register.
1713 @return The value written back to the MMIO register.
1718 S3MmioBitFieldOr16 (
1726 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1727 writes the result back to the bit field in the 16-bit MMIO register and
1728 saves the value in the S3 script to be replayed on S3 resume.
1730 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1731 between the read result and the value specified by AndData, and writes the
1732 result to the 16-bit MMIO register specified by Address. The value written to
1733 the MMIO register is returned. This function must guarantee that all MMIO
1734 read and write operations are serialized. Extra left bits in AndData are
1737 If 16-bit MMIO register operations are not supported, then ASSERT().
1738 If StartBit is greater than 15, then ASSERT().
1739 If EndBit is greater than 15, then ASSERT().
1740 If EndBit is less than StartBit, then ASSERT().
1742 @param[in] Address The MMIO register to write.
1743 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1745 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1747 @param[in] AndData The value to AND with the read value from the MMIO register.
1749 @return The value written back to the MMIO register.
1754 S3MmioBitFieldAnd16 (
1762 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1763 by a bitwise OR, writes the result back to the bit field in the
1764 16-bit MMIO register, and saves the value in the S3 script to be replayed
1767 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1768 followed by a bitwise OR between the read result and the value
1769 specified by AndData, and writes the result to the 16-bit MMIO register
1770 specified by Address. The value written to the MMIO register is returned.
1771 This function must guarantee that all MMIO read and write operations are
1772 serialized. Extra left bits in both AndData and OrData are stripped.
1774 If 16-bit MMIO register operations are not supported, then ASSERT().
1775 If StartBit is greater than 15, then ASSERT().
1776 If EndBit is greater than 15, then ASSERT().
1777 If EndBit is less than StartBit, then ASSERT().
1779 @param[in] Address The MMIO register to write.
1780 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1782 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1784 @param[in] AndData The value to AND with the read value from the MMIO register.
1785 @param[in] OrData The value to OR with the result of the AND operation.
1787 @return The value written back to the MMIO register.
1792 S3MmioBitFieldAndThenOr16 (
1801 Reads a 32-bit MMIO register saves the value in the S3 script to be
1802 replayed on S3 resume.
1804 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1805 returned. This function must guarantee that all MMIO read and write
1806 operations are serialized.
1808 If 32-bit MMIO register operations are not supported, then ASSERT().
1810 @param[in] Address The MMIO register to read.
1812 @return The value read.
1822 Writes a 32-bit MMIO register, and saves the value in the S3 script to be
1823 replayed on S3 resume.
1825 Writes the 32-bit MMIO register specified by Address with the value specified
1826 by Value and returns Value. This function must guarantee that all MMIO read
1827 and write operations are serialized.
1829 If 32-bit MMIO register operations are not supported, then ASSERT().
1831 @param[in] Address The MMIO register to write.
1832 @param[in] Value The value to write to the MMIO register.
1834 @return The value written the MMIO register.
1845 Reads a 32-bit MMIO register, performs a bitwise OR, writes the
1846 result back to the 32-bit MMIO register, and saves the value in the S3 script
1847 to be replayed on S3 resume.
1849 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1850 inclusive OR between the read result and the value specified by OrData, and
1851 writes the result to the 32-bit MMIO register specified by Address. The value
1852 written to the MMIO register is returned. This function must guarantee that
1853 all MMIO read and write operations are serialized.
1855 If 32-bit MMIO register operations are not supported, then ASSERT().
1857 @param[in] Address The MMIO register to write.
1858 @param[in] OrData The value to OR with the read value from the MMIO register.
1860 @return The value written back to the MMIO register.
1871 Reads a 32-bit MMIO register, performs a bitwise AND, writes the result
1872 back to the 32-bit MMIO register, and saves the value in the S3 script to be
1873 replayed on S3 resume.
1875 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1876 between the read result and the value specified by AndData, and writes the
1877 result to the 32-bit MMIO register specified by Address. The value written to
1878 the MMIO register is returned. This function must guarantee that all MMIO
1879 read and write operations are serialized.
1881 If 32-bit MMIO register operations are not supported, then ASSERT().
1883 @param[in] Address The MMIO register to write.
1884 @param[in] AndData The value to AND with the read value from the MMIO register.
1886 @return The value written back to the MMIO register.
1897 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1898 inclusive OR, writes the result back to the 32-bit MMIO register, and
1899 saves the value in the S3 script to be replayed on S3 resume.
1901 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1902 between the read result and the value specified by AndData, performs a
1903 bitwise OR between the result of the AND operation and the value specified by
1904 OrData, and writes the result to the 32-bit MMIO register specified by
1905 Address. The value written to the MMIO register is returned. This function
1906 must guarantee that all MMIO read and write operations are serialized.
1908 If 32-bit MMIO register operations are not supported, then ASSERT().
1910 @param[in] Address The MMIO register to write.
1911 @param[in] AndData The value to AND with the read value from the MMIO register.
1912 @param[in] OrData The value to OR with the result of the AND operation.
1914 @return The value written back to the MMIO register.
1926 Reads a bit field of a MMIO register, and saves the value in the S3 script
1927 to be replayed on S3 resume.
1929 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1930 the StartBit and the EndBit. The value of the bit field is returned.
1932 If 32-bit MMIO register operations are not supported, then ASSERT().
1933 If StartBit is greater than 31, then ASSERT().
1934 If EndBit is greater than 31, then ASSERT().
1935 If EndBit is less than StartBit, then ASSERT().
1937 @param[in] Address MMIO register to read.
1938 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1940 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1943 @return The value read.
1948 S3MmioBitFieldRead32 (
1955 Writes a bit field to a MMIO register, and saves the value in the S3 script
1956 to be replayed on S3 resume.
1958 Writes Value to the bit field of the MMIO register. The bit field is
1959 specified by the StartBit and the EndBit. All other bits in the destination
1960 MMIO register are preserved. The new value of the 32-bit register is returned.
1962 If 32-bit MMIO register operations are not supported, then ASSERT().
1963 If StartBit is greater than 31, then ASSERT().
1964 If EndBit is greater than 31, then ASSERT().
1965 If EndBit is less than StartBit, then ASSERT().
1967 @param[in] Address The MMIO register to write.
1968 @param[in] StartBit The ordinal of the least significant bit in the bit field.
1970 @param[in] EndBit The ordinal of the most significant bit in the bit field.
1972 @param[in] Value New value of the bit field.
1974 @return The value written back to the MMIO register.
1979 S3MmioBitFieldWrite32 (
1987 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR,
1988 writes the result back to the bit field in the 32-bit MMIO register, and
1989 saves the value in the S3 script to be replayed on S3 resume.
1991 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1992 inclusive OR between the read result and the value specified by OrData, and
1993 writes the result to the 32-bit MMIO register specified by Address. The value
1994 written to the MMIO register is returned. This function must guarantee that
1995 all MMIO read and write operations are serialized. Extra left bits in OrData
1998 If 32-bit MMIO register operations are not supported, then ASSERT().
1999 If StartBit is greater than 31, then ASSERT().
2000 If EndBit is greater than 31, then ASSERT().
2001 If EndBit is less than StartBit, then ASSERT().
2003 @param[in] Address The MMIO register to write.
2004 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2006 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2008 @param[in] OrData The value to OR with the read value from the MMIO register.
2010 @return The value written back to the MMIO register.
2015 S3MmioBitFieldOr32 (
2023 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2024 writes the result back to the bit field in the 32-bit MMIO register and
2025 saves the value in the S3 script to be replayed on S3 resume.
2027 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2028 between the read result and the value specified by AndData, and writes the
2029 result to the 32-bit MMIO register specified by Address. The value written to
2030 the MMIO register is returned. This function must guarantee that all MMIO
2031 read and write operations are serialized. Extra left bits in AndData are
2034 If 32-bit MMIO register operations are not supported, then ASSERT().
2035 If StartBit is greater than 31, then ASSERT().
2036 If EndBit is greater than 31, then ASSERT().
2037 If EndBit is less than StartBit, then ASSERT().
2039 @param[in] Address The MMIO register to write.
2040 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2042 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2044 @param[in] AndData The value to AND with the read value from the MMIO register.
2046 @return The value written back to the MMIO register.
2051 S3MmioBitFieldAnd32 (
2059 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2060 by a bitwise OR, writes the result back to the bit field in the
2061 32-bit MMIO register, and saves the value in the S3 script to be replayed
2064 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2065 followed by a bitwise OR between the read result and the value
2066 specified by AndData, and writes the result to the 32-bit MMIO register
2067 specified by Address. The value written to the MMIO register is returned.
2068 This function must guarantee that all MMIO read and write operations are
2069 serialized. Extra left bits in both AndData and OrData are stripped.
2071 If 32-bit MMIO register operations are not supported, then ASSERT().
2072 If StartBit is greater than 31, then ASSERT().
2073 If EndBit is greater than 31, then ASSERT().
2074 If EndBit is less than StartBit, then ASSERT().
2076 @param[in] Address The MMIO register to write.
2077 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2079 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2081 @param[in] AndData The value to AND with the read value from the MMIO register.
2082 @param[in] OrData The value to OR with the result of the AND operation.
2084 @return The value written back to the MMIO register.
2089 S3MmioBitFieldAndThenOr32 (
2098 Reads a 64-bit MMIO register, and saves the value in the S3 script to be
2099 replayed on S3 resume.
2101 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2102 returned. This function must guarantee that all MMIO read and write
2103 operations are serialized.
2105 If 64-bit MMIO register operations are not supported, then ASSERT().
2107 @param[in] Address The MMIO register to read.
2109 @return The value read.
2119 Writes a 64-bit MMIO register, and saves the value in the S3 script to be
2120 replayed on S3 resume.
2122 Writes the 64-bit MMIO register specified by Address with the value specified
2123 by Value and returns Value. This function must guarantee that all MMIO read
2124 and write operations are serialized.
2126 If 64-bit MMIO register operations are not supported, then ASSERT().
2128 @param[in] Address The MMIO register to write.
2129 @param[in] Value The value to write to the MMIO register.
2131 @return The value written the MMIO register.
2142 Reads a 64-bit MMIO register, performs a bitwise OR, writes the
2143 result back to the 64-bit MMIO register, and saves the value in the S3 script
2144 to be replayed on S3 resume.
2146 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2147 inclusive OR between the read result and the value specified by OrData, and
2148 writes the result to the 64-bit MMIO register specified by Address. The value
2149 written to the MMIO register is returned. This function must guarantee that
2150 all MMIO read and write operations are serialized.
2152 If 64-bit MMIO register operations are not supported, then ASSERT().
2154 @param[in] Address The MMIO register to write.
2155 @param[in] OrData The value to OR with the read value from the MMIO register.
2157 @return The value written back to the MMIO register.
2168 Reads a 64-bit MMIO register, performs a bitwise AND, writes the result
2169 back to the 64-bit MMIO register, and saves the value in the S3 script to be
2170 replayed on S3 resume.
2172 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2173 between the read result and the value specified by AndData, and writes the
2174 result to the 64-bit MMIO register specified by Address. The value written to
2175 the MMIO register is returned. This function must guarantee that all MMIO
2176 read and write operations are serialized.
2178 If 64-bit MMIO register operations are not supported, then ASSERT().
2180 @param[in] Address The MMIO register to write.
2181 @param[in] AndData The value to AND with the read value from the MMIO register.
2183 @return The value written back to the MMIO register.
2194 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2195 inclusive OR, writes the result back to the 64-bit MMIO register, and
2196 saves the value in the S3 script to be replayed on S3 resume.
2198 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2199 between the read result and the value specified by AndData, performs a
2200 bitwise OR between the result of the AND operation and the value specified by
2201 OrData, and writes the result to the 64-bit MMIO register specified by
2202 Address. The value written to the MMIO register is returned. This function
2203 must guarantee that all MMIO read and write operations are serialized.
2205 If 64-bit MMIO register operations are not supported, then ASSERT().
2207 @param[in] Address The MMIO register to write.
2208 @param[in] AndData The value to AND with the read value from the MMIO register.
2209 @param[in] OrData The value to OR with the result of the AND operation.
2211 @return The value written back to the MMIO register.
2223 Reads a bit field of a MMIO register saves the value in the S3 script to
2224 be replayed on S3 resume.
2226 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2227 the StartBit and the EndBit. The value of the bit field is returned.
2229 If 64-bit MMIO register operations are not supported, then ASSERT().
2230 If StartBit is greater than 63, then ASSERT().
2231 If EndBit is greater than 63, then ASSERT().
2232 If EndBit is less than StartBit, then ASSERT().
2234 @param[in] Address MMIO register to read.
2235 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2237 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2240 @return The value read.
2245 S3MmioBitFieldRead64 (
2252 Writes a bit field to a MMIO register, and saves the value in the S3 script to
2253 be replayed on S3 resume.
2255 Writes Value to the bit field of the MMIO register. The bit field is
2256 specified by the StartBit and the EndBit. All other bits in the destination
2257 MMIO register are preserved. The new value of the 64-bit register is returned.
2259 If 64-bit MMIO register operations are not supported, then ASSERT().
2260 If StartBit is greater than 63, then ASSERT().
2261 If EndBit is greater than 63, then ASSERT().
2262 If EndBit is less than StartBit, then ASSERT().
2264 @param[in] Address The MMIO register to write.
2265 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2267 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2269 @param[in] Value New value of the bit field.
2271 @return The value written back to the MMIO register.
2276 S3MmioBitFieldWrite64 (
2284 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR,
2285 writes the result back to the bit field in the 64-bit MMIO register, and
2286 saves the value in the S3 script to be replayed on S3 resume.
2288 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2289 inclusive OR between the read result and the value specified by OrData, and
2290 writes the result to the 64-bit MMIO register specified by Address. The value
2291 written to the MMIO register is returned. This function must guarantee that
2292 all MMIO read and write operations are serialized. Extra left bits in OrData
2295 If 64-bit MMIO register operations are not supported, then ASSERT().
2296 If StartBit is greater than 63, then ASSERT().
2297 If EndBit is greater than 63, then ASSERT().
2298 If EndBit is less than StartBit, then ASSERT().
2300 @param[in] Address The MMIO register to write.
2301 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2303 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2305 @param[in] OrData The value to OR with the read value from the MMIO register.
2307 @return The value written back to the MMIO register.
2312 S3MmioBitFieldOr64 (
2320 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2321 writes the result back to the bit field in the 64-bit MMIO register, and saves
2322 the value in the S3 script to be replayed on S3 resume.
2324 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2325 between the read result and the value specified by AndData, and writes the
2326 result to the 64-bit MMIO register specified by Address. The value written to
2327 the MMIO register is returned. This function must guarantee that all MMIO
2328 read and write operations are serialized. Extra left bits in AndData are
2331 If 64-bit MMIO register operations are not supported, then ASSERT().
2332 If StartBit is greater than 63, then ASSERT().
2333 If EndBit is greater than 63, then ASSERT().
2334 If EndBit is less than StartBit, then ASSERT().
2336 @param[in] Address The MMIO register to write.
2337 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2339 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2341 @param[in] AndData The value to AND with the read value from the MMIO register.
2343 @return The value written back to the MMIO register.
2348 S3MmioBitFieldAnd64 (
2356 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2357 by a bitwise OR, writes the result back to the bit field in the
2358 64-bit MMIO register, and saves the value in the S3 script to be replayed
2361 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2362 followed by a bitwise OR between the read result and the value
2363 specified by AndData, and writes the result to the 64-bit MMIO register
2364 specified by Address. The value written to the MMIO register is returned.
2365 This function must guarantee that all MMIO read and write operations are
2366 serialized. Extra left bits in both AndData and OrData are stripped.
2368 If 64-bit MMIO register operations are not supported, then ASSERT().
2369 If StartBit is greater than 63, then ASSERT().
2370 If EndBit is greater than 63, then ASSERT().
2371 If EndBit is less than StartBit, then ASSERT().
2373 @param[in] Address The MMIO register to write.
2374 @param[in] StartBit The ordinal of the least significant bit in the bit field.
2376 @param[in] EndBit The ordinal of the most significant bit in the bit field.
2378 @param[in] AndData The value to AND with the read value from the MMIO register.
2379 @param[in] OrData The value to OR with the result of the AND operation.
2381 @return The value written back to the MMIO register.
2386 S3MmioBitFieldAndThenOr64 (
2395 Copies data from MMIO region to system memory by using 8-bit access,
2396 and saves the value in the S3 script to be replayed on S3 resume.
2398 Copy data from MMIO region specified by starting address StartAddress
2399 to system memory specified by Buffer by using 8-bit access. The total
2400 number of bytes to be copied is specified by Length. Buffer is returned.
2402 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2403 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2406 @param[in] StartAddress Starting address for the MMIO region to be copied from.
2407 @param[in] Length Size in bytes of the copy.
2408 @param[out] Buffer Pointer to a system memory buffer receiving the data read.
2416 IN UINTN StartAddress
,
2422 Copies data from MMIO region to system memory by using 16-bit access,
2423 and saves the value in the S3 script to be replayed on S3 resume.
2425 Copy data from MMIO region specified by starting address StartAddress
2426 to system memory specified by Buffer by using 16-bit access. The total
2427 number of bytes to be copied is specified by Length. Buffer is returned.
2429 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2431 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2432 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2434 If Length is not aligned on a 16-bit boundary, then ASSERT().
2435 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2437 @param[in] StartAddress Starting address for the MMIO region to be copied from.
2438 @param[in] Length Size in bytes of the copy.
2439 @param[out] Buffer Pointer to a system memory buffer receiving the data read.
2446 S3MmioReadBuffer16 (
2447 IN UINTN StartAddress
,
2453 Copies data from MMIO region to system memory by using 32-bit access,
2454 and saves the value in the S3 script to be replayed on S3 resume.
2456 Copy data from MMIO region specified by starting address StartAddress
2457 to system memory specified by Buffer by using 32-bit access. The total
2458 number of byte to be copied is specified by Length. Buffer is returned.
2460 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2462 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2463 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2465 If Length is not aligned on a 32-bit boundary, then ASSERT().
2466 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2468 @param[in] StartAddress Starting address for the MMIO region to be copied from.
2469 @param[in] Length Size in bytes of the copy.
2470 @param[out] Buffer Pointer to a system memory buffer receiving the data read.
2477 S3MmioReadBuffer32 (
2478 IN UINTN StartAddress
,
2484 Copies data from MMIO region to system memory by using 64-bit access,
2485 and saves the value in the S3 script to be replayed on S3 resume.
2487 Copy data from MMIO region specified by starting address StartAddress
2488 to system memory specified by Buffer by using 64-bit access. The total
2489 number of byte to be copied is specified by Length. Buffer is returned.
2491 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2493 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2494 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2496 If Length is not aligned on a 64-bit boundary, then ASSERT().
2497 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2499 @param[in] StartAddress Starting address for the MMIO region to be copied from.
2500 @param[in] Length Size in bytes of the copy.
2501 @param[out] Buffer Pointer to a system memory buffer receiving the data read.
2508 S3MmioReadBuffer64 (
2509 IN UINTN StartAddress
,
2515 Copies data from system memory to MMIO region by using 8-bit access,
2516 and saves the value in the S3 script to be replayed on S3 resume.
2518 Copy data from system memory specified by Buffer to MMIO region specified
2519 by starting address StartAddress by using 8-bit access. The total number
2520 of byte to be copied is specified by Length. Buffer is returned.
2522 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2523 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2526 @param[in] StartAddress Starting address for the MMIO region to be copied to.
2527 @param[in] Length Size in bytes of the copy.
2528 @param[in] Buffer Pointer to a system memory buffer containing the data to write.
2535 S3MmioWriteBuffer8 (
2536 IN UINTN StartAddress
,
2538 IN CONST UINT8
*Buffer
2542 Copies data from system memory to MMIO region by using 16-bit access,
2543 and saves the value in the S3 script to be replayed on S3 resume.
2545 Copy data from system memory specified by Buffer to MMIO region specified
2546 by starting address StartAddress by using 16-bit access. The total number
2547 of bytes to be copied is specified by Length. Buffer is returned.
2549 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2551 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2552 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2554 If Length is not aligned on a 16-bit boundary, then ASSERT().
2556 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2558 @param[in] StartAddress Starting address for the MMIO region to be copied to.
2559 @param[in] Length Size in bytes of the copy.
2560 @param[in] Buffer Pointer to a system memory buffer containing the data to write.
2567 S3MmioWriteBuffer16 (
2568 IN UINTN StartAddress
,
2570 IN CONST UINT16
*Buffer
2574 Copies data from system memory to MMIO region by using 32-bit access,
2575 and saves the value in the S3 script to be replayed on S3 resume.
2577 Copy data from system memory specified by Buffer to MMIO region specified
2578 by starting address StartAddress by using 32-bit access. The total number
2579 of bytes to be copied is specified by Length. Buffer is returned.
2581 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2583 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2584 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2586 If Length is not aligned on a 32-bit boundary, then ASSERT().
2588 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2590 @param[in] StartAddress Starting address for the MMIO region to be copied to.
2591 @param[in] Length Size in bytes of the copy.
2592 @param[in] Buffer Pointer to a system memory buffer containing the data to write.
2599 S3MmioWriteBuffer32 (
2600 IN UINTN StartAddress
,
2602 IN CONST UINT32
*Buffer
2606 Copies data from system memory to MMIO region by using 64-bit access,
2607 and saves the value in the S3 script to be replayed on S3 resume.
2609 Copy data from system memory specified by Buffer to MMIO region specified
2610 by starting address StartAddress by using 64-bit access. The total number
2611 of bytes to be copied is specified by Length. Buffer is returned.
2613 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2615 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2616 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2618 If Length is not aligned on a 64-bit boundary, then ASSERT().
2620 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2622 @param[in] StartAddress Starting address for the MMIO region to be copied to.
2623 @param[in] Length Size in bytes of the copy.
2624 @param[in] Buffer Pointer to a system memory buffer containing the data to write.
2631 S3MmioWriteBuffer64 (
2632 IN UINTN StartAddress
,
2634 IN CONST UINT64
*Buffer