]>
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 - 2008, 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.
1250 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1251 result back to the 8-bit MMIO register.
1253 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1254 OR between the read result and the value specified by OrData, and
1255 writes the result to the 8-bit MMIO register specified by Address. The value
1256 written to the MMIO register is returned. This function must guarantee that
1257 all MMIO read and write operations are serialized.
1259 If 8-bit MMIO register operations are not supported, then ASSERT().
1261 @param Address The MMIO register to write.
1262 @param OrData The value to OR with the read value from the MMIO register.
1264 @return The value written back to the MMIO register.
1275 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1276 back to the 8-bit MMIO register.
1278 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1279 between the read result and the value specified by AndData, and writes the
1280 result to the 8-bit MMIO register specified by Address. The value written to
1281 the MMIO register is returned. This function must guarantee that all MMIO
1282 read and write operations are serialized.
1284 If 8-bit MMIO register operations are not supported, then ASSERT().
1286 @param Address The MMIO register to write.
1287 @param AndData The value to AND with the read value from the MMIO register.
1289 @return The value written back to the MMIO register.
1300 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1301 OR, and writes the result back to the 8-bit MMIO register.
1303 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1304 between the read result and the value specified by AndData, performs a
1305 bitwise OR between the result of the AND operation and the value specified by
1306 OrData, and writes the result to the 8-bit MMIO register specified by
1307 Address. The value written to the MMIO register is returned. This function
1308 must guarantee that all MMIO read and write operations are serialized.
1310 If 8-bit MMIO register operations are not supported, then ASSERT().
1313 @param Address The MMIO register to write.
1314 @param AndData The value to AND with the read value from the MMIO register.
1315 @param OrData The value to OR with the result of the AND operation.
1317 @return The value written back to the MMIO register.
1329 Reads a bit field of a MMIO register.
1331 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1332 the StartBit and the EndBit. The value of the bit field is returned.
1334 If 8-bit MMIO register operations are not supported, then ASSERT().
1335 If StartBit is greater than 7, then ASSERT().
1336 If EndBit is greater than 7, then ASSERT().
1337 If EndBit is less than StartBit, then ASSERT().
1339 @param Address MMIO register to read.
1340 @param StartBit The ordinal of the least significant bit in the bit field.
1342 @param EndBit The ordinal of the most significant bit in the bit field.
1345 @return The value read.
1357 Writes a bit field to a MMIO register.
1359 Writes Value to the bit field of the MMIO register. The bit field is
1360 specified by the StartBit and the EndBit. All other bits in the destination
1361 MMIO register are preserved. The new value of the 8-bit register is returned.
1363 If 8-bit MMIO register operations are not supported, then ASSERT().
1364 If StartBit is greater than 7, then ASSERT().
1365 If EndBit is greater than 7, then ASSERT().
1366 If EndBit is less than StartBit, then ASSERT().
1368 @param Address MMIO register to write.
1369 @param StartBit The ordinal of the least significant bit in the bit field.
1371 @param EndBit The ordinal of the most significant bit in the bit field.
1373 @param Value New value of the bit field.
1375 @return The value written back to the MMIO register.
1380 MmioBitFieldWrite8 (
1388 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1389 writes the result back to the bit field in the 8-bit MMIO register.
1391 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1392 OR between the read result and the value specified by OrData, and
1393 writes the result to the 8-bit MMIO register specified by Address. The value
1394 written to the MMIO register is returned. This function must guarantee that
1395 all MMIO read and write operations are serialized. Extra left bits in OrData
1398 If 8-bit MMIO register operations are not supported, then ASSERT().
1399 If StartBit is greater than 7, then ASSERT().
1400 If EndBit is greater than 7, then ASSERT().
1401 If EndBit is less than StartBit, then ASSERT().
1403 @param Address MMIO register to write.
1404 @param StartBit The ordinal of the least significant bit in the bit field.
1406 @param EndBit The ordinal of the most significant bit in the bit field.
1408 @param OrData The value to OR with read value from the MMIO register.
1410 @return The value written back to the MMIO register.
1423 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1424 writes the result back to the bit field in the 8-bit MMIO register.
1426 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1427 between the read result and the value specified by AndData, and writes the
1428 result to the 8-bit MMIO register specified by Address. The value written to
1429 the MMIO register is returned. This function must guarantee that all MMIO
1430 read and write operations are serialized. Extra left bits in AndData are
1433 If 8-bit MMIO register operations are not supported, then ASSERT().
1434 If StartBit is greater than 7, then ASSERT().
1435 If EndBit is greater than 7, then ASSERT().
1436 If EndBit is less than StartBit, then ASSERT().
1438 @param Address MMIO register to write.
1439 @param StartBit The ordinal of the least significant bit in the bit field.
1441 @param EndBit The ordinal of the most significant bit in the bit field.
1443 @param AndData The value to AND with read value from the MMIO register.
1445 @return The value written back to the MMIO register.
1458 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1459 by a bitwise OR, and writes the result back to the bit field in the
1460 8-bit MMIO register.
1462 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1463 followed by a bitwise OR between the read result and the value
1464 specified by AndData, and writes the result to the 8-bit MMIO register
1465 specified by Address. The value written to the MMIO register is returned.
1466 This function must guarantee that all MMIO read and write operations are
1467 serialized. Extra left bits in both AndData and OrData are stripped.
1469 If 8-bit MMIO register operations are not supported, then ASSERT().
1470 If StartBit is greater than 7, then ASSERT().
1471 If EndBit is greater than 7, then ASSERT().
1472 If EndBit is less than StartBit, then ASSERT().
1474 @param Address MMIO register to write.
1475 @param StartBit The ordinal of the least significant bit in the bit field.
1477 @param EndBit The ordinal of the most significant bit in the bit field.
1479 @param AndData The value to AND with read value from the MMIO register.
1480 @param OrData The value to OR with the result of the AND operation.
1482 @return The value written back to the MMIO register.
1487 MmioBitFieldAndThenOr8 (
1496 Reads a 16-bit MMIO register.
1498 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1499 returned. This function must guarantee that all MMIO read and write
1500 operations are serialized.
1502 If 16-bit MMIO register operations are not supported, then ASSERT().
1503 If Address is not aligned on a 16-bit boundary, then ASSERT().
1505 @param Address The MMIO register to read.
1507 @return The value read.
1517 Writes a 16-bit MMIO register.
1519 Writes the 16-bit MMIO register specified by Address with the value specified
1520 by Value and returns Value. This function must guarantee that all MMIO read
1521 and write operations are serialized.
1523 If 16-bit MMIO register operations are not supported, then ASSERT().
1524 If Address is not aligned on a 16-bit boundary, then ASSERT().
1526 @param Address The MMIO register to write.
1527 @param Value The value to write to the MMIO register.
1538 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1539 result back to the 16-bit MMIO register.
1541 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1542 OR between the read result and the value specified by OrData, and
1543 writes the result to the 16-bit MMIO register specified by Address. The value
1544 written to the MMIO register is returned. This function must guarantee that
1545 all MMIO read and write operations are serialized.
1547 If 16-bit MMIO register operations are not supported, then ASSERT().
1548 If Address is not aligned on a 16-bit boundary, then ASSERT().
1550 @param Address The MMIO register to write.
1551 @param OrData The value to OR with the read value from the MMIO register.
1553 @return The value written back to the MMIO register.
1564 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1565 back to the 16-bit MMIO register.
1567 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1568 between the read result and the value specified by AndData, and writes the
1569 result to the 16-bit MMIO register specified by Address. The value written to
1570 the MMIO register is returned. This function must guarantee that all MMIO
1571 read and write operations are serialized.
1573 If 16-bit MMIO register operations are not supported, then ASSERT().
1574 If Address is not aligned on a 16-bit boundary, then ASSERT().
1576 @param Address The MMIO register to write.
1577 @param AndData The value to AND with the read value from the MMIO register.
1579 @return The value written back to the MMIO register.
1590 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1591 OR, and writes the result back to the 16-bit MMIO register.
1593 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1594 between the read result and the value specified by AndData, performs a
1595 bitwise OR between the result of the AND operation and the value specified by
1596 OrData, and writes the result to the 16-bit MMIO register specified by
1597 Address. The value written to the MMIO register is returned. This function
1598 must guarantee that all MMIO read and write operations are serialized.
1600 If 16-bit MMIO register operations are not supported, then ASSERT().
1601 If Address is not aligned on a 16-bit boundary, then ASSERT().
1603 @param Address The MMIO register to write.
1604 @param AndData The value to AND with the read value from the MMIO register.
1605 @param OrData The value to OR with the result of the AND operation.
1607 @return The value written back to the MMIO register.
1619 Reads a bit field of a MMIO register.
1621 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1622 the StartBit and the EndBit. The value of the bit field is returned.
1624 If 16-bit MMIO register operations are not supported, then ASSERT().
1625 If Address is not aligned on a 16-bit boundary, then ASSERT().
1626 If StartBit is greater than 15, then ASSERT().
1627 If EndBit is greater than 15, then ASSERT().
1628 If EndBit is less than StartBit, then ASSERT().
1630 @param Address MMIO register to read.
1631 @param StartBit The ordinal of the least significant bit in the bit field.
1633 @param EndBit The ordinal of the most significant bit in the bit field.
1636 @return The value read.
1641 MmioBitFieldRead16 (
1648 Writes a bit field to a MMIO register.
1650 Writes Value to the bit field of the MMIO register. The bit field is
1651 specified by the StartBit and the EndBit. All other bits in the destination
1652 MMIO register are preserved. The new value of the 16-bit register is returned.
1654 If 16-bit MMIO register operations are not supported, then ASSERT().
1655 If Address is not aligned on a 16-bit boundary, then ASSERT().
1656 If StartBit is greater than 15, then ASSERT().
1657 If EndBit is greater than 15, then ASSERT().
1658 If EndBit is less than StartBit, then ASSERT().
1660 @param Address MMIO register to write.
1661 @param StartBit The ordinal of the least significant bit in the bit field.
1663 @param EndBit The ordinal of the most significant bit in the bit field.
1665 @param Value New value of the bit field.
1667 @return The value written back to the MMIO register.
1672 MmioBitFieldWrite16 (
1680 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1681 writes the result back to the bit field in the 16-bit MMIO register.
1683 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1684 OR between the read result and the value specified by OrData, and
1685 writes the result to the 16-bit MMIO register specified by Address. The value
1686 written to the MMIO register is returned. This function must guarantee that
1687 all MMIO read and write operations are serialized. Extra left bits in OrData
1690 If 16-bit MMIO register operations are not supported, then ASSERT().
1691 If Address is not aligned on a 16-bit boundary, then ASSERT().
1692 If StartBit is greater than 15, then ASSERT().
1693 If EndBit is greater than 15, then ASSERT().
1694 If EndBit is less than StartBit, then ASSERT().
1696 @param Address MMIO register to write.
1697 @param StartBit The ordinal of the least significant bit in the bit field.
1699 @param EndBit The ordinal of the most significant bit in the bit field.
1701 @param OrData The value to OR with read value from the MMIO register.
1703 @return The value written back to the MMIO register.
1716 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1717 writes the result back to the bit field in the 16-bit MMIO register.
1719 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1720 between the read result and the value specified by AndData, and writes the
1721 result to the 16-bit MMIO register specified by Address. The value written to
1722 the MMIO register is returned. This function must guarantee that all MMIO
1723 read and write operations are serialized. Extra left bits in AndData are
1726 If 16-bit MMIO register operations are not supported, then ASSERT().
1727 If Address is not aligned on a 16-bit boundary, then ASSERT().
1728 If StartBit is greater than 15, then ASSERT().
1729 If EndBit is greater than 15, then ASSERT().
1730 If EndBit is less than StartBit, then ASSERT().
1732 @param Address MMIO register to write.
1733 @param StartBit The ordinal of the least significant bit in the bit field.
1735 @param EndBit The ordinal of the most significant bit in the bit field.
1737 @param AndData The value to AND with read value from the MMIO register.
1739 @return The value written back to the MMIO register.
1752 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1753 by a bitwise OR, and writes the result back to the bit field in the
1754 16-bit MMIO register.
1756 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1757 followed by a bitwise OR between the read result and the value
1758 specified by AndData, and writes the result to the 16-bit MMIO register
1759 specified by Address. The value written to the MMIO register is returned.
1760 This function must guarantee that all MMIO read and write operations are
1761 serialized. Extra left bits in both AndData and OrData are stripped.
1763 If 16-bit MMIO register operations are not supported, then ASSERT().
1764 If Address is not aligned on a 16-bit boundary, then ASSERT().
1765 If StartBit is greater than 15, then ASSERT().
1766 If EndBit is greater than 15, then ASSERT().
1767 If EndBit is less than StartBit, then ASSERT().
1769 @param Address MMIO register to write.
1770 @param StartBit The ordinal of the least significant bit in the bit field.
1772 @param EndBit The ordinal of the most significant bit in the bit field.
1774 @param AndData The value to AND with read value from the MMIO register.
1775 @param OrData The value to OR with the result of the AND operation.
1777 @return The value written back to the MMIO register.
1782 MmioBitFieldAndThenOr16 (
1791 Reads a 32-bit MMIO register.
1793 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1794 returned. This function must guarantee that all MMIO read and write
1795 operations are serialized.
1797 If 32-bit MMIO register operations are not supported, then ASSERT().
1798 If Address is not aligned on a 32-bit boundary, then ASSERT().
1800 @param Address The MMIO register to read.
1802 @return The value read.
1812 Writes a 32-bit MMIO register.
1814 Writes the 32-bit MMIO register specified by Address with the value specified
1815 by Value and returns Value. This function must guarantee that all MMIO read
1816 and write operations are serialized.
1818 If 32-bit MMIO register operations are not supported, then ASSERT().
1819 If Address is not aligned on a 32-bit boundary, then ASSERT().
1821 @param Address The MMIO register to write.
1822 @param Value The value to write to the MMIO register.
1833 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1834 result back to the 32-bit MMIO register.
1836 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1837 OR between the read result and the value specified by OrData, and
1838 writes the result to the 32-bit MMIO register specified by Address. The value
1839 written to the MMIO register is returned. This function must guarantee that
1840 all MMIO read and write operations are serialized.
1842 If 32-bit MMIO register operations are not supported, then ASSERT().
1843 If Address is not aligned on a 32-bit boundary, then ASSERT().
1845 @param Address The MMIO register to write.
1846 @param OrData The value to OR with the read value from the MMIO register.
1848 @return The value written back to the MMIO register.
1859 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1860 back to the 32-bit MMIO register.
1862 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1863 between the read result and the value specified by AndData, and writes the
1864 result to the 32-bit MMIO register specified by Address. The value written to
1865 the MMIO register is returned. This function must guarantee that all MMIO
1866 read and write operations are serialized.
1868 If 32-bit MMIO register operations are not supported, then ASSERT().
1869 If Address is not aligned on a 32-bit boundary, then ASSERT().
1871 @param Address The MMIO register to write.
1872 @param AndData The value to AND with the read value from the MMIO register.
1874 @return The value written back to the MMIO register.
1885 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1886 OR, and writes the result back to the 32-bit MMIO register.
1888 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1889 between the read result and the value specified by AndData, performs a
1890 bitwise OR between the result of the AND operation and the value specified by
1891 OrData, and writes the result to the 32-bit MMIO register specified by
1892 Address. The value written to the MMIO register is returned. This function
1893 must guarantee that all MMIO read and write operations are serialized.
1895 If 32-bit MMIO register operations are not supported, then ASSERT().
1896 If Address is not aligned on a 32-bit boundary, then ASSERT().
1898 @param Address The MMIO register to write.
1899 @param AndData The value to AND with the read value from the MMIO register.
1900 @param OrData The value to OR with the result of the AND operation.
1902 @return The value written back to the MMIO register.
1914 Reads a bit field of a MMIO register.
1916 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1917 the StartBit and the EndBit. The value of the bit field is returned.
1919 If 32-bit MMIO register operations are not supported, then ASSERT().
1920 If Address is not aligned on a 32-bit boundary, then ASSERT().
1921 If StartBit is greater than 31, then ASSERT().
1922 If EndBit is greater than 31, then ASSERT().
1923 If EndBit is less than StartBit, then ASSERT().
1925 @param Address MMIO register to read.
1926 @param StartBit The ordinal of the least significant bit in the bit field.
1928 @param EndBit The ordinal of the most significant bit in the bit field.
1931 @return The value read.
1936 MmioBitFieldRead32 (
1943 Writes a bit field to a MMIO register.
1945 Writes Value to the bit field of the MMIO register. The bit field is
1946 specified by the StartBit and the EndBit. All other bits in the destination
1947 MMIO register are preserved. The new value of the 32-bit register is returned.
1949 If 32-bit MMIO register operations are not supported, then ASSERT().
1950 If Address is not aligned on a 32-bit boundary, then ASSERT().
1951 If StartBit is greater than 31, then ASSERT().
1952 If EndBit is greater than 31, then ASSERT().
1953 If EndBit is less than StartBit, then ASSERT().
1955 @param Address MMIO register to write.
1956 @param StartBit The ordinal of the least significant bit in the bit field.
1958 @param EndBit The ordinal of the most significant bit in the bit field.
1960 @param Value New value of the bit field.
1962 @return The value written back to the MMIO register.
1967 MmioBitFieldWrite32 (
1975 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1976 writes the result back to the bit field in the 32-bit MMIO register.
1978 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1979 OR between the read result and the value specified by OrData, and
1980 writes the result to the 32-bit MMIO register specified by Address. The value
1981 written to the MMIO register is returned. This function must guarantee that
1982 all MMIO read and write operations are serialized. Extra left bits in OrData
1985 If 32-bit MMIO register operations are not supported, then ASSERT().
1986 If Address is not aligned on a 32-bit boundary, then ASSERT().
1987 If StartBit is greater than 31, then ASSERT().
1988 If EndBit is greater than 31, then ASSERT().
1989 If EndBit is less than StartBit, then ASSERT().
1991 @param Address MMIO register to write.
1992 @param StartBit The ordinal of the least significant bit in the bit field.
1994 @param EndBit The ordinal of the most significant bit in the bit field.
1996 @param OrData The value to OR with read value from the MMIO register.
1998 @return The value written back to the MMIO register.
2011 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2012 writes the result back to the bit field in the 32-bit MMIO register.
2014 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2015 between the read result and the value specified by AndData, and writes the
2016 result to the 32-bit MMIO register specified by Address. The value written to
2017 the MMIO register is returned. This function must guarantee that all MMIO
2018 read and write operations are serialized. Extra left bits in AndData are
2021 If 32-bit MMIO register operations are not supported, then ASSERT().
2022 If Address is not aligned on a 32-bit boundary, then ASSERT().
2023 If StartBit is greater than 31, then ASSERT().
2024 If EndBit is greater than 31, then ASSERT().
2025 If EndBit is less than StartBit, then ASSERT().
2027 @param Address MMIO register to write.
2028 @param StartBit The ordinal of the least significant bit in the bit field.
2030 @param EndBit The ordinal of the most significant bit in the bit field.
2032 @param AndData The value to AND with read value from the MMIO register.
2034 @return The value written back to the MMIO register.
2047 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2048 by a bitwise OR, and writes the result back to the bit field in the
2049 32-bit MMIO register.
2051 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2052 followed by a bitwise OR between the read result and the value
2053 specified by AndData, and writes the result to the 32-bit MMIO register
2054 specified by Address. The value written to the MMIO register is returned.
2055 This function must guarantee that all MMIO read and write operations are
2056 serialized. Extra left bits in both AndData and OrData are stripped.
2058 If 32-bit MMIO register operations are not supported, then ASSERT().
2059 If Address is not aligned on a 32-bit boundary, then ASSERT().
2060 If StartBit is greater than 31, then ASSERT().
2061 If EndBit is greater than 31, then ASSERT().
2062 If EndBit is less than StartBit, then ASSERT().
2064 @param Address MMIO register to write.
2065 @param StartBit The ordinal of the least significant bit in the bit field.
2067 @param EndBit The ordinal of the most significant bit in the bit field.
2069 @param AndData The value to AND with read value from the MMIO register.
2070 @param OrData The value to OR with the result of the AND operation.
2072 @return The value written back to the MMIO register.
2077 MmioBitFieldAndThenOr32 (
2086 Reads a 64-bit MMIO register.
2088 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2089 returned. This function must guarantee that all MMIO read and write
2090 operations are serialized.
2092 If 64-bit MMIO register operations are not supported, then ASSERT().
2093 If Address is not aligned on a 64-bit boundary, then ASSERT().
2095 @param Address The MMIO register to read.
2097 @return The value read.
2107 Writes a 64-bit MMIO register.
2109 Writes the 64-bit MMIO register specified by Address with the value specified
2110 by Value and returns Value. This function must guarantee that all MMIO read
2111 and write operations are serialized.
2113 If 64-bit MMIO register operations are not supported, then ASSERT().
2114 If Address is not aligned on a 64-bit boundary, then ASSERT().
2116 @param Address The MMIO register to write.
2117 @param Value The value to write to the MMIO register.
2128 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2129 result back to the 64-bit MMIO register.
2131 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2132 OR between the read result and the value specified by OrData, and
2133 writes the result to the 64-bit MMIO register specified by Address. The value
2134 written to the MMIO register is returned. This function must guarantee that
2135 all MMIO read and write operations are serialized.
2137 If 64-bit MMIO register operations are not supported, then ASSERT().
2138 If Address is not aligned on a 64-bit boundary, then ASSERT().
2140 @param Address The MMIO register to write.
2141 @param OrData The value to OR with the read value from the MMIO register.
2143 @return The value written back to the MMIO register.
2154 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2155 back to the 64-bit MMIO register.
2157 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2158 between the read result and the value specified by AndData, and writes the
2159 result to the 64-bit MMIO register specified by Address. The value written to
2160 the MMIO register is returned. This function must guarantee that all MMIO
2161 read and write operations are serialized.
2163 If 64-bit MMIO register operations are not supported, then ASSERT().
2164 If Address is not aligned on a 64-bit boundary, then ASSERT().
2166 @param Address The MMIO register to write.
2167 @param AndData The value to AND with the read value from the MMIO register.
2169 @return The value written back to the MMIO register.
2180 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2181 OR, and writes the result back to the 64-bit MMIO register.
2183 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2184 between the read result and the value specified by AndData, performs a
2185 bitwise OR between the result of the AND operation and the value specified by
2186 OrData, and writes the result to the 64-bit MMIO register specified by
2187 Address. The value written to the MMIO register is returned. This function
2188 must guarantee that all MMIO read and write operations are serialized.
2190 If 64-bit MMIO register operations are not supported, then ASSERT().
2191 If Address is not aligned on a 64-bit boundary, then ASSERT().
2193 @param Address The MMIO register to write.
2194 @param AndData The value to AND with the read value from the MMIO register.
2195 @param OrData The value to OR with the result of the AND operation.
2197 @return The value written back to the MMIO register.
2209 Reads a bit field of a MMIO register.
2211 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2212 the StartBit and the EndBit. The value of the bit field is returned.
2214 If 64-bit MMIO register operations are not supported, then ASSERT().
2215 If Address is not aligned on a 64-bit boundary, then ASSERT().
2216 If StartBit is greater than 63, then ASSERT().
2217 If EndBit is greater than 63, then ASSERT().
2218 If EndBit is less than StartBit, then ASSERT().
2220 @param Address MMIO register to read.
2221 @param StartBit The ordinal of the least significant bit in the bit field.
2223 @param EndBit The ordinal of the most significant bit in the bit field.
2226 @return The value read.
2231 MmioBitFieldRead64 (
2238 Writes a bit field to a MMIO register.
2240 Writes Value to the bit field of the MMIO register. The bit field is
2241 specified by the StartBit and the EndBit. All other bits in the destination
2242 MMIO register are preserved. The new value of the 64-bit register is returned.
2244 If 64-bit MMIO register operations are not supported, then ASSERT().
2245 If Address is not aligned on a 64-bit boundary, then ASSERT().
2246 If StartBit is greater than 63, then ASSERT().
2247 If EndBit is greater than 63, then ASSERT().
2248 If EndBit is less than StartBit, then ASSERT().
2250 @param Address MMIO register to write.
2251 @param StartBit The ordinal of the least significant bit in the bit field.
2253 @param EndBit The ordinal of the most significant bit in the bit field.
2255 @param Value New value of the bit field.
2257 @return The value written back to the MMIO register.
2262 MmioBitFieldWrite64 (
2270 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2271 writes the result back to the bit field in the 64-bit MMIO register.
2273 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2274 OR between the read result and the value specified by OrData, and
2275 writes the result to the 64-bit MMIO register specified by Address. The value
2276 written to the MMIO register is returned. This function must guarantee that
2277 all MMIO read and write operations are serialized. Extra left bits in OrData
2280 If 64-bit MMIO register operations are not supported, then ASSERT().
2281 If Address is not aligned on a 64-bit boundary, then ASSERT().
2282 If StartBit is greater than 63, then ASSERT().
2283 If EndBit is greater than 63, then ASSERT().
2284 If EndBit is less than StartBit, then ASSERT().
2286 @param Address MMIO register to write.
2287 @param StartBit The ordinal of the least significant bit in the bit field.
2289 @param EndBit The ordinal of the most significant bit in the bit field.
2291 @param OrData The value to OR with read value from the MMIO register.
2293 @return The value written back to the MMIO register.
2306 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2307 writes the result back to the bit field in the 64-bit MMIO register.
2309 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2310 between the read result and the value specified by AndData, and writes the
2311 result to the 64-bit MMIO register specified by Address. The value written to
2312 the MMIO register is returned. This function must guarantee that all MMIO
2313 read and write operations are serialized. Extra left bits in AndData are
2316 If 64-bit MMIO register operations are not supported, then ASSERT().
2317 If Address is not aligned on a 64-bit boundary, then ASSERT().
2318 If StartBit is greater than 63, then ASSERT().
2319 If EndBit is greater than 63, then ASSERT().
2320 If EndBit is less than StartBit, then ASSERT().
2322 @param Address MMIO register to write.
2323 @param StartBit The ordinal of the least significant bit in the bit field.
2325 @param EndBit The ordinal of the most significant bit in the bit field.
2327 @param AndData The value to AND with read value from the MMIO register.
2329 @return The value written back to the MMIO register.
2342 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2343 by a bitwise OR, and writes the result back to the bit field in the
2344 64-bit MMIO register.
2346 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2347 followed by a bitwise OR between the read result and the value
2348 specified by AndData, and writes the result to the 64-bit MMIO register
2349 specified by Address. The value written to the MMIO register is returned.
2350 This function must guarantee that all MMIO read and write operations are
2351 serialized. Extra left bits in both AndData and OrData are stripped.
2353 If 64-bit MMIO register operations are not supported, then ASSERT().
2354 If Address is not aligned on a 64-bit boundary, then ASSERT().
2355 If StartBit is greater than 63, then ASSERT().
2356 If EndBit is greater than 63, then ASSERT().
2357 If EndBit is less than StartBit, then ASSERT().
2359 @param Address MMIO register to write.
2360 @param StartBit The ordinal of the least significant bit in the bit field.
2362 @param EndBit The ordinal of the most significant bit in the bit field.
2364 @param AndData The value to AND with read value from the MMIO register.
2365 @param OrData The value to OR with the result of the AND operation.
2367 @return The value written back to the MMIO register.
2372 MmioBitFieldAndThenOr64 (
2381 Copy data from MMIO region to system memory by using 8-bit access.
2383 Copy data from MMIO region specified by starting address StartAddress
2384 to system memory specified by Buffer by using 8-bit access. The total
2385 number of byte to be copied is specified by Length. Buffer is returned.
2387 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2388 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2391 @param StartAddress Starting address for the MMIO region to be copied from.
2392 @param Length The size, in bytes, of Buffer.
2393 @param Buffer Pointer to a system memory buffer receiving the data read.
2401 IN UINTN StartAddress
,
2407 Copy data from MMIO region to system memory by using 16-bit access.
2409 Copy data from MMIO region specified by starting address StartAddress
2410 to system memory specified by Buffer by using 16-bit access. The total
2411 number of byte to be copied is specified by Length. Buffer is returned.
2413 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2415 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2416 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2418 If Length is not aligned on a 16-bit boundary, then ASSERT().
2419 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2421 @param StartAddress Starting address for the MMIO region to be copied from.
2422 @param Length The size, in bytes, of Buffer.
2423 @param Buffer Pointer to a system memory buffer receiving the data read.
2431 IN UINTN StartAddress
,
2437 Copy data from MMIO region to system memory by using 32-bit access.
2439 Copy data from MMIO region specified by starting address StartAddress
2440 to system memory specified by Buffer by using 32-bit access. The total
2441 number of byte to be copied is specified by Length. Buffer is returned.
2443 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2445 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2446 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2448 If Length is not aligned on a 32-bit boundary, then ASSERT().
2449 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2451 @param StartAddress Starting address for the MMIO region to be copied from.
2452 @param Length The size, in bytes, of Buffer.
2453 @param Buffer Pointer to a system memory buffer receiving the data read.
2461 IN UINTN StartAddress
,
2467 Copy data from MMIO region to system memory by using 64-bit access.
2469 Copy data from MMIO region specified by starting address StartAddress
2470 to system memory specified by Buffer by using 64-bit access. The total
2471 number of byte to be copied is specified by Length. Buffer is returned.
2473 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2475 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2476 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2478 If Length is not aligned on a 64-bit boundary, then ASSERT().
2479 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2481 @param StartAddress Starting address for the MMIO region to be copied from.
2482 @param Length The size, in bytes, of Buffer.
2483 @param Buffer Pointer to a system memory buffer receiving the data read.
2491 IN UINTN StartAddress
,
2497 Copy data from system memory to MMIO region by using 8-bit access.
2499 Copy data from system memory specified by Buffer to MMIO region specified
2500 by starting address StartAddress by using 8-bit access. The total number
2501 of byte to be copied is specified by Length. Buffer is returned.
2503 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2504 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2507 @param StartAddress Starting address for the MMIO region to be copied to.
2508 @param Length The size, in bytes, of Buffer.
2509 @param Buffer Pointer to a system memory buffer containing the data to write.
2511 @return Size in bytes of the copy.
2517 IN UINTN StartAddress
,
2519 IN CONST UINT8
*Buffer
2523 Copy data from system memory to MMIO region by using 16-bit access.
2525 Copy data from system memory specified by Buffer to MMIO region specified
2526 by starting address StartAddress by using 16-bit access. The total number
2527 of byte to be copied is specified by Length. Length is returned.
2529 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2531 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2532 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2534 If Length is not aligned on a 16-bit boundary, then ASSERT().
2536 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2538 @param StartAddress Starting address for the MMIO region to be copied to.
2539 @param Length The size, in bytes, of Buffer.
2540 @param Buffer Pointer to a system memory buffer containing the data to write.
2542 @return Size in bytes of the copy.
2548 IN UINTN StartAddress
,
2550 IN CONST UINT16
*Buffer
2554 Copy data from system memory to MMIO region by using 32-bit access.
2556 Copy data from system memory specified by Buffer to MMIO region specified
2557 by starting address StartAddress by using 32-bit access. The total number
2558 of byte to be copied is specified by Length. Length is returned.
2560 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2562 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2563 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2565 If Length is not aligned on a 32-bit boundary, then ASSERT().
2567 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2569 @param StartAddress Starting address for the MMIO region to be copied to.
2570 @param Length The size, in bytes, of Buffer.
2571 @param Buffer Pointer to a system memory buffer containing the data to write.
2573 @return Size in bytes of the copy.
2579 IN UINTN StartAddress
,
2581 IN CONST UINT32
*Buffer
2585 Copy data from system memory to MMIO region by using 64-bit access.
2587 Copy data from system memory specified by Buffer to MMIO region specified
2588 by starting address StartAddress by using 64-bit access. The total number
2589 of byte to be copied is specified by Length. Length is returned.
2591 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2593 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2594 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2596 If Length is not aligned on a 64-bit boundary, then ASSERT().
2598 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2600 @param StartAddress Starting address for the MMIO region to be copied to.
2601 @param Length The size, in bytes, of Buffer.
2602 @param Buffer Pointer to a system memory buffer containing the data to write.
2604 @return Size in bytes of the copy.
2610 IN UINTN StartAddress
,
2612 IN CONST UINT64
*Buffer