]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/IoLib.h
2 Provide services to access I/O Ports and MMIO registers.
4 Copyright (c) 2006 - 2009, 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.
19 Macro that converts PCI Segment and I/O Port to an address that can be
20 passed to the I/O Library functions.
22 Computes an address that is compatible with the I/O Library functions.
23 The unused upper bits of Segment, and Port are stripped prior to the
24 generation of the address.
26 @param Segment PCI Segment number. Range 0..65535.
27 @param Port I/O Port number. Range 0..65535.
29 @return An address that the I/o Library functions need.
33 #define IO_LIB_ADDRESS(Segment,Port) \
34 ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
37 Reads an 8-bit I/O port.
39 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
40 This function must guarantee that all I/O read and write operations are
43 If 8-bit I/O port operations are not supported, then ASSERT().
45 @param Port The I/O port to read.
47 @return The value read.
57 Writes an 8-bit I/O port.
59 Writes the 8-bit I/O port specified by Port with the value specified by Value
60 and returns Value. This function must guarantee that all I/O read and write
61 operations are serialized.
63 If 8-bit I/O port operations are not supported, then ASSERT().
65 @param Port The I/O port to write.
66 @param Value The value to write to the I/O port.
68 @return The value written the I/O port.
79 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
80 result back to the 8-bit I/O port.
82 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
83 between the read result and the value specified by OrData, and writes the
84 result to the 8-bit I/O port specified by Port. The value written to the I/O
85 port is returned. This function must guarantee that all I/O read and write
86 operations are serialized.
88 If 8-bit I/O port operations are not supported, then ASSERT().
90 @param Port The I/O port to write.
91 @param OrData The value to OR with the read value from the I/O port.
93 @return The value written back to the I/O port.
104 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
105 to the 8-bit I/O port.
107 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
108 the read result and the value specified by AndData, and writes the result to
109 the 8-bit I/O port specified by Port. The value written to the I/O port is
110 returned. This function must guarantee that all I/O read and write operations
113 If 8-bit I/O port operations are not supported, then ASSERT().
115 @param Port The I/O port to write.
116 @param AndData The value to AND with the read value from the I/O port.
118 @return The value written back to the I/O port.
129 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
130 OR, and writes the result back to the 8-bit I/O port.
132 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
133 the read result and the value specified by AndData, performs a bitwise OR
134 between the result of the AND operation and the value specified by OrData,
135 and writes the result to the 8-bit I/O port specified by Port. The value
136 written to the I/O port is returned. This function must guarantee that all
137 I/O read and write operations are serialized.
139 If 8-bit I/O port operations are not supported, then ASSERT().
141 @param Port The I/O port to write.
142 @param AndData The value to AND with the read value from the I/O port.
143 @param OrData The value to OR with the result of the AND operation.
145 @return The value written back to the I/O port.
157 Reads a bit field of an I/O register.
159 Reads the bit field in an 8-bit I/O register. The bit field is specified by
160 the StartBit and the EndBit. The value of the bit field is returned.
162 If 8-bit I/O port operations are not supported, then ASSERT().
163 If StartBit is greater than 7, then ASSERT().
164 If EndBit is greater than 7, then ASSERT().
165 If EndBit is less than StartBit, then ASSERT().
167 @param Port The I/O port to read.
168 @param StartBit The ordinal of the least significant bit in the bit field.
170 @param EndBit The ordinal of the most significant bit in the bit field.
173 @return The value read.
185 Writes a bit field to an I/O register.
187 Writes Value to the bit field of the I/O register. The bit field is specified
188 by the StartBit and the EndBit. All other bits in the destination I/O
189 register are preserved. The value written to the I/O port is returned.
191 If 8-bit I/O port operations are not supported, then ASSERT().
192 If StartBit is greater than 7, then ASSERT().
193 If EndBit is greater than 7, then ASSERT().
194 If EndBit is less than StartBit, then ASSERT().
196 @param Port The I/O port to write.
197 @param StartBit The ordinal of the least significant bit in the bit field.
199 @param EndBit The ordinal of the most significant bit in the bit field.
201 @param Value New value of the bit field.
203 @return The value written back to the I/O port.
216 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
217 result back to the bit field in the 8-bit port.
219 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
220 between the read result and the value specified by OrData, and writes the
221 result to the 8-bit I/O port specified by Port. The value written to the I/O
222 port is returned. This function must guarantee that all I/O read and write
223 operations are serialized. Extra left bits in OrData are stripped.
225 If 8-bit I/O port operations are not supported, then ASSERT().
226 If StartBit is greater than 7, then ASSERT().
227 If EndBit is greater than 7, then ASSERT().
228 If EndBit is less than StartBit, then ASSERT().
230 @param Port The I/O port to write.
231 @param StartBit The ordinal of the least significant bit in the bit field.
233 @param EndBit The ordinal of the most significant bit in the bit field.
235 @param OrData The value to OR with the read value from the I/O port.
237 @return The value written back to the I/O port.
250 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
251 result back to the bit field in the 8-bit port.
253 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
254 the read result and the value specified by AndData, and writes the result to
255 the 8-bit I/O port specified by Port. The value written to the I/O port is
256 returned. This function must guarantee that all I/O read and write operations
257 are serialized. Extra left bits in AndData are stripped.
259 If 8-bit I/O port operations are not supported, then ASSERT().
260 If StartBit is greater than 7, then ASSERT().
261 If EndBit is greater than 7, then ASSERT().
262 If EndBit is less than StartBit, then ASSERT().
264 @param Port The I/O port to write.
265 @param StartBit The ordinal of the least significant bit in the bit field.
267 @param EndBit The ordinal of the most significant bit in the bit field.
269 @param AndData The value to AND with the read value from the I/O port.
271 @return The value written back to the I/O port.
284 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
285 bitwise OR, and writes the result back to the bit field in the
288 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
289 by a bitwise OR between the read result and the value specified by
290 AndData, and writes the result to the 8-bit I/O port specified by Port. The
291 value written to the I/O port is returned. This function must guarantee that
292 all I/O read and write operations are serialized. Extra left bits in both
293 AndData and OrData are stripped.
295 If 8-bit I/O port operations are not supported, then ASSERT().
296 If StartBit is greater than 7, then ASSERT().
297 If EndBit is greater than 7, then ASSERT().
298 If EndBit is less than StartBit, then ASSERT().
300 @param Port The I/O port to write.
301 @param StartBit The ordinal of the least significant bit in the bit field.
303 @param EndBit The ordinal of the most significant bit in the bit field.
305 @param AndData The value to AND with the read value from the I/O port.
306 @param OrData The value to OR with the result of the AND operation.
308 @return The value written back to the I/O port.
313 IoBitFieldAndThenOr8 (
322 Reads a 16-bit I/O port.
324 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
325 This function must guarantee that all I/O read and write operations are
328 If 16-bit I/O port operations are not supported, then ASSERT().
329 If Port is not aligned on a 16-bit boundary, then ASSERT().
331 @param Port The I/O port to read.
333 @return The value read.
343 Writes a 16-bit I/O port.
345 Writes the 16-bit I/O port specified by Port with the value specified by Value
346 and returns Value. This function must guarantee that all I/O read and write
347 operations are serialized.
349 If 16-bit I/O port operations are not supported, then ASSERT().
350 If Port is not aligned on a 16-bit boundary, then ASSERT().
352 @param Port The I/O port to write.
353 @param Value The value to write to the I/O port.
355 @return The value written the I/O port.
366 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
367 result back to the 16-bit I/O port.
369 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
370 between the read result and the value specified by OrData, and writes the
371 result to the 16-bit I/O port specified by Port. The value written to the I/O
372 port is returned. This function must guarantee that all I/O read and write
373 operations are serialized.
375 If 16-bit I/O port operations are not supported, then ASSERT().
376 If Port is not aligned on a 16-bit boundary, then ASSERT().
378 @param Port The I/O port to write.
379 @param OrData The value to OR with the read value from the I/O port.
381 @return The value written back to the I/O port.
392 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
393 to the 16-bit I/O port.
395 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
396 the read result and the value specified by AndData, and writes the result to
397 the 16-bit I/O port specified by Port. The value written to the I/O port is
398 returned. This function must guarantee that all I/O read and write operations
401 If 16-bit I/O port operations are not supported, then ASSERT().
402 If Port is not aligned on a 16-bit boundary, then ASSERT().
404 @param Port The I/O port to write.
405 @param AndData The value to AND with the read value from the I/O port.
407 @return The value written back to the I/O port.
418 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
419 OR, and writes the result back to the 16-bit I/O port.
421 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
422 the read result and the value specified by AndData, performs a bitwise OR
423 between the result of the AND operation and the value specified by OrData,
424 and writes the result to the 16-bit I/O port specified by Port. The value
425 written to the I/O port is returned. This function must guarantee that all
426 I/O read and write operations are serialized.
428 If 16-bit I/O port operations are not supported, then ASSERT().
429 If Port is not aligned on a 16-bit boundary, then ASSERT().
431 @param Port The I/O port to write.
432 @param AndData The value to AND with the read value from the I/O port.
433 @param OrData The value to OR with the result of the AND operation.
435 @return The value written back to the I/O port.
447 Reads a bit field of an I/O register.
449 Reads the bit field in a 16-bit I/O register. The bit field is specified by
450 the StartBit and the EndBit. The value of the bit field is returned.
452 If 16-bit I/O port operations are not supported, then ASSERT().
453 If Port is not aligned on a 16-bit boundary, then ASSERT().
454 If StartBit is greater than 15, then ASSERT().
455 If EndBit is greater than 15, then ASSERT().
456 If EndBit is less than StartBit, then ASSERT().
458 @param Port The I/O port to read.
459 @param StartBit The ordinal of the least significant bit in the bit field.
461 @param EndBit The ordinal of the most significant bit in the bit field.
464 @return The value read.
476 Writes a bit field to an I/O register.
478 Writes Value to the bit field of the I/O register. The bit field is specified
479 by the StartBit and the EndBit. All other bits in the destination I/O
480 register are preserved. The value written to the I/O port is returned. Extra
481 left bits in Value are stripped.
483 If 16-bit I/O port operations are not supported, then ASSERT().
484 If Port is not aligned on a 16-bit boundary, then ASSERT().
485 If StartBit is greater than 15, then ASSERT().
486 If EndBit is greater than 15, then ASSERT().
487 If EndBit is less than StartBit, then ASSERT().
489 @param Port The I/O port to write.
490 @param StartBit The ordinal of the least significant bit in the bit field.
492 @param EndBit The ordinal of the most significant bit in the bit field.
494 @param Value New value of the bit field.
496 @return The value written back to the I/O port.
509 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
510 result back to the bit field in the 16-bit port.
512 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
513 between the read result and the value specified by OrData, and writes the
514 result to the 16-bit I/O port specified by Port. The value written to the I/O
515 port is returned. This function must guarantee that all I/O read and write
516 operations are serialized. Extra left bits in OrData are stripped.
518 If 16-bit I/O port operations are not supported, then ASSERT().
519 If Port is not aligned on a 16-bit boundary, then ASSERT().
520 If StartBit is greater than 15, then ASSERT().
521 If EndBit is greater than 15, then ASSERT().
522 If EndBit is less than StartBit, then ASSERT().
524 @param Port The I/O port to write.
525 @param StartBit The ordinal of the least significant bit in the bit field.
527 @param EndBit The ordinal of the most significant bit in the bit field.
529 @param OrData The value to OR with the read value from the I/O port.
531 @return The value written back to the I/O port.
544 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
545 result back to the bit field in the 16-bit port.
547 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
548 the read result and the value specified by AndData, and writes the result to
549 the 16-bit I/O port specified by Port. The value written to the I/O port is
550 returned. This function must guarantee that all I/O read and write operations
551 are serialized. Extra left bits in AndData are stripped.
553 If 16-bit I/O port operations are not supported, then ASSERT().
554 If Port is not aligned on a 16-bit boundary, then ASSERT().
555 If StartBit is greater than 15, then ASSERT().
556 If EndBit is greater than 15, then ASSERT().
557 If EndBit is less than StartBit, then ASSERT().
559 @param Port The I/O port to write.
560 @param StartBit The ordinal of the least significant bit in the bit field.
562 @param EndBit The ordinal of the most significant bit in the bit field.
564 @param AndData The value to AND with the read value from the I/O port.
566 @return The value written back to the I/O port.
579 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
580 bitwise OR, and writes the result back to the bit field in the
583 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
584 by a bitwise OR between the read result and the value specified by
585 AndData, and writes the result to the 16-bit I/O port specified by Port. The
586 value written to the I/O port is returned. This function must guarantee that
587 all I/O read and write operations are serialized. Extra left bits in both
588 AndData and OrData are stripped.
590 If 16-bit I/O port operations are not supported, then ASSERT().
591 If Port is not aligned on a 16-bit boundary, then ASSERT().
592 If StartBit is greater than 15, then ASSERT().
593 If EndBit is greater than 15, then ASSERT().
594 If EndBit is less than StartBit, then ASSERT().
596 @param Port The I/O port to write.
597 @param StartBit The ordinal of the least significant bit in the bit field.
599 @param EndBit The ordinal of the most significant bit in the bit field.
601 @param AndData The value to AND with the read value from the I/O port.
602 @param OrData The value to OR with the result of the AND operation.
604 @return The value written back to the I/O port.
609 IoBitFieldAndThenOr16 (
618 Reads a 32-bit I/O port.
620 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
621 This function must guarantee that all I/O read and write operations are
624 If 32-bit I/O port operations are not supported, then ASSERT().
625 If Port is not aligned on a 32-bit boundary, then ASSERT().
627 @param Port The I/O port to read.
629 @return The value read.
639 Writes a 32-bit I/O port.
641 Writes the 32-bit I/O port specified by Port with the value specified by Value
642 and returns Value. This function must guarantee that all I/O read and write
643 operations are serialized.
645 If 32-bit I/O port operations are not supported, then ASSERT().
646 If Port is not aligned on a 32-bit boundary, then ASSERT().
648 @param Port The I/O port to write.
649 @param Value The value to write to the I/O port.
651 @return The value written the I/O port.
662 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
663 result back to the 32-bit I/O port.
665 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
666 between the read result and the value specified by OrData, and writes the
667 result to the 32-bit I/O port specified by Port. The value written to the I/O
668 port is returned. This function must guarantee that all I/O read and write
669 operations are serialized.
671 If 32-bit I/O port operations are not supported, then ASSERT().
672 If Port is not aligned on a 32-bit boundary, then ASSERT().
674 @param Port The I/O port to write.
675 @param OrData The value to OR with the read value from the I/O port.
677 @return The value written back to the I/O port.
688 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
689 to the 32-bit I/O port.
691 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
692 the read result and the value specified by AndData, and writes the result to
693 the 32-bit I/O port specified by Port. The value written to the I/O port is
694 returned. This function must guarantee that all I/O read and write operations
697 If 32-bit I/O port operations are not supported, then ASSERT().
698 If Port is not aligned on a 32-bit boundary, then ASSERT().
700 @param Port The I/O port to write.
701 @param AndData The value to AND with the read value from the I/O port.
703 @return The value written back to the I/O port.
714 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
715 OR, and writes the result back to the 32-bit I/O port.
717 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
718 the read result and the value specified by AndData, performs a bitwise OR
719 between the result of the AND operation and the value specified by OrData,
720 and writes the result to the 32-bit I/O port specified by Port. The value
721 written to the I/O port is returned. This function must guarantee that all
722 I/O read and write operations are serialized.
724 If 32-bit I/O port operations are not supported, then ASSERT().
725 If Port is not aligned on a 32-bit boundary, then ASSERT().
727 @param Port The I/O port to write.
728 @param AndData The value to AND with the read value from the I/O port.
729 @param OrData The value to OR with the result of the AND operation.
731 @return The value written back to the I/O port.
743 Reads a bit field of an I/O register.
745 Reads the bit field in a 32-bit I/O register. The bit field is specified by
746 the StartBit and the EndBit. The value of the bit field is returned.
748 If 32-bit I/O port operations are not supported, then ASSERT().
749 If Port is not aligned on a 32-bit boundary, then ASSERT().
750 If StartBit is greater than 31, then ASSERT().
751 If EndBit is greater than 31, then ASSERT().
752 If EndBit is less than StartBit, then ASSERT().
754 @param Port The I/O port to read.
755 @param StartBit The ordinal of the least significant bit in the bit field.
757 @param EndBit The ordinal of the most significant bit in the bit field.
760 @return The value read.
772 Writes a bit field to an I/O register.
774 Writes Value to the bit field of the I/O register. The bit field is specified
775 by the StartBit and the EndBit. All other bits in the destination I/O
776 register are preserved. The value written to the I/O port is returned. Extra
777 left bits in Value are stripped.
779 If 32-bit I/O port operations are not supported, then ASSERT().
780 If Port is not aligned on a 32-bit boundary, then ASSERT().
781 If StartBit is greater than 31, then ASSERT().
782 If EndBit is greater than 31, then ASSERT().
783 If EndBit is less than StartBit, then ASSERT().
785 @param Port The I/O port to write.
786 @param StartBit The ordinal of the least significant bit in the bit field.
788 @param EndBit The ordinal of the most significant bit in the bit field.
790 @param Value New value of the bit field.
792 @return The value written back to the I/O port.
805 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
806 result back to the bit field in the 32-bit port.
808 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
809 between the read result and the value specified by OrData, and writes the
810 result to the 32-bit I/O port specified by Port. The value written to the I/O
811 port is returned. This function must guarantee that all I/O read and write
812 operations are serialized. Extra left bits in OrData are stripped.
814 If 32-bit I/O port operations are not supported, then ASSERT().
815 If Port is not aligned on a 32-bit boundary, then ASSERT().
816 If StartBit is greater than 31, then ASSERT().
817 If EndBit is greater than 31, then ASSERT().
818 If EndBit is less than StartBit, then ASSERT().
820 @param Port The I/O port to write.
821 @param StartBit The ordinal of the least significant bit in the bit field.
823 @param EndBit The ordinal of the most significant bit in the bit field.
825 @param OrData The value to OR with the read value from the I/O port.
827 @return The value written back to the I/O port.
840 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
841 result back to the bit field in the 32-bit port.
843 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
844 the read result and the value specified by AndData, and writes the result to
845 the 32-bit I/O port specified by Port. The value written to the I/O port is
846 returned. This function must guarantee that all I/O read and write operations
847 are serialized. Extra left bits in AndData are stripped.
849 If 32-bit I/O port operations are not supported, then ASSERT().
850 If Port is not aligned on a 32-bit boundary, then ASSERT().
851 If StartBit is greater than 31, then ASSERT().
852 If EndBit is greater than 31, then ASSERT().
853 If EndBit is less than StartBit, then ASSERT().
855 @param Port The I/O port to write.
856 @param StartBit The ordinal of the least significant bit in the bit field.
858 @param EndBit The ordinal of the most significant bit in the bit field.
860 @param AndData The value to AND with the read value from the I/O port.
862 @return The value written back to the I/O port.
875 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
876 bitwise OR, and writes the result back to the bit field in the
879 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
880 by a bitwise OR between the read result and the value specified by
881 AndData, and writes the result to the 32-bit I/O port specified by Port. The
882 value written to the I/O port is returned. This function must guarantee that
883 all I/O read and write operations are serialized. Extra left bits in both
884 AndData and OrData are stripped.
886 If 32-bit I/O port operations are not supported, then ASSERT().
887 If Port is not aligned on a 32-bit boundary, then ASSERT().
888 If StartBit is greater than 31, then ASSERT().
889 If EndBit is greater than 31, then ASSERT().
890 If EndBit is less than StartBit, then ASSERT().
892 @param Port The I/O port to write.
893 @param StartBit The ordinal of the least significant bit in the bit field.
895 @param EndBit The ordinal of the most significant bit in the bit field.
897 @param AndData The value to AND with the read value from the I/O port.
898 @param OrData The value to OR with the result of the AND operation.
900 @return The value written back to the I/O port.
905 IoBitFieldAndThenOr32 (
914 Reads a 64-bit I/O port.
916 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
917 This function must guarantee that all I/O read and write operations are
920 If 64-bit I/O port operations are not supported, then ASSERT().
921 If Port is not aligned on a 64-bit boundary, then ASSERT().
923 @param Port The I/O port to read.
925 @return The value read.
935 Writes a 64-bit I/O port.
937 Writes the 64-bit I/O port specified by Port with the value specified by Value
938 and returns Value. This function must guarantee that all I/O read and write
939 operations are serialized.
941 If 64-bit I/O port operations are not supported, then ASSERT().
942 If Port is not aligned on a 64-bit boundary, then ASSERT().
944 @param Port The I/O port to write.
945 @param Value The value to write to the I/O port.
947 @return The value written the I/O port.
958 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
959 result back to the 64-bit I/O port.
961 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
962 between the read result and the value specified by OrData, and writes the
963 result to the 64-bit I/O port specified by Port. The value written to the I/O
964 port is returned. This function must guarantee that all I/O read and write
965 operations are serialized.
967 If 64-bit I/O port operations are not supported, then ASSERT().
968 If Port is not aligned on a 64-bit boundary, then ASSERT().
970 @param Port The I/O port to write.
971 @param OrData The value to OR with the read value from the I/O port.
973 @return The value written back to the I/O port.
984 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
985 to the 64-bit I/O port.
987 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
988 the read result and the value specified by AndData, and writes the result to
989 the 64-bit I/O port specified by Port. The value written to the I/O port is
990 returned. This function must guarantee that all I/O read and write operations
993 If 64-bit I/O port operations are not supported, then ASSERT().
994 If Port is not aligned on a 64-bit boundary, then ASSERT().
996 @param Port The I/O port to write.
997 @param AndData The value to AND with the read value from the I/O port.
999 @return The value written back to the I/O port.
1010 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
1011 OR, and writes the result back to the 64-bit I/O port.
1013 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1014 the read result and the value specified by AndData, performs a bitwise OR
1015 between the result of the AND operation and the value specified by OrData,
1016 and writes the result to the 64-bit I/O port specified by Port. The value
1017 written to the I/O port is returned. This function must guarantee that all
1018 I/O read and write operations are serialized.
1020 If 64-bit I/O port operations are not supported, then ASSERT().
1021 If Port is not aligned on a 64-bit boundary, then ASSERT().
1023 @param Port The I/O port to write.
1024 @param AndData The value to AND with the read value from the I/O port.
1025 @param OrData The value to OR with the result of the AND operation.
1027 @return The value written back to the I/O port.
1039 Reads a bit field of an I/O register.
1041 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1042 the StartBit and the EndBit. The value of the bit field is returned.
1044 If 64-bit I/O port operations are not supported, then ASSERT().
1045 If Port is not aligned on a 64-bit boundary, then ASSERT().
1046 If StartBit is greater than 63, then ASSERT().
1047 If EndBit is greater than 63, then ASSERT().
1048 If EndBit is less than StartBit, then ASSERT().
1050 @param Port The I/O port to read.
1051 @param StartBit The ordinal of the least significant bit in the bit field.
1053 @param EndBit The ordinal of the most significant bit in the bit field.
1056 @return The value read.
1068 Writes a bit field to an I/O register.
1070 Writes Value to the bit field of the I/O register. The bit field is specified
1071 by the StartBit and the EndBit. All other bits in the destination I/O
1072 register are preserved. The value written to the I/O port is returned. Extra
1073 left bits in Value are stripped.
1075 If 64-bit I/O port operations are not supported, then ASSERT().
1076 If Port is not aligned on a 64-bit boundary, then ASSERT().
1077 If StartBit is greater than 63, then ASSERT().
1078 If EndBit is greater than 63, then ASSERT().
1079 If EndBit is less than StartBit, then ASSERT().
1081 @param Port The I/O port to write.
1082 @param StartBit The ordinal of the least significant bit in the bit field.
1084 @param EndBit The ordinal of the most significant bit in the bit field.
1086 @param Value New value of the bit field.
1088 @return The value written back to the I/O port.
1101 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1102 result back to the bit field in the 64-bit port.
1104 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1105 between the read result and the value specified by OrData, and writes the
1106 result to the 64-bit I/O port specified by Port. The value written to the I/O
1107 port is returned. This function must guarantee that all I/O read and write
1108 operations are serialized. Extra left bits in OrData are stripped.
1110 If 64-bit I/O port operations are not supported, then ASSERT().
1111 If Port is not aligned on a 64-bit boundary, then ASSERT().
1112 If StartBit is greater than 63, then ASSERT().
1113 If EndBit is greater than 63, then ASSERT().
1114 If EndBit is less than StartBit, then ASSERT().
1116 @param Port The I/O port to write.
1117 @param StartBit The ordinal of the least significant bit in the bit field.
1119 @param EndBit The ordinal of the most significant bit in the bit field.
1121 @param OrData The value to OR with the read value from the I/O port.
1123 @return The value written back to the I/O port.
1136 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1137 result back to the bit field in the 64-bit port.
1139 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1140 the read result and the value specified by AndData, and writes the result to
1141 the 64-bit I/O port specified by Port. The value written to the I/O port is
1142 returned. This function must guarantee that all I/O read and write operations
1143 are serialized. Extra left bits in AndData are stripped.
1145 If 64-bit I/O port operations are not supported, then ASSERT().
1146 If Port is not aligned on a 64-bit boundary, then ASSERT().
1147 If StartBit is greater than 63, then ASSERT().
1148 If EndBit is greater than 63, then ASSERT().
1149 If EndBit is less than StartBit, then ASSERT().
1151 @param Port The I/O port to write.
1152 @param StartBit The ordinal of the least significant bit in the bit field.
1154 @param EndBit The ordinal of the most significant bit in the bit field.
1156 @param AndData The value to AND with the read value from the I/O port.
1158 @return The value written back to the I/O port.
1171 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1172 bitwise OR, and writes the result back to the bit field in the
1175 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1176 by a bitwise OR between the read result and the value specified by
1177 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1178 value written to the I/O port is returned. This function must guarantee that
1179 all I/O read and write operations are serialized. Extra left bits in both
1180 AndData and OrData are stripped.
1182 If 64-bit I/O port operations are not supported, then ASSERT().
1183 If Port is not aligned on a 64-bit boundary, then ASSERT().
1184 If StartBit is greater than 63, then ASSERT().
1185 If EndBit is greater than 63, then ASSERT().
1186 If EndBit is less than StartBit, then ASSERT().
1188 @param Port The I/O port to write.
1189 @param StartBit The ordinal of the least significant bit in the bit field.
1191 @param EndBit The ordinal of the most significant bit in the bit field.
1193 @param AndData The value to AND with the read value from the I/O port.
1194 @param OrData The value to OR with the result of the AND operation.
1196 @return The value written back to the I/O port.
1201 IoBitFieldAndThenOr64 (
1210 Reads an 8-bit MMIO register.
1212 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1213 returned. This function must guarantee that all MMIO read and write
1214 operations are serialized.
1216 If 8-bit MMIO register operations are not supported, then ASSERT().
1218 @param Address The MMIO register to read.
1220 @return The value read.
1230 Writes an 8-bit MMIO register.
1232 Writes the 8-bit MMIO register specified by Address with the value specified
1233 by Value and returns Value. This function must guarantee that all MMIO read
1234 and write operations are serialized.
1236 If 8-bit MMIO register operations are not supported, then ASSERT().
1238 @param Address The MMIO register to write.
1239 @param Value The value to write to the MMIO register.
1252 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1253 result back to the 8-bit MMIO register.
1255 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1256 OR between the read result and the value specified by OrData, and
1257 writes the result to the 8-bit MMIO register specified by Address. The value
1258 written to the MMIO register is returned. This function must guarantee that
1259 all MMIO read and write operations are serialized.
1261 If 8-bit MMIO register operations are not supported, then ASSERT().
1263 @param Address The MMIO register to write.
1264 @param OrData The value to OR with the read value from the MMIO register.
1266 @return The value written back to the MMIO register.
1277 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1278 back to the 8-bit MMIO register.
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 Address The MMIO register to write.
1289 @param 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 OR, and writes the result back to the 8-bit MMIO register.
1305 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1306 between the read result and the value specified by AndData, performs a
1307 bitwise OR between the result of the AND operation and the value specified by
1308 OrData, and writes the result to the 8-bit MMIO register specified by
1309 Address. The value written to the MMIO register is returned. This function
1310 must guarantee that all MMIO read and write operations are serialized.
1312 If 8-bit MMIO register operations are not supported, then ASSERT().
1315 @param Address The MMIO register to write.
1316 @param AndData The value to AND with the read value from the MMIO register.
1317 @param 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.
1333 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1334 the StartBit and the EndBit. The value of the bit field is returned.
1336 If 8-bit MMIO register operations are not supported, then ASSERT().
1337 If StartBit is greater than 7, then ASSERT().
1338 If EndBit is greater than 7, then ASSERT().
1339 If EndBit is less than StartBit, then ASSERT().
1341 @param Address MMIO register to read.
1342 @param StartBit The ordinal of the least significant bit in the bit field.
1344 @param EndBit The ordinal of the most significant bit in the bit field.
1347 @return The value read.
1359 Writes a bit field to a MMIO register.
1361 Writes Value to the bit field of the MMIO register. The bit field is
1362 specified by the StartBit and the EndBit. All other bits in the destination
1363 MMIO register are preserved. The new value of the 8-bit register is returned.
1365 If 8-bit MMIO register operations are not supported, then ASSERT().
1366 If StartBit is greater than 7, then ASSERT().
1367 If EndBit is greater than 7, then ASSERT().
1368 If EndBit is less than StartBit, then ASSERT().
1370 @param Address MMIO register to write.
1371 @param StartBit The ordinal of the least significant bit in the bit field.
1373 @param EndBit The ordinal of the most significant bit in the bit field.
1375 @param Value New value of the bit field.
1377 @return The value written back to the MMIO register.
1382 MmioBitFieldWrite8 (
1390 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1391 writes the result back to the bit field in the 8-bit MMIO register.
1393 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1394 OR between the read result and the value specified by OrData, and
1395 writes the result to the 8-bit MMIO register specified by Address. The value
1396 written to the MMIO register is returned. This function must guarantee that
1397 all MMIO read and write operations are serialized. Extra left bits in OrData
1400 If 8-bit MMIO register operations are not supported, then ASSERT().
1401 If StartBit is greater than 7, then ASSERT().
1402 If EndBit is greater than 7, then ASSERT().
1403 If EndBit is less than StartBit, then ASSERT().
1405 @param Address MMIO register to write.
1406 @param StartBit The ordinal of the least significant bit in the bit field.
1408 @param EndBit The ordinal of the most significant bit in the bit field.
1410 @param OrData The value to OR with read value from the MMIO register.
1412 @return The value written back to the MMIO register.
1425 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1426 writes the result back to the bit field in the 8-bit MMIO register.
1428 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1429 between the read result and the value specified by AndData, and writes the
1430 result to the 8-bit MMIO register specified by Address. The value written to
1431 the MMIO register is returned. This function must guarantee that all MMIO
1432 read and write operations are serialized. Extra left bits in AndData are
1435 If 8-bit MMIO register operations are not supported, then ASSERT().
1436 If StartBit is greater than 7, then ASSERT().
1437 If EndBit is greater than 7, then ASSERT().
1438 If EndBit is less than StartBit, then ASSERT().
1440 @param Address MMIO register to write.
1441 @param StartBit The ordinal of the least significant bit in the bit field.
1443 @param EndBit The ordinal of the most significant bit in the bit field.
1445 @param AndData The value to AND with read value from the MMIO register.
1447 @return The value written back to the MMIO register.
1460 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1461 by a bitwise OR, and writes the result back to the bit field in the
1462 8-bit MMIO register.
1464 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1465 followed by a bitwise OR between the read result and the value
1466 specified by AndData, and writes the result to the 8-bit MMIO register
1467 specified by Address. The value written to the MMIO register is returned.
1468 This function must guarantee that all MMIO read and write operations are
1469 serialized. Extra left bits in both AndData and OrData are stripped.
1471 If 8-bit MMIO register operations are not supported, then ASSERT().
1472 If StartBit is greater than 7, then ASSERT().
1473 If EndBit is greater than 7, then ASSERT().
1474 If EndBit is less than StartBit, then ASSERT().
1476 @param Address MMIO register to write.
1477 @param StartBit The ordinal of the least significant bit in the bit field.
1479 @param EndBit The ordinal of the most significant bit in the bit field.
1481 @param AndData The value to AND with read value from the MMIO register.
1482 @param OrData The value to OR with the result of the AND operation.
1484 @return The value written back to the MMIO register.
1489 MmioBitFieldAndThenOr8 (
1498 Reads a 16-bit MMIO register.
1500 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1501 returned. This function must guarantee that all MMIO read and write
1502 operations are serialized.
1504 If 16-bit MMIO register operations are not supported, then ASSERT().
1505 If Address is not aligned on a 16-bit boundary, then ASSERT().
1507 @param Address The MMIO register to read.
1509 @return The value read.
1519 Writes a 16-bit MMIO register.
1521 Writes the 16-bit MMIO register specified by Address with the value specified
1522 by Value and returns Value. This function must guarantee that all MMIO read
1523 and write operations are serialized.
1525 If 16-bit MMIO register operations are not supported, then ASSERT().
1526 If Address is not aligned on a 16-bit boundary, then ASSERT().
1528 @param Address The MMIO register to write.
1529 @param Value The value to write to the MMIO register.
1542 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1543 result back to the 16-bit MMIO register.
1545 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1546 OR between the read result and the value specified by OrData, and
1547 writes the result to the 16-bit MMIO register specified by Address. The value
1548 written to the MMIO register is returned. This function must guarantee that
1549 all MMIO read and write operations are serialized.
1551 If 16-bit MMIO register operations are not supported, then ASSERT().
1552 If Address is not aligned on a 16-bit boundary, then ASSERT().
1554 @param Address The MMIO register to write.
1555 @param OrData The value to OR with the read value from the MMIO register.
1557 @return The value written back to the MMIO register.
1568 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1569 back to the 16-bit MMIO register.
1571 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1572 between the read result and the value specified by AndData, and writes the
1573 result to the 16-bit MMIO register specified by Address. The value written to
1574 the MMIO register is returned. This function must guarantee that all MMIO
1575 read and write operations are serialized.
1577 If 16-bit MMIO register operations are not supported, then ASSERT().
1578 If Address is not aligned on a 16-bit boundary, then ASSERT().
1580 @param Address The MMIO register to write.
1581 @param AndData The value to AND with the read value from the MMIO register.
1583 @return The value written back to the MMIO register.
1594 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1595 OR, and writes the result back to the 16-bit MMIO register.
1597 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1598 between the read result and the value specified by AndData, performs a
1599 bitwise OR between the result of the AND operation and the value specified by
1600 OrData, and writes the result to the 16-bit MMIO register specified by
1601 Address. The value written to the MMIO register is returned. This function
1602 must guarantee that all MMIO read and write operations are serialized.
1604 If 16-bit MMIO register operations are not supported, then ASSERT().
1605 If Address is not aligned on a 16-bit boundary, then ASSERT().
1607 @param Address The MMIO register to write.
1608 @param AndData The value to AND with the read value from the MMIO register.
1609 @param OrData The value to OR with the result of the AND operation.
1611 @return The value written back to the MMIO register.
1623 Reads a bit field of a MMIO register.
1625 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1626 the StartBit and the EndBit. The value of the bit field is returned.
1628 If 16-bit MMIO register operations are not supported, then ASSERT().
1629 If Address is not aligned on a 16-bit boundary, then ASSERT().
1630 If StartBit is greater than 15, then ASSERT().
1631 If EndBit is greater than 15, then ASSERT().
1632 If EndBit is less than StartBit, then ASSERT().
1634 @param Address MMIO register to read.
1635 @param StartBit The ordinal of the least significant bit in the bit field.
1637 @param EndBit The ordinal of the most significant bit in the bit field.
1640 @return The value read.
1645 MmioBitFieldRead16 (
1652 Writes a bit field to a MMIO register.
1654 Writes Value to the bit field of the MMIO register. The bit field is
1655 specified by the StartBit and the EndBit. All other bits in the destination
1656 MMIO register are preserved. The new value of the 16-bit register is returned.
1658 If 16-bit MMIO register operations are not supported, then ASSERT().
1659 If Address is not aligned on a 16-bit boundary, then ASSERT().
1660 If StartBit is greater than 15, then ASSERT().
1661 If EndBit is greater than 15, then ASSERT().
1662 If EndBit is less than StartBit, then ASSERT().
1664 @param Address MMIO register to write.
1665 @param StartBit The ordinal of the least significant bit in the bit field.
1667 @param EndBit The ordinal of the most significant bit in the bit field.
1669 @param Value New value of the bit field.
1671 @return The value written back to the MMIO register.
1676 MmioBitFieldWrite16 (
1684 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1685 writes the result back to the bit field in the 16-bit MMIO register.
1687 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1688 OR between the read result and the value specified by OrData, and
1689 writes the result to the 16-bit MMIO register specified by Address. The value
1690 written to the MMIO register is returned. This function must guarantee that
1691 all MMIO read and write operations are serialized. Extra left bits in OrData
1694 If 16-bit MMIO register operations are not supported, then ASSERT().
1695 If Address is not aligned on a 16-bit boundary, then ASSERT().
1696 If StartBit is greater than 15, then ASSERT().
1697 If EndBit is greater than 15, then ASSERT().
1698 If EndBit is less than StartBit, then ASSERT().
1700 @param Address MMIO register to write.
1701 @param StartBit The ordinal of the least significant bit in the bit field.
1703 @param EndBit The ordinal of the most significant bit in the bit field.
1705 @param OrData The value to OR with read value from the MMIO register.
1707 @return The value written back to the MMIO register.
1720 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1721 writes the result back to the bit field in the 16-bit MMIO register.
1723 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1724 between the read result and the value specified by AndData, and writes the
1725 result to the 16-bit MMIO register specified by Address. The value written to
1726 the MMIO register is returned. This function must guarantee that all MMIO
1727 read and write operations are serialized. Extra left bits in AndData are
1730 If 16-bit MMIO register operations are not supported, then ASSERT().
1731 If Address is not aligned on a 16-bit boundary, then ASSERT().
1732 If StartBit is greater than 15, then ASSERT().
1733 If EndBit is greater than 15, then ASSERT().
1734 If EndBit is less than StartBit, then ASSERT().
1736 @param Address MMIO register to write.
1737 @param StartBit The ordinal of the least significant bit in the bit field.
1739 @param EndBit The ordinal of the most significant bit in the bit field.
1741 @param AndData The value to AND with read value from the MMIO register.
1743 @return The value written back to the MMIO register.
1756 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1757 by a bitwise OR, and writes the result back to the bit field in the
1758 16-bit MMIO register.
1760 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1761 followed by a bitwise OR between the read result and the value
1762 specified by AndData, and writes the result to the 16-bit MMIO register
1763 specified by Address. The value written to the MMIO register is returned.
1764 This function must guarantee that all MMIO read and write operations are
1765 serialized. Extra left bits in both AndData and OrData are stripped.
1767 If 16-bit MMIO register operations are not supported, then ASSERT().
1768 If Address is not aligned on a 16-bit boundary, then ASSERT().
1769 If StartBit is greater than 15, then ASSERT().
1770 If EndBit is greater than 15, then ASSERT().
1771 If EndBit is less than StartBit, then ASSERT().
1773 @param Address MMIO register to write.
1774 @param StartBit The ordinal of the least significant bit in the bit field.
1776 @param EndBit The ordinal of the most significant bit in the bit field.
1778 @param AndData The value to AND with read value from the MMIO register.
1779 @param OrData The value to OR with the result of the AND operation.
1781 @return The value written back to the MMIO register.
1786 MmioBitFieldAndThenOr16 (
1795 Reads a 32-bit MMIO register.
1797 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1798 returned. This function must guarantee that all MMIO read and write
1799 operations are serialized.
1801 If 32-bit MMIO register operations are not supported, then ASSERT().
1802 If Address is not aligned on a 32-bit boundary, then ASSERT().
1804 @param Address The MMIO register to read.
1806 @return The value read.
1816 Writes a 32-bit MMIO register.
1818 Writes the 32-bit MMIO register specified by Address with the value specified
1819 by Value and returns Value. This function must guarantee that all MMIO read
1820 and write operations are serialized.
1822 If 32-bit MMIO register operations are not supported, then ASSERT().
1823 If Address is not aligned on a 32-bit boundary, then ASSERT().
1825 @param Address The MMIO register to write.
1826 @param Value The value to write to the MMIO register.
1839 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1840 result back to the 32-bit MMIO register.
1842 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1843 OR between the read result and the value specified by OrData, and
1844 writes the result to the 32-bit MMIO register specified by Address. The value
1845 written to the MMIO register is returned. This function must guarantee that
1846 all MMIO read and write operations are serialized.
1848 If 32-bit MMIO register operations are not supported, then ASSERT().
1849 If Address is not aligned on a 32-bit boundary, then ASSERT().
1851 @param Address The MMIO register to write.
1852 @param OrData The value to OR with the read value from the MMIO register.
1854 @return The value written back to the MMIO register.
1865 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1866 back to the 32-bit MMIO register.
1868 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1869 between the read result and the value specified by AndData, and writes the
1870 result to the 32-bit MMIO register specified by Address. The value written to
1871 the MMIO register is returned. This function must guarantee that all MMIO
1872 read and write operations are serialized.
1874 If 32-bit MMIO register operations are not supported, then ASSERT().
1875 If Address is not aligned on a 32-bit boundary, then ASSERT().
1877 @param Address The MMIO register to write.
1878 @param AndData The value to AND with the read value from the MMIO register.
1880 @return The value written back to the MMIO register.
1891 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1892 OR, and writes the result back to the 32-bit MMIO register.
1894 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1895 between the read result and the value specified by AndData, performs a
1896 bitwise OR between the result of the AND operation and the value specified by
1897 OrData, and writes the result to the 32-bit MMIO register specified by
1898 Address. The value written to the MMIO register is returned. This function
1899 must guarantee that all MMIO read and write operations are serialized.
1901 If 32-bit MMIO register operations are not supported, then ASSERT().
1902 If Address is not aligned on a 32-bit boundary, then ASSERT().
1904 @param Address The MMIO register to write.
1905 @param AndData The value to AND with the read value from the MMIO register.
1906 @param OrData The value to OR with the result of the AND operation.
1908 @return The value written back to the MMIO register.
1920 Reads a bit field of a MMIO register.
1922 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1923 the StartBit and the EndBit. The value of the bit field is returned.
1925 If 32-bit MMIO register operations are not supported, then ASSERT().
1926 If Address is not aligned on a 32-bit boundary, then ASSERT().
1927 If StartBit is greater than 31, then ASSERT().
1928 If EndBit is greater than 31, then ASSERT().
1929 If EndBit is less than StartBit, then ASSERT().
1931 @param Address MMIO register to read.
1932 @param StartBit The ordinal of the least significant bit in the bit field.
1934 @param EndBit The ordinal of the most significant bit in the bit field.
1937 @return The value read.
1942 MmioBitFieldRead32 (
1949 Writes a bit field to a MMIO register.
1951 Writes Value to the bit field of the MMIO register. The bit field is
1952 specified by the StartBit and the EndBit. All other bits in the destination
1953 MMIO register are preserved. The new value of the 32-bit register is returned.
1955 If 32-bit MMIO register operations are not supported, then ASSERT().
1956 If Address is not aligned on a 32-bit boundary, then ASSERT().
1957 If StartBit is greater than 31, then ASSERT().
1958 If EndBit is greater than 31, then ASSERT().
1959 If EndBit is less than StartBit, then ASSERT().
1961 @param Address MMIO register to write.
1962 @param StartBit The ordinal of the least significant bit in the bit field.
1964 @param EndBit The ordinal of the most significant bit in the bit field.
1966 @param Value New value of the bit field.
1968 @return The value written back to the MMIO register.
1973 MmioBitFieldWrite32 (
1981 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1982 writes the result back to the bit field in the 32-bit MMIO register.
1984 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1985 OR between the read result and the value specified by OrData, and
1986 writes the result to the 32-bit MMIO register specified by Address. The value
1987 written to the MMIO register is returned. This function must guarantee that
1988 all MMIO read and write operations are serialized. Extra left bits in OrData
1991 If 32-bit MMIO register operations are not supported, then ASSERT().
1992 If Address is not aligned on a 32-bit boundary, then ASSERT().
1993 If StartBit is greater than 31, then ASSERT().
1994 If EndBit is greater than 31, then ASSERT().
1995 If EndBit is less than StartBit, then ASSERT().
1997 @param Address MMIO register to write.
1998 @param StartBit The ordinal of the least significant bit in the bit field.
2000 @param EndBit The ordinal of the most significant bit in the bit field.
2002 @param OrData The value to OR with read value from the MMIO register.
2004 @return The value written back to the MMIO register.
2017 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2018 writes the result back to the bit field in the 32-bit MMIO register.
2020 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2021 between the read result and the value specified by AndData, and writes the
2022 result to the 32-bit MMIO register specified by Address. The value written to
2023 the MMIO register is returned. This function must guarantee that all MMIO
2024 read and write operations are serialized. Extra left bits in AndData are
2027 If 32-bit MMIO register operations are not supported, then ASSERT().
2028 If Address is not aligned on a 32-bit boundary, then ASSERT().
2029 If StartBit is greater than 31, then ASSERT().
2030 If EndBit is greater than 31, then ASSERT().
2031 If EndBit is less than StartBit, then ASSERT().
2033 @param Address MMIO register to write.
2034 @param StartBit The ordinal of the least significant bit in the bit field.
2036 @param EndBit The ordinal of the most significant bit in the bit field.
2038 @param AndData The value to AND with read value from the MMIO register.
2040 @return The value written back to the MMIO register.
2053 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2054 by a bitwise OR, and writes the result back to the bit field in the
2055 32-bit MMIO register.
2057 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2058 followed by a bitwise OR between the read result and the value
2059 specified by AndData, and writes the result to the 32-bit MMIO register
2060 specified by Address. The value written to the MMIO register is returned.
2061 This function must guarantee that all MMIO read and write operations are
2062 serialized. Extra left bits in both AndData and OrData are stripped.
2064 If 32-bit MMIO register operations are not supported, then ASSERT().
2065 If Address is not aligned on a 32-bit boundary, then ASSERT().
2066 If StartBit is greater than 31, then ASSERT().
2067 If EndBit is greater than 31, then ASSERT().
2068 If EndBit is less than StartBit, then ASSERT().
2070 @param Address MMIO register to write.
2071 @param StartBit The ordinal of the least significant bit in the bit field.
2073 @param EndBit The ordinal of the most significant bit in the bit field.
2075 @param AndData The value to AND with read value from the MMIO register.
2076 @param OrData The value to OR with the result of the AND operation.
2078 @return The value written back to the MMIO register.
2083 MmioBitFieldAndThenOr32 (
2092 Reads a 64-bit MMIO register.
2094 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2095 returned. This function must guarantee that all MMIO read and write
2096 operations are serialized.
2098 If 64-bit MMIO register operations are not supported, then ASSERT().
2099 If Address is not aligned on a 64-bit boundary, then ASSERT().
2101 @param Address The MMIO register to read.
2103 @return The value read.
2113 Writes a 64-bit MMIO register.
2115 Writes the 64-bit MMIO register specified by Address with the value specified
2116 by Value and returns Value. This function must guarantee that all MMIO read
2117 and write operations are serialized.
2119 If 64-bit MMIO register operations are not supported, then ASSERT().
2120 If Address is not aligned on a 64-bit boundary, then ASSERT().
2122 @param Address The MMIO register to write.
2123 @param Value The value to write to the MMIO register.
2134 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2135 result back to the 64-bit MMIO register.
2137 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2138 OR between the read result and the value specified by OrData, and
2139 writes the result to the 64-bit MMIO register specified by Address. The value
2140 written to the MMIO register is returned. This function must guarantee that
2141 all MMIO read and write operations are serialized.
2143 If 64-bit MMIO register operations are not supported, then ASSERT().
2144 If Address is not aligned on a 64-bit boundary, then ASSERT().
2146 @param Address The MMIO register to write.
2147 @param OrData The value to OR with the read value from the MMIO register.
2149 @return The value written back to the MMIO register.
2160 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2161 back to the 64-bit MMIO register.
2163 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2164 between the read result and the value specified by AndData, and writes the
2165 result to the 64-bit MMIO register specified by Address. The value written to
2166 the MMIO register is returned. This function must guarantee that all MMIO
2167 read and write operations are serialized.
2169 If 64-bit MMIO register operations are not supported, then ASSERT().
2170 If Address is not aligned on a 64-bit boundary, then ASSERT().
2172 @param Address The MMIO register to write.
2173 @param AndData The value to AND with the read value from the MMIO register.
2175 @return The value written back to the MMIO register.
2186 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2187 OR, and writes the result back to the 64-bit MMIO register.
2189 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2190 between the read result and the value specified by AndData, performs a
2191 bitwise OR between the result of the AND operation and the value specified by
2192 OrData, and writes the result to the 64-bit MMIO register specified by
2193 Address. The value written to the MMIO register is returned. This function
2194 must guarantee that all MMIO read and write operations are serialized.
2196 If 64-bit MMIO register operations are not supported, then ASSERT().
2197 If Address is not aligned on a 64-bit boundary, then ASSERT().
2199 @param Address The MMIO register to write.
2200 @param AndData The value to AND with the read value from the MMIO register.
2201 @param OrData The value to OR with the result of the AND operation.
2203 @return The value written back to the MMIO register.
2215 Reads a bit field of a MMIO register.
2217 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2218 the StartBit and the EndBit. The value of the bit field is returned.
2220 If 64-bit MMIO register operations are not supported, then ASSERT().
2221 If Address is not aligned on a 64-bit boundary, then ASSERT().
2222 If StartBit is greater than 63, then ASSERT().
2223 If EndBit is greater than 63, then ASSERT().
2224 If EndBit is less than StartBit, then ASSERT().
2226 @param Address MMIO register to read.
2227 @param StartBit The ordinal of the least significant bit in the bit field.
2229 @param EndBit The ordinal of the most significant bit in the bit field.
2232 @return The value read.
2237 MmioBitFieldRead64 (
2244 Writes a bit field to a MMIO register.
2246 Writes Value to the bit field of the MMIO register. The bit field is
2247 specified by the StartBit and the EndBit. All other bits in the destination
2248 MMIO register are preserved. The new value of the 64-bit register is returned.
2250 If 64-bit MMIO register operations are not supported, then ASSERT().
2251 If Address is not aligned on a 64-bit boundary, then ASSERT().
2252 If StartBit is greater than 63, then ASSERT().
2253 If EndBit is greater than 63, then ASSERT().
2254 If EndBit is less than StartBit, then ASSERT().
2256 @param Address MMIO register to write.
2257 @param StartBit The ordinal of the least significant bit in the bit field.
2259 @param EndBit The ordinal of the most significant bit in the bit field.
2261 @param Value New value of the bit field.
2263 @return The value written back to the MMIO register.
2268 MmioBitFieldWrite64 (
2276 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2277 writes the result back to the bit field in the 64-bit MMIO register.
2279 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2280 OR between the read result and the value specified by OrData, and
2281 writes the result to the 64-bit MMIO register specified by Address. The value
2282 written to the MMIO register is returned. This function must guarantee that
2283 all MMIO read and write operations are serialized. Extra left bits in OrData
2286 If 64-bit MMIO register operations are not supported, then ASSERT().
2287 If Address is not aligned on a 64-bit boundary, then ASSERT().
2288 If StartBit is greater than 63, then ASSERT().
2289 If EndBit is greater than 63, then ASSERT().
2290 If EndBit is less than StartBit, then ASSERT().
2292 @param Address MMIO register to write.
2293 @param StartBit The ordinal of the least significant bit in the bit field.
2295 @param EndBit The ordinal of the most significant bit in the bit field.
2297 @param OrData The value to OR with read value from the MMIO register.
2299 @return The value written back to the MMIO register.
2312 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2313 writes the result back to the bit field in the 64-bit MMIO register.
2315 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2316 between the read result and the value specified by AndData, and writes the
2317 result to the 64-bit MMIO register specified by Address. The value written to
2318 the MMIO register is returned. This function must guarantee that all MMIO
2319 read and write operations are serialized. Extra left bits in AndData are
2322 If 64-bit MMIO register operations are not supported, then ASSERT().
2323 If Address is not aligned on a 64-bit boundary, then ASSERT().
2324 If StartBit is greater than 63, then ASSERT().
2325 If EndBit is greater than 63, then ASSERT().
2326 If EndBit is less than StartBit, then ASSERT().
2328 @param Address MMIO register to write.
2329 @param StartBit The ordinal of the least significant bit in the bit field.
2331 @param EndBit The ordinal of the most significant bit in the bit field.
2333 @param AndData The value to AND with read value from the MMIO register.
2335 @return The value written back to the MMIO register.
2348 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2349 by a bitwise OR, and writes the result back to the bit field in the
2350 64-bit MMIO register.
2352 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2353 followed by a bitwise OR between the read result and the value
2354 specified by AndData, and writes the result to the 64-bit MMIO register
2355 specified by Address. The value written to the MMIO register is returned.
2356 This function must guarantee that all MMIO read and write operations are
2357 serialized. Extra left bits in both AndData and OrData are stripped.
2359 If 64-bit MMIO register operations are not supported, then ASSERT().
2360 If Address is not aligned on a 64-bit boundary, then ASSERT().
2361 If StartBit is greater than 63, then ASSERT().
2362 If EndBit is greater than 63, then ASSERT().
2363 If EndBit is less than StartBit, then ASSERT().
2365 @param Address MMIO register to write.
2366 @param StartBit The ordinal of the least significant bit in the bit field.
2368 @param EndBit The ordinal of the most significant bit in the bit field.
2370 @param AndData The value to AND with read value from the MMIO register.
2371 @param OrData The value to OR with the result of the AND operation.
2373 @return The value written back to the MMIO register.
2378 MmioBitFieldAndThenOr64 (
2387 Copy data from MMIO region to system memory by using 8-bit access.
2389 Copy data from MMIO region specified by starting address StartAddress
2390 to system memory specified by Buffer by using 8-bit access. The total
2391 number of byte to be copied is specified by Length. Buffer is returned.
2393 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2394 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2397 @param StartAddress Starting address for the MMIO region to be copied from.
2398 @param Length The size, in bytes, of Buffer.
2399 @param Buffer Pointer to a system memory buffer receiving the data read.
2407 IN UINTN StartAddress
,
2413 Copy data from MMIO region to system memory by using 16-bit access.
2415 Copy data from MMIO region specified by starting address StartAddress
2416 to system memory specified by Buffer by using 16-bit access. The total
2417 number of byte to be copied is specified by Length. Buffer is returned.
2419 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2421 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2422 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2424 If Length is not aligned on a 16-bit boundary, then ASSERT().
2425 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2427 @param StartAddress Starting address for the MMIO region to be copied from.
2428 @param Length The size, in bytes, of Buffer.
2429 @param Buffer Pointer to a system memory buffer receiving the data read.
2437 IN UINTN StartAddress
,
2443 Copy data from MMIO region to system memory by using 32-bit access.
2445 Copy data from MMIO region specified by starting address StartAddress
2446 to system memory specified by Buffer by using 32-bit access. The total
2447 number of byte to be copied is specified by Length. Buffer is returned.
2449 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2451 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2452 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2454 If Length is not aligned on a 32-bit boundary, then ASSERT().
2455 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2457 @param StartAddress Starting address for the MMIO region to be copied from.
2458 @param Length The size, in bytes, of Buffer.
2459 @param Buffer Pointer to a system memory buffer receiving the data read.
2467 IN UINTN StartAddress
,
2473 Copy data from MMIO region to system memory by using 64-bit access.
2475 Copy data from MMIO region specified by starting address StartAddress
2476 to system memory specified by Buffer by using 64-bit access. The total
2477 number of byte to be copied is specified by Length. Buffer is returned.
2479 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2481 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2482 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2484 If Length is not aligned on a 64-bit boundary, then ASSERT().
2485 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2487 @param StartAddress Starting address for the MMIO region to be copied from.
2488 @param Length The size, in bytes, of Buffer.
2489 @param Buffer Pointer to a system memory buffer receiving the data read.
2497 IN UINTN StartAddress
,
2503 Copy data from system memory to MMIO region by using 8-bit access.
2505 Copy data from system memory specified by Buffer to MMIO region specified
2506 by starting address StartAddress by using 8-bit access. The total number
2507 of byte to be copied is specified by Length. Buffer is returned.
2509 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2510 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2513 @param StartAddress Starting address for the MMIO region to be copied to.
2514 @param Length The size, in bytes, of Buffer.
2515 @param Buffer Pointer to a system memory buffer containing the data to write.
2523 IN UINTN StartAddress
,
2525 IN CONST UINT8
*Buffer
2529 Copy data from system memory to MMIO region by using 16-bit access.
2531 Copy data from system memory specified by Buffer to MMIO region specified
2532 by starting address StartAddress by using 16-bit access. The total number
2533 of byte to be copied is specified by Length. Buffer is returned.
2535 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2537 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2538 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2540 If Length is not aligned on a 16-bit boundary, then ASSERT().
2542 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2544 @param StartAddress Starting address for the MMIO region to be copied to.
2545 @param Length The size, in bytes, of Buffer.
2546 @param Buffer Pointer to a system memory buffer containing the data to write.
2554 IN UINTN StartAddress
,
2556 IN CONST UINT16
*Buffer
2560 Copy data from system memory to MMIO region by using 32-bit access.
2562 Copy data from system memory specified by Buffer to MMIO region specified
2563 by starting address StartAddress by using 32-bit access. The total number
2564 of byte to be copied is specified by Length. Buffer is returned.
2566 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2568 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2569 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2571 If Length is not aligned on a 32-bit boundary, then ASSERT().
2573 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2575 @param StartAddress Starting address for the MMIO region to be copied to.
2576 @param Length The size, in bytes, of Buffer.
2577 @param Buffer Pointer to a system memory buffer containing the data to write.
2585 IN UINTN StartAddress
,
2587 IN CONST UINT32
*Buffer
2591 Copy data from system memory to MMIO region by using 64-bit access.
2593 Copy data from system memory specified by Buffer to MMIO region specified
2594 by starting address StartAddress by using 64-bit access. The total number
2595 of byte to be copied is specified by Length. Buffer is returned.
2597 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2599 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2600 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2602 If Length is not aligned on a 64-bit boundary, then ASSERT().
2604 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2606 @param StartAddress Starting address for the MMIO region to be copied to.
2607 @param Length The size, in bytes, of Buffer.
2608 @param Buffer Pointer to a system memory buffer containing the data to write.
2616 IN UINTN StartAddress
,
2618 IN CONST UINT64
*Buffer