]>
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 inclusive 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 inclusive 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 inclusive 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. Extra
190 left bits in Value are stripped.
192 If 8-bit I/O port operations are not supported, then ASSERT().
193 If StartBit is greater than 7, then ASSERT().
194 If EndBit is greater than 7, then ASSERT().
195 If EndBit is less than StartBit, then ASSERT().
197 @param Port The I/O port to write.
198 @param StartBit The ordinal of the least significant bit in the bit field.
200 @param EndBit The ordinal of the most significant bit in the bit field.
202 @param Value New value of the bit field.
204 @return The value written back to the I/O port.
217 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
218 result back to the bit field in the 8-bit port.
220 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
221 between the read result and the value specified by OrData, and writes the
222 result to the 8-bit I/O port specified by Port. The value written to the I/O
223 port is returned. This function must guarantee that all I/O read and write
224 operations are serialized. Extra left bits in OrData are stripped.
226 If 8-bit I/O port operations are not supported, then ASSERT().
227 If StartBit is greater than 7, then ASSERT().
228 If EndBit is greater than 7, then ASSERT().
229 If EndBit is less than StartBit, then ASSERT().
231 @param Port The I/O port to write.
232 @param StartBit The ordinal of the least significant bit in the bit field.
234 @param EndBit The ordinal of the most significant bit in the bit field.
236 @param OrData The value to OR with the read value from the I/O port.
238 @return The value written back to the I/O port.
251 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
252 result back to the bit field in the 8-bit port.
254 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
255 the read result and the value specified by AndData, and writes the result to
256 the 8-bit I/O port specified by Port. The value written to the I/O port is
257 returned. This function must guarantee that all I/O read and write operations
258 are serialized. Extra left bits in AndData are stripped.
260 If 8-bit I/O port operations are not supported, then ASSERT().
261 If StartBit is greater than 7, then ASSERT().
262 If EndBit is greater than 7, then ASSERT().
263 If EndBit is less than StartBit, then ASSERT().
265 @param Port The I/O port to write.
266 @param StartBit The ordinal of the least significant bit in the bit field.
268 @param EndBit The ordinal of the most significant bit in the bit field.
270 @param AndData The value to AND with the read value from the I/O port.
272 @return The value written back to the I/O port.
285 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
286 bitwise inclusive OR, and writes the result back to the bit field in the
289 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
290 by a bitwise inclusive OR between the read result and the value specified by
291 AndData, and writes the result to the 8-bit I/O port specified by Port. The
292 value written to the I/O port is returned. This function must guarantee that
293 all I/O read and write operations are serialized. Extra left bits in both
294 AndData and OrData are stripped.
296 If 8-bit I/O port operations are not supported, then ASSERT().
297 If StartBit is greater than 7, then ASSERT().
298 If EndBit is greater than 7, then ASSERT().
299 If EndBit is less than StartBit, then ASSERT().
301 @param Port The I/O port to write.
302 @param StartBit The ordinal of the least significant bit in the bit field.
304 @param EndBit The ordinal of the most significant bit in the bit field.
306 @param AndData The value to AND with the read value from the I/O port.
307 @param OrData The value to OR with the result of the AND operation.
309 @return The value written back to the I/O port.
314 IoBitFieldAndThenOr8 (
323 Reads a 16-bit I/O port.
325 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
326 This function must guarantee that all I/O read and write operations are
329 If 16-bit I/O port operations are not supported, then ASSERT().
330 If Port is not aligned on a 16-bit boundary, then ASSERT().
332 @param Port The I/O port to read.
334 @return The value read.
344 Writes a 16-bit I/O port.
346 Writes the 16-bit I/O port specified by Port with the value specified by Value
347 and returns Value. This function must guarantee that all I/O read and write
348 operations are serialized.
350 If 16-bit I/O port operations are not supported, then ASSERT().
351 If Port is not aligned on a 16-bit boundary, then ASSERT().
353 @param Port The I/O port to write.
354 @param Value The value to write to the I/O port.
356 @return The value written the I/O port.
367 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
368 result back to the 16-bit I/O port.
370 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
371 between the read result and the value specified by OrData, and writes the
372 result to the 16-bit I/O port specified by Port. The value written to the I/O
373 port is returned. This function must guarantee that all I/O read and write
374 operations are serialized.
376 If 16-bit I/O port operations are not supported, then ASSERT().
377 If Port is not aligned on a 16-bit boundary, then ASSERT().
379 @param Port The I/O port to write.
380 @param OrData The value to OR with the read value from the I/O port.
382 @return The value written back to the I/O port.
393 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
394 to the 16-bit I/O port.
396 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
397 the read result and the value specified by AndData, and writes the result to
398 the 16-bit I/O port specified by Port. The value written to the I/O port is
399 returned. This function must guarantee that all I/O read and write operations
402 If 16-bit I/O port operations are not supported, then ASSERT().
403 If Port is not aligned on a 16-bit boundary, then ASSERT().
405 @param Port The I/O port to write.
406 @param AndData The value to AND with the read value from the I/O port.
408 @return The value written back to the I/O port.
419 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
420 inclusive OR, and writes the result back to the 16-bit I/O port.
422 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
423 the read result and the value specified by AndData, performs a bitwise OR
424 between the result of the AND operation and the value specified by OrData,
425 and writes the result to the 16-bit I/O port specified by Port. The value
426 written to the I/O port is returned. This function must guarantee that all
427 I/O read and write operations are serialized.
429 If 16-bit I/O port operations are not supported, then ASSERT().
430 If Port is not aligned on a 16-bit boundary, then ASSERT().
432 @param Port The I/O port to write.
433 @param AndData The value to AND with the read value from the I/O port.
434 @param OrData The value to OR with the result of the AND operation.
436 @return The value written back to the I/O port.
448 Reads a bit field of an I/O register.
450 Reads the bit field in a 16-bit I/O register. The bit field is specified by
451 the StartBit and the EndBit. The value of the bit field is returned.
453 If 16-bit I/O port operations are not supported, then ASSERT().
454 If Port is not aligned on a 16-bit boundary, then ASSERT().
455 If StartBit is greater than 15, then ASSERT().
456 If EndBit is greater than 15, then ASSERT().
457 If EndBit is less than StartBit, then ASSERT().
459 @param Port The I/O port to read.
460 @param StartBit The ordinal of the least significant bit in the bit field.
462 @param EndBit The ordinal of the most significant bit in the bit field.
465 @return The value read.
477 Writes a bit field to an I/O register.
479 Writes Value to the bit field of the I/O register. The bit field is specified
480 by the StartBit and the EndBit. All other bits in the destination I/O
481 register are preserved. The value written to the I/O port is returned. Extra
482 left bits in Value are stripped.
484 If 16-bit I/O port operations are not supported, then ASSERT().
485 If Port is not aligned on a 16-bit boundary, then ASSERT().
486 If StartBit is greater than 15, then ASSERT().
487 If EndBit is greater than 15, then ASSERT().
488 If EndBit is less than StartBit, then ASSERT().
490 @param Port The I/O port to write.
491 @param StartBit The ordinal of the least significant bit in the bit field.
493 @param EndBit The ordinal of the most significant bit in the bit field.
495 @param Value New value of the bit field.
497 @return The value written back to the I/O port.
510 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
511 result back to the bit field in the 16-bit port.
513 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
514 between the read result and the value specified by OrData, and writes the
515 result to the 16-bit I/O port specified by Port. The value written to the I/O
516 port is returned. This function must guarantee that all I/O read and write
517 operations are serialized. Extra left bits in OrData are stripped.
519 If 16-bit I/O port operations are not supported, then ASSERT().
520 If Port is not aligned on a 16-bit boundary, then ASSERT().
521 If StartBit is greater than 15, then ASSERT().
522 If EndBit is greater than 15, then ASSERT().
523 If EndBit is less than StartBit, then ASSERT().
525 @param Port The I/O port to write.
526 @param StartBit The ordinal of the least significant bit in the bit field.
528 @param EndBit The ordinal of the most significant bit in the bit field.
530 @param OrData The value to OR with the read value from the I/O port.
532 @return The value written back to the I/O port.
545 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
546 result back to the bit field in the 16-bit port.
548 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
549 the read result and the value specified by AndData, and writes the result to
550 the 16-bit I/O port specified by Port. The value written to the I/O port is
551 returned. This function must guarantee that all I/O read and write operations
552 are serialized. Extra left bits in AndData are stripped.
554 If 16-bit I/O port operations are not supported, then ASSERT().
555 If Port is not aligned on a 16-bit boundary, then ASSERT().
556 If StartBit is greater than 15, then ASSERT().
557 If EndBit is greater than 15, then ASSERT().
558 If EndBit is less than StartBit, then ASSERT().
560 @param Port The I/O port to write.
561 @param StartBit The ordinal of the least significant bit in the bit field.
563 @param EndBit The ordinal of the most significant bit in the bit field.
565 @param AndData The value to AND with the read value from the I/O port.
567 @return The value written back to the I/O port.
580 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
581 bitwise inclusive OR, and writes the result back to the bit field in the
584 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
585 by a bitwise inclusive OR between the read result and the value specified by
586 AndData, and writes the result to the 16-bit I/O port specified by Port. The
587 value written to the I/O port is returned. This function must guarantee that
588 all I/O read and write operations are serialized. Extra left bits in both
589 AndData and OrData are stripped.
591 If 16-bit I/O port operations are not supported, then ASSERT().
592 If Port is not aligned on a 16-bit boundary, then ASSERT().
593 If StartBit is greater than 15, then ASSERT().
594 If EndBit is greater than 15, then ASSERT().
595 If EndBit is less than StartBit, then ASSERT().
597 @param Port The I/O port to write.
598 @param StartBit The ordinal of the least significant bit in the bit field.
600 @param EndBit The ordinal of the most significant bit in the bit field.
602 @param AndData The value to AND with the read value from the I/O port.
603 @param OrData The value to OR with the result of the AND operation.
605 @return The value written back to the I/O port.
610 IoBitFieldAndThenOr16 (
619 Reads a 32-bit I/O port.
621 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
622 This function must guarantee that all I/O read and write operations are
625 If 32-bit I/O port operations are not supported, then ASSERT().
626 If Port is not aligned on a 32-bit boundary, then ASSERT().
628 @param Port The I/O port to read.
630 @return The value read.
640 Writes a 32-bit I/O port.
642 Writes the 32-bit I/O port specified by Port with the value specified by Value
643 and returns Value. This function must guarantee that all I/O read and write
644 operations are serialized.
646 If 32-bit I/O port operations are not supported, then ASSERT().
647 If Port is not aligned on a 32-bit boundary, then ASSERT().
649 @param Port The I/O port to write.
650 @param Value The value to write to the I/O port.
652 @return The value written the I/O port.
663 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
664 result back to the 32-bit I/O port.
666 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
667 between the read result and the value specified by OrData, and writes the
668 result to the 32-bit I/O port specified by Port. The value written to the I/O
669 port is returned. This function must guarantee that all I/O read and write
670 operations are serialized.
672 If 32-bit I/O port operations are not supported, then ASSERT().
673 If Port is not aligned on a 32-bit boundary, then ASSERT().
675 @param Port The I/O port to write.
676 @param OrData The value to OR with the read value from the I/O port.
678 @return The value written back to the I/O port.
689 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
690 to the 32-bit I/O port.
692 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
693 the read result and the value specified by AndData, and writes the result to
694 the 32-bit I/O port specified by Port. The value written to the I/O port is
695 returned. This function must guarantee that all I/O read and write operations
698 If 32-bit I/O port operations are not supported, then ASSERT().
699 If Port is not aligned on a 32-bit boundary, then ASSERT().
701 @param Port The I/O port to write.
702 @param AndData The value to AND with the read value from the I/O port.
704 @return The value written back to the I/O port.
715 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
716 inclusive OR, and writes the result back to the 32-bit I/O port.
718 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
719 the read result and the value specified by AndData, performs a bitwise OR
720 between the result of the AND operation and the value specified by OrData,
721 and writes the result to the 32-bit I/O port specified by Port. The value
722 written to the I/O port is returned. This function must guarantee that all
723 I/O read and write operations are serialized.
725 If 32-bit I/O port operations are not supported, then ASSERT().
726 If Port is not aligned on a 32-bit boundary, then ASSERT().
728 @param Port The I/O port to write.
729 @param AndData The value to AND with the read value from the I/O port.
730 @param OrData The value to OR with the result of the AND operation.
732 @return The value written back to the I/O port.
744 Reads a bit field of an I/O register.
746 Reads the bit field in a 32-bit I/O register. The bit field is specified by
747 the StartBit and the EndBit. The value of the bit field is returned.
749 If 32-bit I/O port operations are not supported, then ASSERT().
750 If Port is not aligned on a 32-bit boundary, then ASSERT().
751 If StartBit is greater than 31, then ASSERT().
752 If EndBit is greater than 31, then ASSERT().
753 If EndBit is less than StartBit, then ASSERT().
755 @param Port The I/O port to read.
756 @param StartBit The ordinal of the least significant bit in the bit field.
758 @param EndBit The ordinal of the most significant bit in the bit field.
761 @return The value read.
773 Writes a bit field to an I/O register.
775 Writes Value to the bit field of the I/O register. The bit field is specified
776 by the StartBit and the EndBit. All other bits in the destination I/O
777 register are preserved. The value written to the I/O port is returned. Extra
778 left bits in Value are stripped.
780 If 32-bit I/O port operations are not supported, then ASSERT().
781 If Port is not aligned on a 32-bit boundary, then ASSERT().
782 If StartBit is greater than 31, then ASSERT().
783 If EndBit is greater than 31, then ASSERT().
784 If EndBit is less than StartBit, then ASSERT().
786 @param Port The I/O port to write.
787 @param StartBit The ordinal of the least significant bit in the bit field.
789 @param EndBit The ordinal of the most significant bit in the bit field.
791 @param Value New value of the bit field.
793 @return The value written back to the I/O port.
806 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
807 result back to the bit field in the 32-bit port.
809 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
810 between the read result and the value specified by OrData, and writes the
811 result to the 32-bit I/O port specified by Port. The value written to the I/O
812 port is returned. This function must guarantee that all I/O read and write
813 operations are serialized. Extra left bits in OrData are stripped.
815 If 32-bit I/O port operations are not supported, then ASSERT().
816 If Port is not aligned on a 32-bit boundary, then ASSERT().
817 If StartBit is greater than 31, then ASSERT().
818 If EndBit is greater than 31, then ASSERT().
819 If EndBit is less than StartBit, then ASSERT().
821 @param Port The I/O port to write.
822 @param StartBit The ordinal of the least significant bit in the bit field.
824 @param EndBit The ordinal of the most significant bit in the bit field.
826 @param OrData The value to OR with the read value from the I/O port.
828 @return The value written back to the I/O port.
841 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
842 result back to the bit field in the 32-bit port.
844 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
845 the read result and the value specified by AndData, and writes the result to
846 the 32-bit I/O port specified by Port. The value written to the I/O port is
847 returned. This function must guarantee that all I/O read and write operations
848 are serialized. Extra left bits in AndData are stripped.
850 If 32-bit I/O port operations are not supported, then ASSERT().
851 If Port is not aligned on a 32-bit boundary, then ASSERT().
852 If StartBit is greater than 31, then ASSERT().
853 If EndBit is greater than 31, then ASSERT().
854 If EndBit is less than StartBit, then ASSERT().
856 @param Port The I/O port to write.
857 @param StartBit The ordinal of the least significant bit in the bit field.
859 @param EndBit The ordinal of the most significant bit in the bit field.
861 @param AndData The value to AND with the read value from the I/O port.
863 @return The value written back to the I/O port.
876 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
877 bitwise inclusive OR, and writes the result back to the bit field in the
880 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
881 by a bitwise inclusive OR between the read result and the value specified by
882 AndData, and writes the result to the 32-bit I/O port specified by Port. The
883 value written to the I/O port is returned. This function must guarantee that
884 all I/O read and write operations are serialized. Extra left bits in both
885 AndData and OrData are stripped.
887 If 32-bit I/O port operations are not supported, then ASSERT().
888 If Port is not aligned on a 32-bit boundary, then ASSERT().
889 If StartBit is greater than 31, then ASSERT().
890 If EndBit is greater than 31, then ASSERT().
891 If EndBit is less than StartBit, then ASSERT().
893 @param Port The I/O port to write.
894 @param StartBit The ordinal of the least significant bit in the bit field.
896 @param EndBit The ordinal of the most significant bit in the bit field.
898 @param AndData The value to AND with the read value from the I/O port.
899 @param OrData The value to OR with the result of the AND operation.
901 @return The value written back to the I/O port.
906 IoBitFieldAndThenOr32 (
915 Reads a 64-bit I/O port.
917 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
918 This function must guarantee that all I/O read and write operations are
921 If 64-bit I/O port operations are not supported, then ASSERT().
922 If Port is not aligned on a 64-bit boundary, then ASSERT().
924 @param Port The I/O port to read.
926 @return The value read.
936 Writes a 64-bit I/O port.
938 Writes the 64-bit I/O port specified by Port with the value specified by Value
939 and returns Value. This function must guarantee that all I/O read and write
940 operations are serialized.
942 If 64-bit I/O port operations are not supported, then ASSERT().
943 If Port is not aligned on a 64-bit boundary, then ASSERT().
945 @param Port The I/O port to write.
946 @param Value The value to write to the I/O port.
948 @return The value written the I/O port.
959 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
960 result back to the 64-bit I/O port.
962 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
963 between the read result and the value specified by OrData, and writes the
964 result to the 64-bit I/O port specified by Port. The value written to the I/O
965 port is returned. This function must guarantee that all I/O read and write
966 operations are serialized.
968 If 64-bit I/O port operations are not supported, then ASSERT().
969 If Port is not aligned on a 64-bit boundary, then ASSERT().
971 @param Port The I/O port to write.
972 @param OrData The value to OR with the read value from the I/O port.
974 @return The value written back to the I/O port.
985 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
986 to the 64-bit I/O port.
988 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
989 the read result and the value specified by AndData, and writes the result to
990 the 64-bit I/O port specified by Port. The value written to the I/O port is
991 returned. This function must guarantee that all I/O read and write operations
994 If 64-bit I/O port operations are not supported, then ASSERT().
995 If Port is not aligned on a 64-bit boundary, then ASSERT().
997 @param Port The I/O port to write.
998 @param AndData The value to AND with the read value from the I/O port.
1000 @return The value written back to the I/O port.
1011 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
1012 inclusive OR, and writes the result back to the 64-bit I/O port.
1014 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1015 the read result and the value specified by AndData, performs a bitwise OR
1016 between the result of the AND operation and the value specified by OrData,
1017 and writes the result to the 64-bit I/O port specified by Port. The value
1018 written to the I/O port is returned. This function must guarantee that all
1019 I/O read and write operations are serialized.
1021 If 64-bit I/O port operations are not supported, then ASSERT().
1022 If Port is not aligned on a 64-bit boundary, then ASSERT().
1024 @param Port The I/O port to write.
1025 @param AndData The value to AND with the read value from the I/O port.
1026 @param OrData The value to OR with the result of the AND operation.
1028 @return The value written back to the I/O port.
1040 Reads a bit field of an I/O register.
1042 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1043 the StartBit and the EndBit. The value of the bit field is returned.
1045 If 64-bit I/O port operations are not supported, then ASSERT().
1046 If Port is not aligned on a 64-bit boundary, then ASSERT().
1047 If StartBit is greater than 63, then ASSERT().
1048 If EndBit is greater than 63, then ASSERT().
1049 If EndBit is less than StartBit, then ASSERT().
1051 @param Port The I/O port to read.
1052 @param StartBit The ordinal of the least significant bit in the bit field.
1054 @param EndBit The ordinal of the most significant bit in the bit field.
1057 @return The value read.
1069 Writes a bit field to an I/O register.
1071 Writes Value to the bit field of the I/O register. The bit field is specified
1072 by the StartBit and the EndBit. All other bits in the destination I/O
1073 register are preserved. The value written to the I/O port is returned. Extra
1074 left bits in Value are stripped.
1076 If 64-bit I/O port operations are not supported, then ASSERT().
1077 If Port is not aligned on a 64-bit boundary, then ASSERT().
1078 If StartBit is greater than 63, then ASSERT().
1079 If EndBit is greater than 63, then ASSERT().
1080 If EndBit is less than StartBit, then ASSERT().
1082 @param Port The I/O port to write.
1083 @param StartBit The ordinal of the least significant bit in the bit field.
1085 @param EndBit The ordinal of the most significant bit in the bit field.
1087 @param Value New value of the bit field.
1089 @return The value written back to the I/O port.
1102 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1103 result back to the bit field in the 64-bit port.
1105 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1106 between the read result and the value specified by OrData, and writes the
1107 result to the 64-bit I/O port specified by Port. The value written to the I/O
1108 port is returned. This function must guarantee that all I/O read and write
1109 operations are serialized. Extra left bits in OrData are stripped.
1111 If 64-bit I/O port operations are not supported, then ASSERT().
1112 If Port is not aligned on a 64-bit boundary, then ASSERT().
1113 If StartBit is greater than 63, then ASSERT().
1114 If EndBit is greater than 63, then ASSERT().
1115 If EndBit is less than StartBit, then ASSERT().
1117 @param Port The I/O port to write.
1118 @param StartBit The ordinal of the least significant bit in the bit field.
1120 @param EndBit The ordinal of the most significant bit in the bit field.
1122 @param OrData The value to OR with the read value from the I/O port.
1124 @return The value written back to the I/O port.
1137 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1138 result back to the bit field in the 64-bit port.
1140 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1141 the read result and the value specified by AndData, and writes the result to
1142 the 64-bit I/O port specified by Port. The value written to the I/O port is
1143 returned. This function must guarantee that all I/O read and write operations
1144 are serialized. Extra left bits in AndData are stripped.
1146 If 64-bit I/O port operations are not supported, then ASSERT().
1147 If Port is not aligned on a 64-bit boundary, then ASSERT().
1148 If StartBit is greater than 63, then ASSERT().
1149 If EndBit is greater than 63, then ASSERT().
1150 If EndBit is less than StartBit, then ASSERT().
1152 @param Port The I/O port to write.
1153 @param StartBit The ordinal of the least significant bit in the bit field.
1155 @param EndBit The ordinal of the most significant bit in the bit field.
1157 @param AndData The value to AND with the read value from the I/O port.
1159 @return The value written back to the I/O port.
1172 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1173 bitwise inclusive OR, and writes the result back to the bit field in the
1176 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1177 by a bitwise inclusive OR between the read result and the value specified by
1178 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1179 value written to the I/O port is returned. This function must guarantee that
1180 all I/O read and write operations are serialized. Extra left bits in both
1181 AndData and OrData are stripped.
1183 If 64-bit I/O port operations are not supported, then ASSERT().
1184 If Port is not aligned on a 64-bit boundary, then ASSERT().
1185 If StartBit is greater than 63, then ASSERT().
1186 If EndBit is greater than 63, then ASSERT().
1187 If EndBit is less than StartBit, then ASSERT().
1189 @param Port The I/O port to write.
1190 @param StartBit The ordinal of the least significant bit in the bit field.
1192 @param EndBit The ordinal of the most significant bit in the bit field.
1194 @param AndData The value to AND with the read value from the I/O port.
1195 @param OrData The value to OR with the result of the AND operation.
1197 @return The value written back to the I/O port.
1202 IoBitFieldAndThenOr64 (
1211 Reads an 8-bit MMIO register.
1213 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1214 returned. This function must guarantee that all MMIO read and write
1215 operations are serialized.
1217 If 8-bit MMIO register operations are not supported, then ASSERT().
1219 @param Address The MMIO register to read.
1221 @return The value read.
1231 Writes an 8-bit MMIO register.
1233 Writes the 8-bit MMIO register specified by Address with the value specified
1234 by Value and returns Value. This function must guarantee that all MMIO read
1235 and write operations are serialized.
1237 If 8-bit MMIO register operations are not supported, then ASSERT().
1239 @param Address The MMIO register to write.
1240 @param Value The value to write to the MMIO register.
1251 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1252 result back to the 8-bit MMIO register.
1254 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1255 inclusive OR between the read result and the value specified by OrData, and
1256 writes the result to the 8-bit MMIO register specified by Address. The value
1257 written to the MMIO register is returned. This function must guarantee that
1258 all MMIO read and write operations are serialized.
1260 If 8-bit MMIO register operations are not supported, then ASSERT().
1262 @param Address The MMIO register to write.
1263 @param OrData The value to OR with the read value from the MMIO register.
1265 @return The value written back to the MMIO register.
1276 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1277 back to the 8-bit MMIO register.
1279 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1280 between the read result and the value specified by AndData, and writes the
1281 result to the 8-bit MMIO register specified by Address. The value written to
1282 the MMIO register is returned. This function must guarantee that all MMIO
1283 read and write operations are serialized.
1285 If 8-bit MMIO register operations are not supported, then ASSERT().
1287 @param Address The MMIO register to write.
1288 @param AndData The value to AND with the read value from the MMIO register.
1290 @return The value written back to the MMIO register.
1301 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1302 inclusive OR, and writes the result back to the 8-bit MMIO register.
1304 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1305 between the read result and the value specified by AndData, performs a
1306 bitwise OR between the result of the AND operation and the value specified by
1307 OrData, and writes the result to the 8-bit MMIO register specified by
1308 Address. The value written to the MMIO register is returned. This function
1309 must guarantee that all MMIO read and write operations are serialized.
1311 If 8-bit MMIO register operations are not supported, then ASSERT().
1314 @param Address The MMIO register to write.
1315 @param AndData The value to AND with the read value from the MMIO register.
1316 @param OrData The value to OR with the result of the AND operation.
1318 @return The value written back to the MMIO register.
1330 Reads a bit field of a MMIO register.
1332 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1333 the StartBit and the EndBit. The value of the bit field is returned.
1335 If 8-bit MMIO register operations are not supported, then ASSERT().
1336 If StartBit is greater than 7, then ASSERT().
1337 If EndBit is greater than 7, then ASSERT().
1338 If EndBit is less than StartBit, then ASSERT().
1340 @param Address MMIO register to read.
1341 @param StartBit The ordinal of the least significant bit in the bit field.
1343 @param EndBit The ordinal of the most significant bit in the bit field.
1346 @return The value read.
1358 Writes a bit field to a MMIO register.
1360 Writes Value to the bit field of the MMIO register. The bit field is
1361 specified by the StartBit and the EndBit. All other bits in the destination
1362 MMIO register are preserved. The new value of the 8-bit register is returned.
1364 If 8-bit MMIO register operations are not supported, then ASSERT().
1365 If StartBit is greater than 7, then ASSERT().
1366 If EndBit is greater than 7, then ASSERT().
1367 If EndBit is less than StartBit, then ASSERT().
1369 @param Address MMIO register to write.
1370 @param StartBit The ordinal of the least significant bit in the bit field.
1372 @param EndBit The ordinal of the most significant bit in the bit field.
1374 @param Value New value of the bit field.
1376 @return The value written back to the MMIO register.
1381 MmioBitFieldWrite8 (
1389 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1390 writes the result back to the bit field in the 8-bit MMIO register.
1392 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1393 inclusive OR between the read result and the value specified by OrData, and
1394 writes the result to the 8-bit MMIO register specified by Address. The value
1395 written to the MMIO register is returned. This function must guarantee that
1396 all MMIO read and write operations are serialized. Extra left bits in OrData
1399 If 8-bit MMIO register operations are not supported, then ASSERT().
1400 If StartBit is greater than 7, then ASSERT().
1401 If EndBit is greater than 7, then ASSERT().
1402 If EndBit is less than StartBit, then ASSERT().
1404 @param Address MMIO register to write.
1405 @param StartBit The ordinal of the least significant bit in the bit field.
1407 @param EndBit The ordinal of the most significant bit in the bit field.
1409 @param OrData The value to OR with read value from the MMIO register.
1411 @return The value written back to the MMIO register.
1424 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1425 writes the result back to the bit field in the 8-bit MMIO register.
1427 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1428 between the read result and the value specified by AndData, and writes the
1429 result to the 8-bit MMIO register specified by Address. The value written to
1430 the MMIO register is returned. This function must guarantee that all MMIO
1431 read and write operations are serialized. Extra left bits in AndData are
1434 If 8-bit MMIO register operations are not supported, then ASSERT().
1435 If StartBit is greater than 7, then ASSERT().
1436 If EndBit is greater than 7, then ASSERT().
1437 If EndBit is less than StartBit, then ASSERT().
1439 @param Address MMIO register to write.
1440 @param StartBit The ordinal of the least significant bit in the bit field.
1442 @param EndBit The ordinal of the most significant bit in the bit field.
1444 @param AndData The value to AND with read value from the MMIO register.
1446 @return The value written back to the MMIO register.
1459 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1460 by a bitwise inclusive OR, and writes the result back to the bit field in the
1461 8-bit MMIO register.
1463 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1464 followed by a bitwise inclusive OR between the read result and the value
1465 specified by AndData, and writes the result to the 8-bit MMIO register
1466 specified by Address. The value written to the MMIO register is returned.
1467 This function must guarantee that all MMIO read and write operations are
1468 serialized. Extra left bits in both AndData and OrData are stripped.
1470 If 8-bit MMIO register operations are not supported, then ASSERT().
1471 If StartBit is greater than 7, then ASSERT().
1472 If EndBit is greater than 7, then ASSERT().
1473 If EndBit is less than StartBit, then ASSERT().
1475 @param Address MMIO register to write.
1476 @param StartBit The ordinal of the least significant bit in the bit field.
1478 @param EndBit The ordinal of the most significant bit in the bit field.
1480 @param AndData The value to AND with read value from the MMIO register.
1481 @param OrData The value to OR with the result of the AND operation.
1483 @return The value written back to the MMIO register.
1488 MmioBitFieldAndThenOr8 (
1497 Reads a 16-bit MMIO register.
1499 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1500 returned. This function must guarantee that all MMIO read and write
1501 operations are serialized.
1503 If 16-bit MMIO register operations are not supported, then ASSERT().
1504 If Address is not aligned on a 16-bit boundary, then ASSERT().
1506 @param Address The MMIO register to read.
1508 @return The value read.
1518 Writes a 16-bit MMIO register.
1520 Writes the 16-bit MMIO register specified by Address with the value specified
1521 by Value and returns Value. This function must guarantee that all MMIO read
1522 and write operations are serialized.
1524 If 16-bit MMIO register operations are not supported, then ASSERT().
1525 If Address is not aligned on a 16-bit boundary, then ASSERT().
1527 @param Address The MMIO register to write.
1528 @param Value The value to write to the MMIO register.
1539 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1540 result back to the 16-bit MMIO register.
1542 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1543 inclusive OR between the read result and the value specified by OrData, and
1544 writes the result to the 16-bit MMIO register specified by Address. The value
1545 written to the MMIO register is returned. This function must guarantee that
1546 all MMIO read and write operations are serialized.
1548 If 16-bit MMIO register operations are not supported, then ASSERT().
1549 If Address is not aligned on a 16-bit boundary, then ASSERT().
1551 @param Address The MMIO register to write.
1552 @param OrData The value to OR with the read value from the MMIO register.
1554 @return The value written back to the MMIO register.
1565 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1566 back to the 16-bit MMIO register.
1568 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1569 between the read result and the value specified by AndData, and writes the
1570 result to the 16-bit MMIO register specified by Address. The value written to
1571 the MMIO register is returned. This function must guarantee that all MMIO
1572 read and write operations are serialized.
1574 If 16-bit MMIO register operations are not supported, then ASSERT().
1575 If Address is not aligned on a 16-bit boundary, then ASSERT().
1577 @param Address The MMIO register to write.
1578 @param AndData The value to AND with the read value from the MMIO register.
1580 @return The value written back to the MMIO register.
1591 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1592 inclusive OR, and writes the result back to the 16-bit MMIO register.
1594 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1595 between the read result and the value specified by AndData, performs a
1596 bitwise OR between the result of the AND operation and the value specified by
1597 OrData, and writes the result to the 16-bit MMIO register specified by
1598 Address. The value written to the MMIO register is returned. This function
1599 must guarantee that all MMIO read and write operations are serialized.
1601 If 16-bit MMIO register operations are not supported, then ASSERT().
1602 If Address is not aligned on a 16-bit boundary, then ASSERT().
1604 @param Address The MMIO register to write.
1605 @param AndData The value to AND with the read value from the MMIO register.
1606 @param OrData The value to OR with the result of the AND operation.
1608 @return The value written back to the MMIO register.
1620 Reads a bit field of a MMIO register.
1622 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1623 the StartBit and the EndBit. The value of the bit field is returned.
1625 If 16-bit MMIO register operations are not supported, then ASSERT().
1626 If Address is not aligned on a 16-bit boundary, then ASSERT().
1627 If StartBit is greater than 15, then ASSERT().
1628 If EndBit is greater than 15, then ASSERT().
1629 If EndBit is less than StartBit, then ASSERT().
1631 @param Address MMIO register to read.
1632 @param StartBit The ordinal of the least significant bit in the bit field.
1634 @param EndBit The ordinal of the most significant bit in the bit field.
1637 @return The value read.
1642 MmioBitFieldRead16 (
1649 Writes a bit field to a MMIO register.
1651 Writes Value to the bit field of the MMIO register. The bit field is
1652 specified by the StartBit and the EndBit. All other bits in the destination
1653 MMIO register are preserved. The new value of the 16-bit register is returned.
1655 If 16-bit MMIO register operations are not supported, then ASSERT().
1656 If Address is not aligned on a 16-bit boundary, then ASSERT().
1657 If StartBit is greater than 15, then ASSERT().
1658 If EndBit is greater than 15, then ASSERT().
1659 If EndBit is less than StartBit, then ASSERT().
1661 @param Address MMIO register to write.
1662 @param StartBit The ordinal of the least significant bit in the bit field.
1664 @param EndBit The ordinal of the most significant bit in the bit field.
1666 @param Value New value of the bit field.
1668 @return The value written back to the MMIO register.
1673 MmioBitFieldWrite16 (
1681 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1682 writes the result back to the bit field in the 16-bit MMIO register.
1684 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1685 inclusive OR between the read result and the value specified by OrData, and
1686 writes the result to the 16-bit MMIO register specified by Address. The value
1687 written to the MMIO register is returned. This function must guarantee that
1688 all MMIO read and write operations are serialized. Extra left bits in OrData
1691 If 16-bit MMIO register operations are not supported, then ASSERT().
1692 If Address is not aligned on a 16-bit boundary, then ASSERT().
1693 If StartBit is greater than 15, then ASSERT().
1694 If EndBit is greater than 15, then ASSERT().
1695 If EndBit is less than StartBit, then ASSERT().
1697 @param Address MMIO register to write.
1698 @param StartBit The ordinal of the least significant bit in the bit field.
1700 @param EndBit The ordinal of the most significant bit in the bit field.
1702 @param OrData The value to OR with read value from the MMIO register.
1704 @return The value written back to the MMIO register.
1717 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1718 writes the result back to the bit field in the 16-bit MMIO register.
1720 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1721 between the read result and the value specified by AndData, and writes the
1722 result to the 16-bit MMIO register specified by Address. The value written to
1723 the MMIO register is returned. This function must guarantee that all MMIO
1724 read and write operations are serialized. Extra left bits in AndData are
1727 If 16-bit MMIO register operations are not supported, then ASSERT().
1728 If Address is not aligned on a 16-bit boundary, then ASSERT().
1729 If StartBit is greater than 15, then ASSERT().
1730 If EndBit is greater than 15, then ASSERT().
1731 If EndBit is less than StartBit, then ASSERT().
1733 @param Address MMIO register to write.
1734 @param StartBit The ordinal of the least significant bit in the bit field.
1736 @param EndBit The ordinal of the most significant bit in the bit field.
1738 @param AndData The value to AND with read value from the MMIO register.
1740 @return The value written back to the MMIO register.
1753 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1754 by a bitwise inclusive OR, and writes the result back to the bit field in the
1755 16-bit MMIO register.
1757 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1758 followed by a bitwise inclusive OR between the read result and the value
1759 specified by AndData, and writes the result to the 16-bit MMIO register
1760 specified by Address. The value written to the MMIO register is returned.
1761 This function must guarantee that all MMIO read and write operations are
1762 serialized. Extra left bits in both AndData and OrData are stripped.
1764 If 16-bit MMIO register operations are not supported, then ASSERT().
1765 If Address is not aligned on a 16-bit boundary, then ASSERT().
1766 If StartBit is greater than 15, then ASSERT().
1767 If EndBit is greater than 15, then ASSERT().
1768 If EndBit is less than StartBit, then ASSERT().
1770 @param Address MMIO register to write.
1771 @param StartBit The ordinal of the least significant bit in the bit field.
1773 @param EndBit The ordinal of the most significant bit in the bit field.
1775 @param AndData The value to AND with read value from the MMIO register.
1776 @param OrData The value to OR with the result of the AND operation.
1778 @return The value written back to the MMIO register.
1783 MmioBitFieldAndThenOr16 (
1792 Reads a 32-bit MMIO register.
1794 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1795 returned. This function must guarantee that all MMIO read and write
1796 operations are serialized.
1798 If 32-bit MMIO register operations are not supported, then ASSERT().
1799 If Address is not aligned on a 32-bit boundary, then ASSERT().
1801 @param Address The MMIO register to read.
1803 @return The value read.
1813 Writes a 32-bit MMIO register.
1815 Writes the 32-bit MMIO register specified by Address with the value specified
1816 by Value and returns Value. This function must guarantee that all MMIO read
1817 and write operations are serialized.
1819 If 32-bit MMIO register operations are not supported, then ASSERT().
1820 If Address is not aligned on a 32-bit boundary, then ASSERT().
1822 @param Address The MMIO register to write.
1823 @param Value The value to write to the MMIO register.
1834 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1835 result back to the 32-bit MMIO register.
1837 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1838 inclusive OR between the read result and the value specified by OrData, and
1839 writes the result to the 32-bit MMIO register specified by Address. The value
1840 written to the MMIO register is returned. This function must guarantee that
1841 all MMIO read and write operations are serialized.
1843 If 32-bit MMIO register operations are not supported, then ASSERT().
1844 If Address is not aligned on a 32-bit boundary, then ASSERT().
1846 @param Address The MMIO register to write.
1847 @param OrData The value to OR with the read value from the MMIO register.
1849 @return The value written back to the MMIO register.
1860 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1861 back to the 32-bit MMIO register.
1863 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1864 between the read result and the value specified by AndData, and writes the
1865 result to the 32-bit MMIO register specified by Address. The value written to
1866 the MMIO register is returned. This function must guarantee that all MMIO
1867 read and write operations are serialized.
1869 If 32-bit MMIO register operations are not supported, then ASSERT().
1870 If Address is not aligned on a 32-bit boundary, then ASSERT().
1872 @param Address The MMIO register to write.
1873 @param AndData The value to AND with the read value from the MMIO register.
1875 @return The value written back to the MMIO register.
1886 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1887 inclusive OR, and writes the result back to the 32-bit MMIO register.
1889 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1890 between the read result and the value specified by AndData, performs a
1891 bitwise OR between the result of the AND operation and the value specified by
1892 OrData, and writes the result to the 32-bit MMIO register specified by
1893 Address. The value written to the MMIO register is returned. This function
1894 must guarantee that all MMIO read and write operations are serialized.
1896 If 32-bit MMIO register operations are not supported, then ASSERT().
1897 If Address is not aligned on a 32-bit boundary, then ASSERT().
1899 @param Address The MMIO register to write.
1900 @param AndData The value to AND with the read value from the MMIO register.
1901 @param OrData The value to OR with the result of the AND operation.
1903 @return The value written back to the MMIO register.
1915 Reads a bit field of a MMIO register.
1917 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1918 the StartBit and the EndBit. The value of the bit field is returned.
1920 If 32-bit MMIO register operations are not supported, then ASSERT().
1921 If Address is not aligned on a 32-bit boundary, then ASSERT().
1922 If StartBit is greater than 31, then ASSERT().
1923 If EndBit is greater than 31, then ASSERT().
1924 If EndBit is less than StartBit, then ASSERT().
1926 @param Address MMIO register to read.
1927 @param StartBit The ordinal of the least significant bit in the bit field.
1929 @param EndBit The ordinal of the most significant bit in the bit field.
1932 @return The value read.
1937 MmioBitFieldRead32 (
1944 Writes a bit field to a MMIO register.
1946 Writes Value to the bit field of the MMIO register. The bit field is
1947 specified by the StartBit and the EndBit. All other bits in the destination
1948 MMIO register are preserved. The new value of the 32-bit register is returned.
1950 If 32-bit MMIO register operations are not supported, then ASSERT().
1951 If Address is not aligned on a 32-bit boundary, then ASSERT().
1952 If StartBit is greater than 31, then ASSERT().
1953 If EndBit is greater than 31, then ASSERT().
1954 If EndBit is less than StartBit, then ASSERT().
1956 @param Address MMIO register to write.
1957 @param StartBit The ordinal of the least significant bit in the bit field.
1959 @param EndBit The ordinal of the most significant bit in the bit field.
1961 @param Value New value of the bit field.
1963 @return The value written back to the MMIO register.
1968 MmioBitFieldWrite32 (
1976 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1977 writes the result back to the bit field in the 32-bit MMIO register.
1979 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1980 inclusive OR between the read result and the value specified by OrData, and
1981 writes the result to the 32-bit MMIO register specified by Address. The value
1982 written to the MMIO register is returned. This function must guarantee that
1983 all MMIO read and write operations are serialized. Extra left bits in OrData
1986 If 32-bit MMIO register operations are not supported, then ASSERT().
1987 If Address is not aligned on a 32-bit boundary, then ASSERT().
1988 If StartBit is greater than 31, then ASSERT().
1989 If EndBit is greater than 31, then ASSERT().
1990 If EndBit is less than StartBit, then ASSERT().
1992 @param Address MMIO register to write.
1993 @param StartBit The ordinal of the least significant bit in the bit field.
1995 @param EndBit The ordinal of the most significant bit in the bit field.
1997 @param OrData The value to OR with read value from the MMIO register.
1999 @return The value written back to the MMIO register.
2012 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2013 writes the result back to the bit field in the 32-bit MMIO register.
2015 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2016 between the read result and the value specified by AndData, and writes the
2017 result to the 32-bit MMIO register specified by Address. The value written to
2018 the MMIO register is returned. This function must guarantee that all MMIO
2019 read and write operations are serialized. Extra left bits in AndData are
2022 If 32-bit MMIO register operations are not supported, then ASSERT().
2023 If Address is not aligned on a 32-bit boundary, then ASSERT().
2024 If StartBit is greater than 31, then ASSERT().
2025 If EndBit is greater than 31, then ASSERT().
2026 If EndBit is less than StartBit, then ASSERT().
2028 @param Address MMIO register to write.
2029 @param StartBit The ordinal of the least significant bit in the bit field.
2031 @param EndBit The ordinal of the most significant bit in the bit field.
2033 @param AndData The value to AND with read value from the MMIO register.
2035 @return The value written back to the MMIO register.
2048 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2049 by a bitwise inclusive OR, and writes the result back to the bit field in the
2050 32-bit MMIO register.
2052 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2053 followed by a bitwise inclusive OR between the read result and the value
2054 specified by AndData, and writes the result to the 32-bit MMIO register
2055 specified by Address. The value written to the MMIO register is returned.
2056 This function must guarantee that all MMIO read and write operations are
2057 serialized. Extra left bits in both AndData and OrData are stripped.
2059 If 32-bit MMIO register operations are not supported, then ASSERT().
2060 If Address is not aligned on a 32-bit boundary, then ASSERT().
2061 If StartBit is greater than 31, then ASSERT().
2062 If EndBit is greater than 31, then ASSERT().
2063 If EndBit is less than StartBit, then ASSERT().
2065 @param Address MMIO register to write.
2066 @param StartBit The ordinal of the least significant bit in the bit field.
2068 @param EndBit The ordinal of the most significant bit in the bit field.
2070 @param AndData The value to AND with read value from the MMIO register.
2071 @param OrData The value to OR with the result of the AND operation.
2073 @return The value written back to the MMIO register.
2078 MmioBitFieldAndThenOr32 (
2087 Reads a 64-bit MMIO register.
2089 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2090 returned. This function must guarantee that all MMIO read and write
2091 operations are serialized.
2093 If 64-bit MMIO register operations are not supported, then ASSERT().
2094 If Address is not aligned on a 64-bit boundary, then ASSERT().
2096 @param Address The MMIO register to read.
2098 @return The value read.
2108 Writes a 64-bit MMIO register.
2110 Writes the 64-bit MMIO register specified by Address with the value specified
2111 by Value and returns Value. This function must guarantee that all MMIO read
2112 and write operations are serialized.
2114 If 64-bit MMIO register operations are not supported, then ASSERT().
2115 If Address is not aligned on a 64-bit boundary, then ASSERT().
2117 @param Address The MMIO register to write.
2118 @param Value The value to write to the MMIO register.
2129 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
2130 result back to the 64-bit MMIO register.
2132 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2133 inclusive OR between the read result and the value specified by OrData, and
2134 writes the result to the 64-bit MMIO register specified by Address. The value
2135 written to the MMIO register is returned. This function must guarantee that
2136 all MMIO read and write operations are serialized.
2138 If 64-bit MMIO register operations are not supported, then ASSERT().
2139 If Address is not aligned on a 64-bit boundary, then ASSERT().
2141 @param Address The MMIO register to write.
2142 @param OrData The value to OR with the read value from the MMIO register.
2144 @return The value written back to the MMIO register.
2155 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2156 back to the 64-bit MMIO register.
2158 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2159 between the read result and the value specified by AndData, and writes the
2160 result to the 64-bit MMIO register specified by Address. The value written to
2161 the MMIO register is returned. This function must guarantee that all MMIO
2162 read and write operations are serialized.
2164 If 64-bit MMIO register operations are not supported, then ASSERT().
2165 If Address is not aligned on a 64-bit boundary, then ASSERT().
2167 @param Address The MMIO register to write.
2168 @param AndData The value to AND with the read value from the MMIO register.
2170 @return The value written back to the MMIO register.
2181 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2182 inclusive OR, and writes the result back to the 64-bit MMIO register.
2184 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2185 between the read result and the value specified by AndData, performs a
2186 bitwise OR between the result of the AND operation and the value specified by
2187 OrData, and writes the result to the 64-bit MMIO register specified by
2188 Address. The value written to the MMIO register is returned. This function
2189 must guarantee that all MMIO read and write operations are serialized.
2191 If 64-bit MMIO register operations are not supported, then ASSERT().
2192 If Address is not aligned on a 64-bit boundary, then ASSERT().
2194 @param Address The MMIO register to write.
2195 @param AndData The value to AND with the read value from the MMIO register.
2196 @param OrData The value to OR with the result of the AND operation.
2198 @return The value written back to the MMIO register.
2210 Reads a bit field of a MMIO register.
2212 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2213 the StartBit and the EndBit. The value of the bit field is returned.
2215 If 64-bit MMIO register operations are not supported, then ASSERT().
2216 If Address is not aligned on a 64-bit boundary, then ASSERT().
2217 If StartBit is greater than 63, then ASSERT().
2218 If EndBit is greater than 63, then ASSERT().
2219 If EndBit is less than StartBit, then ASSERT().
2221 @param Address MMIO register to read.
2222 @param StartBit The ordinal of the least significant bit in the bit field.
2224 @param EndBit The ordinal of the most significant bit in the bit field.
2227 @return The value read.
2232 MmioBitFieldRead64 (
2239 Writes a bit field to a MMIO register.
2241 Writes Value to the bit field of the MMIO register. The bit field is
2242 specified by the StartBit and the EndBit. All other bits in the destination
2243 MMIO register are preserved. The new value of the 64-bit register is returned.
2245 If 64-bit MMIO register operations are not supported, then ASSERT().
2246 If Address is not aligned on a 64-bit boundary, then ASSERT().
2247 If StartBit is greater than 63, then ASSERT().
2248 If EndBit is greater than 63, then ASSERT().
2249 If EndBit is less than StartBit, then ASSERT().
2251 @param Address MMIO register to write.
2252 @param StartBit The ordinal of the least significant bit in the bit field.
2254 @param EndBit The ordinal of the most significant bit in the bit field.
2256 @param Value New value of the bit field.
2258 @return The value written back to the MMIO register.
2263 MmioBitFieldWrite64 (
2271 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2272 writes the result back to the bit field in the 64-bit MMIO register.
2274 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2275 inclusive OR between the read result and the value specified by OrData, and
2276 writes the result to the 64-bit MMIO register specified by Address. The value
2277 written to the MMIO register is returned. This function must guarantee that
2278 all MMIO read and write operations are serialized. Extra left bits in OrData
2281 If 64-bit MMIO register operations are not supported, then ASSERT().
2282 If Address is not aligned on a 64-bit boundary, then ASSERT().
2283 If StartBit is greater than 63, then ASSERT().
2284 If EndBit is greater than 63, then ASSERT().
2285 If EndBit is less than StartBit, then ASSERT().
2287 @param Address MMIO register to write.
2288 @param StartBit The ordinal of the least significant bit in the bit field.
2290 @param EndBit The ordinal of the most significant bit in the bit field.
2292 @param OrData The value to OR with read value from the MMIO register.
2294 @return The value written back to the MMIO register.
2307 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2308 writes the result back to the bit field in the 64-bit MMIO register.
2310 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2311 between the read result and the value specified by AndData, and writes the
2312 result to the 64-bit MMIO register specified by Address. The value written to
2313 the MMIO register is returned. This function must guarantee that all MMIO
2314 read and write operations are serialized. Extra left bits in AndData are
2317 If 64-bit MMIO register operations are not supported, then ASSERT().
2318 If Address is not aligned on a 64-bit boundary, then ASSERT().
2319 If StartBit is greater than 63, then ASSERT().
2320 If EndBit is greater than 63, then ASSERT().
2321 If EndBit is less than StartBit, then ASSERT().
2323 @param Address MMIO register to write.
2324 @param StartBit The ordinal of the least significant bit in the bit field.
2326 @param EndBit The ordinal of the most significant bit in the bit field.
2328 @param AndData The value to AND with read value from the MMIO register.
2330 @return The value written back to the MMIO register.
2343 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2344 by a bitwise inclusive OR, and writes the result back to the bit field in the
2345 64-bit MMIO register.
2347 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2348 followed by a bitwise inclusive OR between the read result and the value
2349 specified by AndData, and writes the result to the 64-bit MMIO register
2350 specified by Address. The value written to the MMIO register is returned.
2351 This function must guarantee that all MMIO read and write operations are
2352 serialized. Extra left bits in both AndData and OrData are stripped.
2354 If 64-bit MMIO register operations are not supported, then ASSERT().
2355 If Address is not aligned on a 64-bit boundary, then ASSERT().
2356 If StartBit is greater than 63, then ASSERT().
2357 If EndBit is greater than 63, then ASSERT().
2358 If EndBit is less than StartBit, then ASSERT().
2360 @param Address MMIO register to write.
2361 @param StartBit The ordinal of the least significant bit in the bit field.
2363 @param EndBit The ordinal of the most significant bit in the bit field.
2365 @param AndData The value to AND with read value from the MMIO register.
2366 @param OrData The value to OR with the result of the AND operation.
2368 @return The value written back to the MMIO register.
2373 MmioBitFieldAndThenOr64 (
2382 Copy data from MMIO region to system memory by using 8-bit access.
2384 Copy data from MMIO region specified by starting address StartAddress
2385 to system memory specified by Buffer by using 8-bit access. The total
2386 number of byte to be copied is specified by Length. Buffer is returned.
2388 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2389 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2392 @param StartAddress Starting address for the MMIO region to be copied from.
2393 @param Length The size, in bytes, of Buffer.
2394 @param Buffer Pointer to a system memory buffer receiving the data read.
2402 IN UINTN StartAddress
,
2408 Copy data from MMIO region to system memory by using 16-bit access.
2410 Copy data from MMIO region specified by starting address StartAddress
2411 to system memory specified by Buffer by using 16-bit access. The total
2412 number of byte to be copied is specified by Length. Buffer is returned.
2414 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2416 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2417 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2419 If Length is not aligned on a 16-bit boundary, then ASSERT().
2420 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2422 @param StartAddress Starting address for the MMIO region to be copied from.
2423 @param Length The size, in bytes, of Buffer.
2424 @param Buffer Pointer to a system memory buffer receiving the data read.
2432 IN UINTN StartAddress
,
2438 Copy data from MMIO region to system memory by using 32-bit access.
2440 Copy data from MMIO region specified by starting address StartAddress
2441 to system memory specified by Buffer by using 32-bit access. The total
2442 number of byte to be copied is specified by Length. Buffer is returned.
2444 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2446 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2447 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2449 If Length is not aligned on a 32-bit boundary, then ASSERT().
2450 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2452 @param StartAddress Starting address for the MMIO region to be copied from.
2453 @param Length The size, in bytes, of Buffer.
2454 @param Buffer Pointer to a system memory buffer receiving the data read.
2462 IN UINTN StartAddress
,
2468 Copy data from MMIO region to system memory by using 64-bit access.
2470 Copy data from MMIO region specified by starting address StartAddress
2471 to system memory specified by Buffer by using 64-bit access. The total
2472 number of byte to be copied is specified by Length. Buffer is returned.
2474 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2476 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2477 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2479 If Length is not aligned on a 64-bit boundary, then ASSERT().
2480 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2482 @param StartAddress Starting address for the MMIO region to be copied from.
2483 @param Length The size, in bytes, of Buffer.
2484 @param Buffer Pointer to a system memory buffer receiving the data read.
2492 IN UINTN StartAddress
,
2498 Copy data from system memory to MMIO region by using 8-bit access.
2500 Copy data from system memory specified by Buffer to MMIO region specified
2501 by starting address StartAddress by using 8-bit access. The total number
2502 of byte to be copied is specified by Length. Buffer is returned.
2504 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2505 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2508 @param StartAddress Starting address for the MMIO region to be copied to.
2509 @param Length The size, in bytes, of Buffer.
2510 @param Buffer Pointer to a system memory buffer containing the data to write.
2512 @return Size in bytes of the copy.
2518 IN UINTN StartAddress
,
2520 IN CONST UINT8
*Buffer
2524 Copy data from system memory to MMIO region by using 16-bit access.
2526 Copy data from system memory specified by Buffer to MMIO region specified
2527 by starting address StartAddress by using 16-bit access. The total number
2528 of byte to be copied is specified by Length. Length is returned.
2530 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2532 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2533 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2535 If Length is not aligned on a 16-bit boundary, then ASSERT().
2537 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2539 @param StartAddress Starting address for the MMIO region to be copied to.
2540 @param Length The size, in bytes, of Buffer.
2541 @param Buffer Pointer to a system memory buffer containing the data to write.
2543 @return Size in bytes of the copy.
2549 IN UINTN StartAddress
,
2551 IN CONST UINT16
*Buffer
2555 Copy data from system memory to MMIO region by using 32-bit access.
2557 Copy data from system memory specified by Buffer to MMIO region specified
2558 by starting address StartAddress by using 32-bit access. The total number
2559 of byte to be copied is specified by Length. Length is returned.
2561 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2563 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2564 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2566 If Length is not aligned on a 32-bit boundary, then ASSERT().
2568 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2570 @param StartAddress Starting address for the MMIO region to be copied to.
2571 @param Length The size, in bytes, of Buffer.
2572 @param Buffer Pointer to a system memory buffer containing the data to write.
2574 @return Size in bytes of the copy.
2580 IN UINTN StartAddress
,
2582 IN CONST UINT32
*Buffer
2586 Copy data from system memory to MMIO region by using 64-bit access.
2588 Copy data from system memory specified by Buffer to MMIO region specified
2589 by starting address StartAddress by using 64-bit access. The total number
2590 of byte to be copied is specified by Length. Length is returned.
2592 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2594 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2595 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2597 If Length is not aligned on a 64-bit boundary, then ASSERT().
2599 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2601 @param StartAddress Starting address for the MMIO region to be copied to.
2602 @param Length The size, in bytes, of Buffer.
2603 @param Buffer Pointer to a system memory buffer containing the data to write.
2605 @return Size in bytes of the copy.
2611 IN UINTN StartAddress
,
2613 IN CONST UINT64
*Buffer