]>
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 - 2012, Intel Corporation. All rights reserved.<BR>
5 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().
195 If Value is larger than the bitmask value range specified by StartBit and EndBit, 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 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().
230 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
232 @param Port The I/O port to write.
233 @param StartBit The ordinal of the least significant bit in the bit field.
235 @param EndBit The ordinal of the most significant bit in the bit field.
237 @param OrData The value to OR with the read value from the I/O port.
239 @return The value written back to the I/O port.
252 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
253 result back to the bit field in the 8-bit port.
255 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
256 the read result and the value specified by AndData, and writes the result to
257 the 8-bit I/O port specified by Port. The value written to the I/O port is
258 returned. This function must guarantee that all I/O read and write operations
259 are serialized. Extra left bits in AndData are stripped.
261 If 8-bit I/O port operations are not supported, then ASSERT().
262 If StartBit is greater than 7, then ASSERT().
263 If EndBit is greater than 7, then ASSERT().
264 If EndBit is less than StartBit, then ASSERT().
265 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
267 @param Port The I/O port to write.
268 @param StartBit The ordinal of the least significant bit in the bit field.
270 @param EndBit The ordinal of the most significant bit in the bit field.
272 @param AndData The value to AND with the read value from the I/O port.
274 @return The value written back to the I/O port.
287 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
288 bitwise OR, and writes the result back to the bit field in the
291 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
292 by a bitwise OR between the read result and the value specified by
293 AndData, and writes the result to the 8-bit I/O port specified by Port. The
294 value written to the I/O port is returned. This function must guarantee that
295 all I/O read and write operations are serialized. Extra left bits in both
296 AndData and OrData are stripped.
298 If 8-bit I/O port operations are not supported, then ASSERT().
299 If StartBit is greater than 7, then ASSERT().
300 If EndBit is greater than 7, then ASSERT().
301 If EndBit is less than StartBit, then ASSERT().
302 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
303 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
305 @param Port The I/O port to write.
306 @param StartBit The ordinal of the least significant bit in the bit field.
308 @param EndBit The ordinal of the most significant bit in the bit field.
310 @param AndData The value to AND with the read value from the I/O port.
311 @param OrData The value to OR with the result of the AND operation.
313 @return The value written back to the I/O port.
318 IoBitFieldAndThenOr8 (
327 Reads a 16-bit I/O port.
329 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
330 This function must guarantee that all I/O read and write operations are
333 If 16-bit I/O port operations are not supported, then ASSERT().
334 If Port is not aligned on a 16-bit boundary, then ASSERT().
336 @param Port The I/O port to read.
338 @return The value read.
348 Writes a 16-bit I/O port.
350 Writes the 16-bit I/O port specified by Port with the value specified by Value
351 and returns Value. This function must guarantee that all I/O read and write
352 operations are serialized.
354 If 16-bit I/O port operations are not supported, then ASSERT().
355 If Port is not aligned on a 16-bit boundary, then ASSERT().
357 @param Port The I/O port to write.
358 @param Value The value to write to the I/O port.
360 @return The value written the I/O port.
371 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
372 result back to the 16-bit I/O port.
374 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
375 between the read result and the value specified by OrData, and writes the
376 result to the 16-bit I/O port specified by Port. The value written to the I/O
377 port is returned. This function must guarantee that all I/O read and write
378 operations are serialized.
380 If 16-bit I/O port operations are not supported, then ASSERT().
381 If Port is not aligned on a 16-bit boundary, then ASSERT().
383 @param Port The I/O port to write.
384 @param OrData The value to OR with the read value from the I/O port.
386 @return The value written back to the I/O port.
397 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
398 to the 16-bit I/O port.
400 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
401 the read result and the value specified by AndData, and writes the result to
402 the 16-bit I/O port specified by Port. The value written to the I/O port is
403 returned. This function must guarantee that all I/O read and write operations
406 If 16-bit I/O port operations are not supported, then ASSERT().
407 If Port is not aligned on a 16-bit boundary, then ASSERT().
409 @param Port The I/O port to write.
410 @param AndData The value to AND with the read value from the I/O port.
412 @return The value written back to the I/O port.
423 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
424 OR, and writes the result back to the 16-bit I/O port.
426 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
427 the read result and the value specified by AndData, performs a bitwise OR
428 between the result of the AND operation and the value specified by OrData,
429 and writes the result to the 16-bit I/O port specified by Port. The value
430 written to the I/O port is returned. This function must guarantee that all
431 I/O read and write operations are serialized.
433 If 16-bit I/O port operations are not supported, then ASSERT().
434 If Port is not aligned on a 16-bit boundary, then ASSERT().
436 @param Port The I/O port to write.
437 @param AndData The value to AND with the read value from the I/O port.
438 @param OrData The value to OR with the result of the AND operation.
440 @return The value written back to the I/O port.
452 Reads a bit field of an I/O register.
454 Reads the bit field in a 16-bit I/O register. The bit field is specified by
455 the StartBit and the EndBit. The value of the bit field is returned.
457 If 16-bit I/O port operations are not supported, then ASSERT().
458 If Port is not aligned on a 16-bit boundary, then ASSERT().
459 If StartBit is greater than 15, then ASSERT().
460 If EndBit is greater than 15, then ASSERT().
461 If EndBit is less than StartBit, then ASSERT().
463 @param Port The I/O port to read.
464 @param StartBit The ordinal of the least significant bit in the bit field.
466 @param EndBit The ordinal of the most significant bit in the bit field.
469 @return The value read.
481 Writes a bit field to an I/O register.
483 Writes Value to the bit field of the I/O register. The bit field is specified
484 by the StartBit and the EndBit. All other bits in the destination I/O
485 register are preserved. The value written to the I/O port is returned. Extra
486 left bits in Value are stripped.
488 If 16-bit I/O port operations are not supported, then ASSERT().
489 If Port is not aligned on a 16-bit boundary, then ASSERT().
490 If StartBit is greater than 15, then ASSERT().
491 If EndBit is greater than 15, then ASSERT().
492 If EndBit is less than StartBit, then ASSERT().
493 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
495 @param Port The I/O port to write.
496 @param StartBit The ordinal of the least significant bit in the bit field.
498 @param EndBit The ordinal of the most significant bit in the bit field.
500 @param Value New value of the bit field.
502 @return The value written back to the I/O port.
515 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
516 result back to the bit field in the 16-bit port.
518 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
519 between the read result and the value specified by OrData, and writes the
520 result to the 16-bit I/O port specified by Port. The value written to the I/O
521 port is returned. This function must guarantee that all I/O read and write
522 operations are serialized. Extra left bits in OrData are stripped.
524 If 16-bit I/O port operations are not supported, then ASSERT().
525 If Port is not aligned on a 16-bit boundary, then ASSERT().
526 If StartBit is greater than 15, then ASSERT().
527 If EndBit is greater than 15, then ASSERT().
528 If EndBit is less than StartBit, then ASSERT().
529 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
531 @param Port The I/O port to write.
532 @param StartBit The ordinal of the least significant bit in the bit field.
534 @param EndBit The ordinal of the most significant bit in the bit field.
536 @param OrData The value to OR with the read value from the I/O port.
538 @return The value written back to the I/O port.
551 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
552 result back to the bit field in the 16-bit port.
554 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
555 the read result and the value specified by AndData, and writes the result to
556 the 16-bit I/O port specified by Port. The value written to the I/O port is
557 returned. This function must guarantee that all I/O read and write operations
558 are serialized. Extra left bits in AndData are stripped.
560 If 16-bit I/O port operations are not supported, then ASSERT().
561 If Port is not aligned on a 16-bit boundary, then ASSERT().
562 If StartBit is greater than 15, then ASSERT().
563 If EndBit is greater than 15, then ASSERT().
564 If EndBit is less than StartBit, then ASSERT().
565 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
567 @param Port The I/O port to write.
568 @param StartBit The ordinal of the least significant bit in the bit field.
570 @param EndBit The ordinal of the most significant bit in the bit field.
572 @param AndData The value to AND with the read value from the I/O port.
574 @return The value written back to the I/O port.
587 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
588 bitwise OR, and writes the result back to the bit field in the
591 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
592 by a bitwise OR between the read result and the value specified by
593 AndData, and writes the result to the 16-bit I/O port specified by Port. The
594 value written to the I/O port is returned. This function must guarantee that
595 all I/O read and write operations are serialized. Extra left bits in both
596 AndData and OrData are stripped.
598 If 16-bit I/O port operations are not supported, then ASSERT().
599 If Port is not aligned on a 16-bit boundary, then ASSERT().
600 If StartBit is greater than 15, then ASSERT().
601 If EndBit is greater than 15, then ASSERT().
602 If EndBit is less than StartBit, then ASSERT().
603 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
604 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
606 @param Port The I/O port to write.
607 @param StartBit The ordinal of the least significant bit in the bit field.
609 @param EndBit The ordinal of the most significant bit in the bit field.
611 @param AndData The value to AND with the read value from the I/O port.
612 @param OrData The value to OR with the result of the AND operation.
614 @return The value written back to the I/O port.
619 IoBitFieldAndThenOr16 (
628 Reads a 32-bit I/O port.
630 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
631 This function must guarantee that all I/O read and write operations are
634 If 32-bit I/O port operations are not supported, then ASSERT().
635 If Port is not aligned on a 32-bit boundary, then ASSERT().
637 @param Port The I/O port to read.
639 @return The value read.
649 Writes a 32-bit I/O port.
651 Writes the 32-bit I/O port specified by Port with the value specified by Value
652 and returns Value. This function must guarantee that all I/O read and write
653 operations are serialized.
655 If 32-bit I/O port operations are not supported, then ASSERT().
656 If Port is not aligned on a 32-bit boundary, then ASSERT().
658 @param Port The I/O port to write.
659 @param Value The value to write to the I/O port.
661 @return The value written the I/O port.
672 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
673 result back to the 32-bit I/O port.
675 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
676 between the read result and the value specified by OrData, and writes the
677 result to the 32-bit I/O port specified by Port. The value written to the I/O
678 port is returned. This function must guarantee that all I/O read and write
679 operations are serialized.
681 If 32-bit I/O port operations are not supported, then ASSERT().
682 If Port is not aligned on a 32-bit boundary, then ASSERT().
684 @param Port The I/O port to write.
685 @param OrData The value to OR with the read value from the I/O port.
687 @return The value written back to the I/O port.
698 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
699 to the 32-bit I/O port.
701 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
702 the read result and the value specified by AndData, and writes the result to
703 the 32-bit I/O port specified by Port. The value written to the I/O port is
704 returned. This function must guarantee that all I/O read and write operations
707 If 32-bit I/O port operations are not supported, then ASSERT().
708 If Port is not aligned on a 32-bit boundary, then ASSERT().
710 @param Port The I/O port to write.
711 @param AndData The value to AND with the read value from the I/O port.
713 @return The value written back to the I/O port.
724 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
725 OR, and writes the result back to the 32-bit I/O port.
727 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
728 the read result and the value specified by AndData, performs a bitwise OR
729 between the result of the AND operation and the value specified by OrData,
730 and writes the result to the 32-bit I/O port specified by Port. The value
731 written to the I/O port is returned. This function must guarantee that all
732 I/O read and write operations are serialized.
734 If 32-bit I/O port operations are not supported, then ASSERT().
735 If Port is not aligned on a 32-bit boundary, then ASSERT().
737 @param Port The I/O port to write.
738 @param AndData The value to AND with the read value from the I/O port.
739 @param OrData The value to OR with the result of the AND operation.
741 @return The value written back to the I/O port.
753 Reads a bit field of an I/O register.
755 Reads the bit field in a 32-bit I/O register. The bit field is specified by
756 the StartBit and the EndBit. The value of the bit field is returned.
758 If 32-bit I/O port operations are not supported, then ASSERT().
759 If Port is not aligned on a 32-bit boundary, then ASSERT().
760 If StartBit is greater than 31, then ASSERT().
761 If EndBit is greater than 31, then ASSERT().
762 If EndBit is less than StartBit, then ASSERT().
764 @param Port The I/O port to read.
765 @param StartBit The ordinal of the least significant bit in the bit field.
767 @param EndBit The ordinal of the most significant bit in the bit field.
770 @return The value read.
782 Writes a bit field to an I/O register.
784 Writes Value to the bit field of the I/O register. The bit field is specified
785 by the StartBit and the EndBit. All other bits in the destination I/O
786 register are preserved. The value written to the I/O port is returned. Extra
787 left bits in Value are stripped.
789 If 32-bit I/O port operations are not supported, then ASSERT().
790 If Port is not aligned on a 32-bit boundary, then ASSERT().
791 If StartBit is greater than 31, then ASSERT().
792 If EndBit is greater than 31, then ASSERT().
793 If EndBit is less than StartBit, then ASSERT().
794 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
796 @param Port The I/O port to write.
797 @param StartBit The ordinal of the least significant bit in the bit field.
799 @param EndBit The ordinal of the most significant bit in the bit field.
801 @param Value New value of the bit field.
803 @return The value written back to the I/O port.
816 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
817 result back to the bit field in the 32-bit port.
819 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
820 between the read result and the value specified by OrData, and writes the
821 result to the 32-bit I/O port specified by Port. The value written to the I/O
822 port is returned. This function must guarantee that all I/O read and write
823 operations are serialized. Extra left bits in OrData are stripped.
825 If 32-bit I/O port operations are not supported, then ASSERT().
826 If Port is not aligned on a 32-bit boundary, then ASSERT().
827 If StartBit is greater than 31, then ASSERT().
828 If EndBit is greater than 31, then ASSERT().
829 If EndBit is less than StartBit, then ASSERT().
830 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
832 @param Port The I/O port to write.
833 @param StartBit The ordinal of the least significant bit in the bit field.
835 @param EndBit The ordinal of the most significant bit in the bit field.
837 @param OrData The value to OR with the read value from the I/O port.
839 @return The value written back to the I/O port.
852 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
853 result back to the bit field in the 32-bit port.
855 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
856 the read result and the value specified by AndData, and writes the result to
857 the 32-bit I/O port specified by Port. The value written to the I/O port is
858 returned. This function must guarantee that all I/O read and write operations
859 are serialized. Extra left bits in AndData are stripped.
861 If 32-bit I/O port operations are not supported, then ASSERT().
862 If Port is not aligned on a 32-bit boundary, then ASSERT().
863 If StartBit is greater than 31, then ASSERT().
864 If EndBit is greater than 31, then ASSERT().
865 If EndBit is less than StartBit, then ASSERT().
866 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
868 @param Port The I/O port to write.
869 @param StartBit The ordinal of the least significant bit in the bit field.
871 @param EndBit The ordinal of the most significant bit in the bit field.
873 @param AndData The value to AND with the read value from the I/O port.
875 @return The value written back to the I/O port.
888 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
889 bitwise OR, and writes the result back to the bit field in the
892 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
893 by a bitwise OR between the read result and the value specified by
894 AndData, and writes the result to the 32-bit I/O port specified by Port. The
895 value written to the I/O port is returned. This function must guarantee that
896 all I/O read and write operations are serialized. Extra left bits in both
897 AndData and OrData are stripped.
899 If 32-bit I/O port operations are not supported, then ASSERT().
900 If Port is not aligned on a 32-bit boundary, then ASSERT().
901 If StartBit is greater than 31, then ASSERT().
902 If EndBit is greater than 31, then ASSERT().
903 If EndBit is less than StartBit, then ASSERT().
904 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
905 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
907 @param Port The I/O port to write.
908 @param StartBit The ordinal of the least significant bit in the bit field.
910 @param EndBit The ordinal of the most significant bit in the bit field.
912 @param AndData The value to AND with the read value from the I/O port.
913 @param OrData The value to OR with the result of the AND operation.
915 @return The value written back to the I/O port.
920 IoBitFieldAndThenOr32 (
929 Reads a 64-bit I/O port.
931 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
932 This function must guarantee that all I/O read and write operations are
935 If 64-bit I/O port operations are not supported, then ASSERT().
936 If Port is not aligned on a 64-bit boundary, then ASSERT().
938 @param Port The I/O port to read.
940 @return The value read.
950 Writes a 64-bit I/O port.
952 Writes the 64-bit I/O port specified by Port with the value specified by Value
953 and returns Value. This function must guarantee that all I/O read and write
954 operations are serialized.
956 If 64-bit I/O port operations are not supported, then ASSERT().
957 If Port is not aligned on a 64-bit boundary, then ASSERT().
959 @param Port The I/O port to write.
960 @param Value The value to write to the I/O port.
962 @return The value written the I/O port.
973 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
974 result back to the 64-bit I/O port.
976 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
977 between the read result and the value specified by OrData, and writes the
978 result to the 64-bit I/O port specified by Port. The value written to the I/O
979 port is returned. This function must guarantee that all I/O read and write
980 operations are serialized.
982 If 64-bit I/O port operations are not supported, then ASSERT().
983 If Port is not aligned on a 64-bit boundary, then ASSERT().
985 @param Port The I/O port to write.
986 @param OrData The value to OR with the read value from the I/O port.
988 @return The value written back to the I/O port.
999 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
1000 to the 64-bit I/O port.
1002 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1003 the read result and the value specified by AndData, and writes the result to
1004 the 64-bit I/O port specified by Port. The value written to the I/O port is
1005 returned. This function must guarantee that all I/O read and write operations
1008 If 64-bit I/O port operations are not supported, then ASSERT().
1009 If Port is not aligned on a 64-bit boundary, then ASSERT().
1011 @param Port The I/O port to write.
1012 @param AndData The value to AND with the read value from the I/O port.
1014 @return The value written back to the I/O port.
1025 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
1026 OR, and writes the result back to the 64-bit I/O port.
1028 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1029 the read result and the value specified by AndData, performs a bitwise OR
1030 between the result of the AND operation and the value specified by OrData,
1031 and writes the result to the 64-bit I/O port specified by Port. The value
1032 written to the I/O port is returned. This function must guarantee that all
1033 I/O read and write operations are serialized.
1035 If 64-bit I/O port operations are not supported, then ASSERT().
1036 If Port is not aligned on a 64-bit boundary, then ASSERT().
1038 @param Port The I/O port to write.
1039 @param AndData The value to AND with the read value from the I/O port.
1040 @param OrData The value to OR with the result of the AND operation.
1042 @return The value written back to the I/O port.
1054 Reads a bit field of an I/O register.
1056 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1057 the StartBit and the EndBit. The value of the bit field is returned.
1059 If 64-bit I/O port operations are not supported, then ASSERT().
1060 If Port is not aligned on a 64-bit boundary, then ASSERT().
1061 If StartBit is greater than 63, then ASSERT().
1062 If EndBit is greater than 63, then ASSERT().
1063 If EndBit is less than StartBit, then ASSERT().
1065 @param Port The I/O port to read.
1066 @param StartBit The ordinal of the least significant bit in the bit field.
1068 @param EndBit The ordinal of the most significant bit in the bit field.
1071 @return The value read.
1083 Writes a bit field to an I/O register.
1085 Writes Value to the bit field of the I/O register. The bit field is specified
1086 by the StartBit and the EndBit. All other bits in the destination I/O
1087 register are preserved. The value written to the I/O port is returned. Extra
1088 left bits in Value are stripped.
1090 If 64-bit I/O port operations are not supported, then ASSERT().
1091 If Port is not aligned on a 64-bit boundary, then ASSERT().
1092 If StartBit is greater than 63, then ASSERT().
1093 If EndBit is greater than 63, then ASSERT().
1094 If EndBit is less than StartBit, then ASSERT().
1095 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1097 @param Port The I/O port to write.
1098 @param StartBit The ordinal of the least significant bit in the bit field.
1100 @param EndBit The ordinal of the most significant bit in the bit field.
1102 @param Value New value of the bit field.
1104 @return The value written back to the I/O port.
1117 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1118 result back to the bit field in the 64-bit port.
1120 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1121 between the read result and the value specified by OrData, and writes the
1122 result to the 64-bit I/O port specified by Port. The value written to the I/O
1123 port is returned. This function must guarantee that all I/O read and write
1124 operations are serialized. Extra left bits in OrData are stripped.
1126 If 64-bit I/O port operations are not supported, then ASSERT().
1127 If Port is not aligned on a 64-bit boundary, then ASSERT().
1128 If StartBit is greater than 63, then ASSERT().
1129 If EndBit is greater than 63, then ASSERT().
1130 If EndBit is less than StartBit, then ASSERT().
1131 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1133 @param Port The I/O port to write.
1134 @param StartBit The ordinal of the least significant bit in the bit field.
1136 @param EndBit The ordinal of the most significant bit in the bit field.
1138 @param OrData The value to OR with the read value from the I/O port.
1140 @return The value written back to the I/O port.
1153 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1154 result back to the bit field in the 64-bit port.
1156 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1157 the read result and the value specified by AndData, and writes the result to
1158 the 64-bit I/O port specified by Port. The value written to the I/O port is
1159 returned. This function must guarantee that all I/O read and write operations
1160 are serialized. Extra left bits in AndData are stripped.
1162 If 64-bit I/O port operations are not supported, then ASSERT().
1163 If Port is not aligned on a 64-bit boundary, then ASSERT().
1164 If StartBit is greater than 63, then ASSERT().
1165 If EndBit is greater than 63, then ASSERT().
1166 If EndBit is less than StartBit, then ASSERT().
1167 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1169 @param Port The I/O port to write.
1170 @param StartBit The ordinal of the least significant bit in the bit field.
1172 @param EndBit The ordinal of the most significant bit in the bit field.
1174 @param AndData The value to AND with the read value from the I/O port.
1176 @return The value written back to the I/O port.
1189 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1190 bitwise OR, and writes the result back to the bit field in the
1193 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1194 by a bitwise OR between the read result and the value specified by
1195 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1196 value written to the I/O port is returned. This function must guarantee that
1197 all I/O read and write operations are serialized. Extra left bits in both
1198 AndData and OrData are stripped.
1200 If 64-bit I/O port operations are not supported, then ASSERT().
1201 If Port is not aligned on a 64-bit boundary, then ASSERT().
1202 If StartBit is greater than 63, then ASSERT().
1203 If EndBit is greater than 63, then ASSERT().
1204 If EndBit is less than StartBit, then ASSERT().
1205 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1206 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1208 @param Port The I/O port to write.
1209 @param StartBit The ordinal of the least significant bit in the bit field.
1211 @param EndBit The ordinal of the most significant bit in the bit field.
1213 @param AndData The value to AND with the read value from the I/O port.
1214 @param OrData The value to OR with the result of the AND operation.
1216 @return The value written back to the I/O port.
1221 IoBitFieldAndThenOr64 (
1230 Reads an 8-bit MMIO register.
1232 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1233 returned. This function must guarantee that all MMIO read and write
1234 operations are serialized.
1236 If 8-bit MMIO register operations are not supported, then ASSERT().
1238 @param Address The MMIO register to read.
1240 @return The value read.
1250 Writes an 8-bit MMIO register.
1252 Writes the 8-bit MMIO register specified by Address with the value specified
1253 by Value and returns Value. This function must guarantee that all MMIO read
1254 and write operations are serialized.
1256 If 8-bit MMIO register operations are not supported, then ASSERT().
1258 @param Address The MMIO register to write.
1259 @param Value The value to write to the MMIO register.
1272 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1273 result back to the 8-bit MMIO register.
1275 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1276 OR between the read result and the value specified by OrData, and
1277 writes the result to the 8-bit MMIO register specified by Address. The value
1278 written to the MMIO register is returned. This function must guarantee that
1279 all MMIO read and write operations are serialized.
1281 If 8-bit MMIO register operations are not supported, then ASSERT().
1283 @param Address The MMIO register to write.
1284 @param OrData The value to OR with the read value from the MMIO register.
1286 @return The value written back to the MMIO register.
1297 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1298 back to the 8-bit MMIO register.
1300 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1301 between the read result and the value specified by AndData, and writes the
1302 result to the 8-bit MMIO register specified by Address. The value written to
1303 the MMIO register is returned. This function must guarantee that all MMIO
1304 read and write operations are serialized.
1306 If 8-bit MMIO register operations are not supported, then ASSERT().
1308 @param Address The MMIO register to write.
1309 @param AndData The value to AND with the read value from the MMIO register.
1311 @return The value written back to the MMIO register.
1322 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1323 OR, and writes the result back to the 8-bit MMIO register.
1325 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1326 between the read result and the value specified by AndData, performs a
1327 bitwise OR between the result of the AND operation and the value specified by
1328 OrData, and writes the result to the 8-bit MMIO register specified by
1329 Address. The value written to the MMIO register is returned. This function
1330 must guarantee that all MMIO read and write operations are serialized.
1332 If 8-bit MMIO register operations are not supported, then ASSERT().
1335 @param Address The MMIO register to write.
1336 @param AndData The value to AND with the read value from the MMIO register.
1337 @param OrData The value to OR with the result of the AND operation.
1339 @return The value written back to the MMIO register.
1351 Reads a bit field of a MMIO register.
1353 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1354 the StartBit and the EndBit. The value of the bit field is returned.
1356 If 8-bit MMIO register operations are not supported, then ASSERT().
1357 If StartBit is greater than 7, then ASSERT().
1358 If EndBit is greater than 7, then ASSERT().
1359 If EndBit is less than StartBit, then ASSERT().
1361 @param Address MMIO register to read.
1362 @param StartBit The ordinal of the least significant bit in the bit field.
1364 @param EndBit The ordinal of the most significant bit in the bit field.
1367 @return The value read.
1379 Writes a bit field to a MMIO register.
1381 Writes Value to the bit field of the MMIO register. The bit field is
1382 specified by the StartBit and the EndBit. All other bits in the destination
1383 MMIO register are preserved. The new value of the 8-bit register is returned.
1385 If 8-bit MMIO register operations are not supported, then ASSERT().
1386 If StartBit is greater than 7, then ASSERT().
1387 If EndBit is greater than 7, then ASSERT().
1388 If EndBit is less than StartBit, then ASSERT().
1389 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1391 @param Address MMIO register to write.
1392 @param StartBit The ordinal of the least significant bit in the bit field.
1394 @param EndBit The ordinal of the most significant bit in the bit field.
1396 @param Value New value of the bit field.
1398 @return The value written back to the MMIO register.
1403 MmioBitFieldWrite8 (
1411 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1412 writes the result back to the bit field in the 8-bit MMIO register.
1414 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1415 OR between the read result and the value specified by OrData, and
1416 writes the result to the 8-bit MMIO register specified by Address. The value
1417 written to the MMIO register is returned. This function must guarantee that
1418 all MMIO read and write operations are serialized. Extra left bits in OrData
1421 If 8-bit MMIO register operations are not supported, then ASSERT().
1422 If StartBit is greater than 7, then ASSERT().
1423 If EndBit is greater than 7, then ASSERT().
1424 If EndBit is less than StartBit, then ASSERT().
1425 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1427 @param Address MMIO register to write.
1428 @param StartBit The ordinal of the least significant bit in the bit field.
1430 @param EndBit The ordinal of the most significant bit in the bit field.
1432 @param OrData The value to OR with read value from the MMIO register.
1434 @return The value written back to the MMIO register.
1447 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1448 writes the result back to the bit field in the 8-bit MMIO register.
1450 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1451 between the read result and the value specified by AndData, and writes the
1452 result to the 8-bit MMIO register specified by Address. The value written to
1453 the MMIO register is returned. This function must guarantee that all MMIO
1454 read and write operations are serialized. Extra left bits in AndData are
1457 If 8-bit MMIO register operations are not supported, then ASSERT().
1458 If StartBit is greater than 7, then ASSERT().
1459 If EndBit is greater than 7, then ASSERT().
1460 If EndBit is less than StartBit, then ASSERT().
1461 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1463 @param Address MMIO register to write.
1464 @param StartBit The ordinal of the least significant bit in the bit field.
1466 @param EndBit The ordinal of the most significant bit in the bit field.
1468 @param AndData The value to AND with read value from the MMIO register.
1470 @return The value written back to the MMIO register.
1483 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1484 by a bitwise OR, and writes the result back to the bit field in the
1485 8-bit MMIO register.
1487 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1488 followed by a bitwise OR between the read result and the value
1489 specified by AndData, and writes the result to the 8-bit MMIO register
1490 specified by Address. The value written to the MMIO register is returned.
1491 This function must guarantee that all MMIO read and write operations are
1492 serialized. Extra left bits in both AndData and OrData are stripped.
1494 If 8-bit MMIO register operations are not supported, then ASSERT().
1495 If StartBit is greater than 7, then ASSERT().
1496 If EndBit is greater than 7, then ASSERT().
1497 If EndBit is less than StartBit, then ASSERT().
1498 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1499 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1501 @param Address MMIO register to write.
1502 @param StartBit The ordinal of the least significant bit in the bit field.
1504 @param EndBit The ordinal of the most significant bit in the bit field.
1506 @param AndData The value to AND with read value from the MMIO register.
1507 @param OrData The value to OR with the result of the AND operation.
1509 @return The value written back to the MMIO register.
1514 MmioBitFieldAndThenOr8 (
1523 Reads a 16-bit MMIO register.
1525 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1526 returned. This function must guarantee that all MMIO read and write
1527 operations are serialized.
1529 If 16-bit MMIO register operations are not supported, then ASSERT().
1530 If Address is not aligned on a 16-bit boundary, then ASSERT().
1532 @param Address The MMIO register to read.
1534 @return The value read.
1544 Writes a 16-bit MMIO register.
1546 Writes the 16-bit MMIO register specified by Address with the value specified
1547 by Value and returns Value. This function must guarantee that all MMIO read
1548 and write operations are serialized.
1550 If 16-bit MMIO register operations are not supported, then ASSERT().
1551 If Address is not aligned on a 16-bit boundary, then ASSERT().
1553 @param Address The MMIO register to write.
1554 @param Value The value to write to the MMIO register.
1567 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1568 result back to the 16-bit MMIO register.
1570 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1571 OR between the read result and the value specified by OrData, and
1572 writes the result to the 16-bit MMIO register specified by Address. The value
1573 written to the MMIO register is returned. This function must guarantee that
1574 all MMIO read and write operations are serialized.
1576 If 16-bit MMIO register operations are not supported, then ASSERT().
1577 If Address is not aligned on a 16-bit boundary, then ASSERT().
1579 @param Address The MMIO register to write.
1580 @param OrData The value to OR with the read value from the MMIO register.
1582 @return The value written back to the MMIO register.
1593 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1594 back to the 16-bit MMIO register.
1596 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1597 between the read result and the value specified by AndData, and writes the
1598 result to the 16-bit MMIO register specified by Address. The value written to
1599 the MMIO register is returned. This function must guarantee that all MMIO
1600 read and write operations are serialized.
1602 If 16-bit MMIO register operations are not supported, then ASSERT().
1603 If Address is not aligned on a 16-bit boundary, then ASSERT().
1605 @param Address The MMIO register to write.
1606 @param AndData The value to AND with the read value from the MMIO register.
1608 @return The value written back to the MMIO register.
1619 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1620 OR, and writes the result back to the 16-bit MMIO register.
1622 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1623 between the read result and the value specified by AndData, performs a
1624 bitwise OR between the result of the AND operation and the value specified by
1625 OrData, and writes the result to the 16-bit MMIO register specified by
1626 Address. The value written to the MMIO register is returned. This function
1627 must guarantee that all MMIO read and write operations are serialized.
1629 If 16-bit MMIO register operations are not supported, then ASSERT().
1630 If Address is not aligned on a 16-bit boundary, then ASSERT().
1632 @param Address The MMIO register to write.
1633 @param AndData The value to AND with the read value from the MMIO register.
1634 @param OrData The value to OR with the result of the AND operation.
1636 @return The value written back to the MMIO register.
1648 Reads a bit field of a MMIO register.
1650 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1651 the StartBit and the EndBit. The value of the bit field is returned.
1653 If 16-bit MMIO register operations are not supported, then ASSERT().
1654 If Address is not aligned on a 16-bit boundary, then ASSERT().
1655 If StartBit is greater than 15, then ASSERT().
1656 If EndBit is greater than 15, then ASSERT().
1657 If EndBit is less than StartBit, then ASSERT().
1659 @param Address MMIO register to read.
1660 @param StartBit The ordinal of the least significant bit in the bit field.
1662 @param EndBit The ordinal of the most significant bit in the bit field.
1665 @return The value read.
1670 MmioBitFieldRead16 (
1677 Writes a bit field to a MMIO register.
1679 Writes Value to the bit field of the MMIO register. The bit field is
1680 specified by the StartBit and the EndBit. All other bits in the destination
1681 MMIO register are preserved. The new value of the 16-bit register is returned.
1683 If 16-bit MMIO register operations are not supported, then ASSERT().
1684 If Address is not aligned on a 16-bit boundary, then ASSERT().
1685 If StartBit is greater than 15, then ASSERT().
1686 If EndBit is greater than 15, then ASSERT().
1687 If EndBit is less than StartBit, then ASSERT().
1688 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1690 @param Address MMIO register to write.
1691 @param StartBit The ordinal of the least significant bit in the bit field.
1693 @param EndBit The ordinal of the most significant bit in the bit field.
1695 @param Value New value of the bit field.
1697 @return The value written back to the MMIO register.
1702 MmioBitFieldWrite16 (
1710 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1711 writes the result back to the bit field in the 16-bit MMIO register.
1713 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1714 OR between the read result and the value specified by OrData, and
1715 writes the result to the 16-bit MMIO register specified by Address. The value
1716 written to the MMIO register is returned. This function must guarantee that
1717 all MMIO read and write operations are serialized. Extra left bits in OrData
1720 If 16-bit MMIO register operations are not supported, then ASSERT().
1721 If Address is not aligned on a 16-bit boundary, then ASSERT().
1722 If StartBit is greater than 15, then ASSERT().
1723 If EndBit is greater than 15, then ASSERT().
1724 If EndBit is less than StartBit, then ASSERT().
1725 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1727 @param Address MMIO register to write.
1728 @param StartBit The ordinal of the least significant bit in the bit field.
1730 @param EndBit The ordinal of the most significant bit in the bit field.
1732 @param OrData The value to OR with read value from the MMIO register.
1734 @return The value written back to the MMIO register.
1747 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1748 writes the result back to the bit field in the 16-bit MMIO register.
1750 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1751 between the read result and the value specified by AndData, and writes the
1752 result to the 16-bit MMIO register specified by Address. The value written to
1753 the MMIO register is returned. This function must guarantee that all MMIO
1754 read and write operations are serialized. Extra left bits in AndData are
1757 If 16-bit MMIO register operations are not supported, then ASSERT().
1758 If Address is not aligned on a 16-bit boundary, then ASSERT().
1759 If StartBit is greater than 15, then ASSERT().
1760 If EndBit is greater than 15, then ASSERT().
1761 If EndBit is less than StartBit, then ASSERT().
1762 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1764 @param Address MMIO register to write.
1765 @param StartBit The ordinal of the least significant bit in the bit field.
1767 @param EndBit The ordinal of the most significant bit in the bit field.
1769 @param AndData The value to AND with read value from the MMIO register.
1771 @return The value written back to the MMIO register.
1784 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1785 by a bitwise OR, and writes the result back to the bit field in the
1786 16-bit MMIO register.
1788 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1789 followed by a bitwise OR between the read result and the value
1790 specified by AndData, and writes the result to the 16-bit MMIO register
1791 specified by Address. The value written to the MMIO register is returned.
1792 This function must guarantee that all MMIO read and write operations are
1793 serialized. Extra left bits in both AndData and OrData are stripped.
1795 If 16-bit MMIO register operations are not supported, then ASSERT().
1796 If Address is not aligned on a 16-bit boundary, then ASSERT().
1797 If StartBit is greater than 15, then ASSERT().
1798 If EndBit is greater than 15, then ASSERT().
1799 If EndBit is less than StartBit, then ASSERT().
1800 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1801 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1803 @param Address MMIO register to write.
1804 @param StartBit The ordinal of the least significant bit in the bit field.
1806 @param EndBit The ordinal of the most significant bit in the bit field.
1808 @param AndData The value to AND with read value from the MMIO register.
1809 @param OrData The value to OR with the result of the AND operation.
1811 @return The value written back to the MMIO register.
1816 MmioBitFieldAndThenOr16 (
1825 Reads a 32-bit MMIO register.
1827 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1828 returned. This function must guarantee that all MMIO read and write
1829 operations are serialized.
1831 If 32-bit MMIO register operations are not supported, then ASSERT().
1832 If Address is not aligned on a 32-bit boundary, then ASSERT().
1834 @param Address The MMIO register to read.
1836 @return The value read.
1846 Writes a 32-bit MMIO register.
1848 Writes the 32-bit MMIO register specified by Address with the value specified
1849 by Value and returns Value. This function must guarantee that all MMIO read
1850 and write operations are serialized.
1852 If 32-bit MMIO register operations are not supported, then ASSERT().
1853 If Address is not aligned on a 32-bit boundary, then ASSERT().
1855 @param Address The MMIO register to write.
1856 @param Value The value to write to the MMIO register.
1869 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1870 result back to the 32-bit MMIO register.
1872 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1873 OR between the read result and the value specified by OrData, and
1874 writes the result to the 32-bit MMIO register specified by Address. The value
1875 written to the MMIO register is returned. This function must guarantee that
1876 all MMIO read and write operations are serialized.
1878 If 32-bit MMIO register operations are not supported, then ASSERT().
1879 If Address is not aligned on a 32-bit boundary, then ASSERT().
1881 @param Address The MMIO register to write.
1882 @param OrData The value to OR with the read value from the MMIO register.
1884 @return The value written back to the MMIO register.
1895 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1896 back to the 32-bit MMIO register.
1898 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1899 between the read result and the value specified by AndData, and writes the
1900 result to the 32-bit MMIO register specified by Address. The value written to
1901 the MMIO register is returned. This function must guarantee that all MMIO
1902 read and write operations are serialized.
1904 If 32-bit MMIO register operations are not supported, then ASSERT().
1905 If Address is not aligned on a 32-bit boundary, then ASSERT().
1907 @param Address The MMIO register to write.
1908 @param AndData The value to AND with the read value from the MMIO register.
1910 @return The value written back to the MMIO register.
1921 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1922 OR, and writes the result back to the 32-bit MMIO register.
1924 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1925 between the read result and the value specified by AndData, performs a
1926 bitwise OR between the result of the AND operation and the value specified by
1927 OrData, and writes the result to the 32-bit MMIO register specified by
1928 Address. The value written to the MMIO register is returned. This function
1929 must guarantee that all MMIO read and write operations are serialized.
1931 If 32-bit MMIO register operations are not supported, then ASSERT().
1932 If Address is not aligned on a 32-bit boundary, then ASSERT().
1934 @param Address The MMIO register to write.
1935 @param AndData The value to AND with the read value from the MMIO register.
1936 @param OrData The value to OR with the result of the AND operation.
1938 @return The value written back to the MMIO register.
1950 Reads a bit field of a MMIO register.
1952 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1953 the StartBit and the EndBit. The value of the bit field is returned.
1955 If 32-bit MMIO register operations are not supported, then ASSERT().
1956 If Address is not aligned on a 32-bit boundary, then ASSERT().
1957 If StartBit is greater than 31, then ASSERT().
1958 If EndBit is greater than 31, then ASSERT().
1959 If EndBit is less than StartBit, then ASSERT().
1961 @param Address MMIO register to read.
1962 @param StartBit The ordinal of the least significant bit in the bit field.
1964 @param EndBit The ordinal of the most significant bit in the bit field.
1967 @return The value read.
1972 MmioBitFieldRead32 (
1979 Writes a bit field to a MMIO register.
1981 Writes Value to the bit field of the MMIO register. The bit field is
1982 specified by the StartBit and the EndBit. All other bits in the destination
1983 MMIO register are preserved. The new value of the 32-bit register is returned.
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().
1990 If Value is larger than the bitmask value range specified by StartBit and EndBit, 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 Value New value of the bit field.
1999 @return The value written back to the MMIO register.
2004 MmioBitFieldWrite32 (
2012 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, 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
2016 OR between the read result and the value specified by OrData, and
2017 writes the result to the 32-bit MMIO register specified by Address. The value
2018 written to the MMIO register is returned. This function must guarantee that
2019 all MMIO read and write operations are serialized. Extra left bits in OrData
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().
2027 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2029 @param Address MMIO register to write.
2030 @param StartBit The ordinal of the least significant bit in the bit field.
2032 @param EndBit The ordinal of the most significant bit in the bit field.
2034 @param OrData The value to OR with read value from the MMIO register.
2036 @return The value written back to the MMIO register.
2049 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2050 writes the result back to the bit field in the 32-bit MMIO register.
2052 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2053 between the read result and the value specified by AndData, and writes the
2054 result to the 32-bit MMIO register specified by Address. The value written to
2055 the MMIO register is returned. This function must guarantee that all MMIO
2056 read and write operations are serialized. Extra left bits in AndData are
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().
2064 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2066 @param Address MMIO register to write.
2067 @param StartBit The ordinal of the least significant bit in the bit field.
2069 @param EndBit The ordinal of the most significant bit in the bit field.
2071 @param AndData The value to AND with read value from the MMIO register.
2073 @return The value written back to the MMIO register.
2086 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2087 by a bitwise OR, and writes the result back to the bit field in the
2088 32-bit MMIO register.
2090 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2091 followed by a bitwise OR between the read result and the value
2092 specified by AndData, and writes the result to the 32-bit MMIO register
2093 specified by Address. The value written to the MMIO register is returned.
2094 This function must guarantee that all MMIO read and write operations are
2095 serialized. Extra left bits in both AndData and OrData are stripped.
2097 If 32-bit MMIO register operations are not supported, then ASSERT().
2098 If Address is not aligned on a 32-bit boundary, then ASSERT().
2099 If StartBit is greater than 31, then ASSERT().
2100 If EndBit is greater than 31, then ASSERT().
2101 If EndBit is less than StartBit, then ASSERT().
2102 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2103 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2105 @param Address MMIO register to write.
2106 @param StartBit The ordinal of the least significant bit in the bit field.
2108 @param EndBit The ordinal of the most significant bit in the bit field.
2110 @param AndData The value to AND with read value from the MMIO register.
2111 @param OrData The value to OR with the result of the AND operation.
2113 @return The value written back to the MMIO register.
2118 MmioBitFieldAndThenOr32 (
2127 Reads a 64-bit MMIO register.
2129 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2130 returned. This function must guarantee that all MMIO read and write
2131 operations are serialized.
2133 If 64-bit MMIO register operations are not supported, then ASSERT().
2134 If Address is not aligned on a 64-bit boundary, then ASSERT().
2136 @param Address The MMIO register to read.
2138 @return The value read.
2148 Writes a 64-bit MMIO register.
2150 Writes the 64-bit MMIO register specified by Address with the value specified
2151 by Value and returns Value. This function must guarantee that all MMIO read
2152 and write operations are serialized.
2154 If 64-bit MMIO register operations are not supported, then ASSERT().
2155 If Address is not aligned on a 64-bit boundary, then ASSERT().
2157 @param Address The MMIO register to write.
2158 @param Value The value to write to the MMIO register.
2169 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2170 result back to the 64-bit MMIO register.
2172 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2173 OR between the read result and the value specified by OrData, and
2174 writes the result to the 64-bit MMIO register specified by Address. The value
2175 written to the MMIO register is returned. This function must guarantee that
2176 all MMIO read and write operations are serialized.
2178 If 64-bit MMIO register operations are not supported, then ASSERT().
2179 If Address is not aligned on a 64-bit boundary, then ASSERT().
2181 @param Address The MMIO register to write.
2182 @param OrData The value to OR with the read value from the MMIO register.
2184 @return The value written back to the MMIO register.
2195 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2196 back to the 64-bit MMIO register.
2198 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2199 between the read result and the value specified by AndData, and writes the
2200 result to the 64-bit MMIO register specified by Address. The value written to
2201 the MMIO register is returned. This function must guarantee that all MMIO
2202 read and write operations are serialized.
2204 If 64-bit MMIO register operations are not supported, then ASSERT().
2205 If Address is not aligned on a 64-bit boundary, then ASSERT().
2207 @param Address The MMIO register to write.
2208 @param AndData The value to AND with the read value from the MMIO register.
2210 @return The value written back to the MMIO register.
2221 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2222 OR, and writes the result back to the 64-bit MMIO register.
2224 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2225 between the read result and the value specified by AndData, performs a
2226 bitwise OR between the result of the AND operation and the value specified by
2227 OrData, and writes the result to the 64-bit MMIO register specified by
2228 Address. The value written to the MMIO register is returned. This function
2229 must guarantee that all MMIO read and write operations are serialized.
2231 If 64-bit MMIO register operations are not supported, then ASSERT().
2232 If Address is not aligned on a 64-bit boundary, then ASSERT().
2234 @param Address The MMIO register to write.
2235 @param AndData The value to AND with the read value from the MMIO register.
2236 @param OrData The value to OR with the result of the AND operation.
2238 @return The value written back to the MMIO register.
2250 Reads a bit field of a MMIO register.
2252 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2253 the StartBit and the EndBit. The value of the bit field is returned.
2255 If 64-bit MMIO register operations are not supported, then ASSERT().
2256 If Address is not aligned on a 64-bit boundary, then ASSERT().
2257 If StartBit is greater than 63, then ASSERT().
2258 If EndBit is greater than 63, then ASSERT().
2259 If EndBit is less than StartBit, then ASSERT().
2261 @param Address MMIO register to read.
2262 @param StartBit The ordinal of the least significant bit in the bit field.
2264 @param EndBit The ordinal of the most significant bit in the bit field.
2267 @return The value read.
2272 MmioBitFieldRead64 (
2279 Writes a bit field to a MMIO register.
2281 Writes Value to the bit field of the MMIO register. The bit field is
2282 specified by the StartBit and the EndBit. All other bits in the destination
2283 MMIO register are preserved. The new value of the 64-bit register is returned.
2285 If 64-bit MMIO register operations are not supported, then ASSERT().
2286 If Address is not aligned on a 64-bit boundary, then ASSERT().
2287 If StartBit is greater than 63, then ASSERT().
2288 If EndBit is greater than 63, then ASSERT().
2289 If EndBit is less than StartBit, then ASSERT().
2290 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2292 @param Address MMIO register to write.
2293 @param StartBit The ordinal of the least significant bit in the bit field.
2295 @param EndBit The ordinal of the most significant bit in the bit field.
2297 @param Value New value of the bit field.
2299 @return The value written back to the MMIO register.
2304 MmioBitFieldWrite64 (
2312 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2313 writes the result back to the bit field in the 64-bit MMIO register.
2315 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2316 OR between the read result and the value specified by OrData, and
2317 writes the result to the 64-bit MMIO register specified by Address. The value
2318 written to the MMIO register is returned. This function must guarantee that
2319 all MMIO read and write operations are serialized. Extra left bits in OrData
2322 If 64-bit MMIO register operations are not supported, then ASSERT().
2323 If Address is not aligned on a 64-bit boundary, then ASSERT().
2324 If StartBit is greater than 63, then ASSERT().
2325 If EndBit is greater than 63, then ASSERT().
2326 If EndBit is less than StartBit, then ASSERT().
2327 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2329 @param Address MMIO register to write.
2330 @param StartBit The ordinal of the least significant bit in the bit field.
2332 @param EndBit The ordinal of the most significant bit in the bit field.
2334 @param OrData The value to OR with read value from the MMIO register.
2336 @return The value written back to the MMIO register.
2349 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2350 writes the result back to the bit field in the 64-bit MMIO register.
2352 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2353 between the read result and the value specified by AndData, and writes the
2354 result to the 64-bit MMIO register specified by Address. The value written to
2355 the MMIO register is returned. This function must guarantee that all MMIO
2356 read and write operations are serialized. Extra left bits in AndData are
2359 If 64-bit MMIO register operations are not supported, then ASSERT().
2360 If Address is not aligned on a 64-bit boundary, then ASSERT().
2361 If StartBit is greater than 63, then ASSERT().
2362 If EndBit is greater than 63, then ASSERT().
2363 If EndBit is less than StartBit, then ASSERT().
2364 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2366 @param Address MMIO register to write.
2367 @param StartBit The ordinal of the least significant bit in the bit field.
2369 @param EndBit The ordinal of the most significant bit in the bit field.
2371 @param AndData The value to AND with read value from the MMIO register.
2373 @return The value written back to the MMIO register.
2386 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2387 by a bitwise OR, and writes the result back to the bit field in the
2388 64-bit MMIO register.
2390 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2391 followed by a bitwise OR between the read result and the value
2392 specified by AndData, and writes the result to the 64-bit MMIO register
2393 specified by Address. The value written to the MMIO register is returned.
2394 This function must guarantee that all MMIO read and write operations are
2395 serialized. Extra left bits in both AndData and OrData are stripped.
2397 If 64-bit MMIO register operations are not supported, then ASSERT().
2398 If Address is not aligned on a 64-bit boundary, then ASSERT().
2399 If StartBit is greater than 63, then ASSERT().
2400 If EndBit is greater than 63, then ASSERT().
2401 If EndBit is less than StartBit, then ASSERT().
2402 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2403 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2405 @param Address MMIO register to write.
2406 @param StartBit The ordinal of the least significant bit in the bit field.
2408 @param EndBit The ordinal of the most significant bit in the bit field.
2410 @param AndData The value to AND with read value from the MMIO register.
2411 @param OrData The value to OR with the result of the AND operation.
2413 @return The value written back to the MMIO register.
2418 MmioBitFieldAndThenOr64 (
2427 Copy data from MMIO region to system memory by using 8-bit access.
2429 Copy data from MMIO region specified by starting address StartAddress
2430 to system memory specified by Buffer by using 8-bit access. The total
2431 number of byte to be copied is specified by Length. Buffer is returned.
2433 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2434 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2437 @param StartAddress Starting address for the MMIO region to be copied from.
2438 @param Length The size, in bytes, of Buffer.
2439 @param Buffer Pointer to a system memory buffer receiving the data read.
2447 IN UINTN StartAddress
,
2453 Copy data from MMIO region to system memory by using 16-bit access.
2455 Copy data from MMIO region specified by starting address StartAddress
2456 to system memory specified by Buffer by using 16-bit access. The total
2457 number of byte to be copied is specified by Length. Buffer is returned.
2459 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2461 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2462 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2464 If Length is not aligned on a 16-bit boundary, then ASSERT().
2465 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2467 @param StartAddress Starting address for the MMIO region to be copied from.
2468 @param Length The size, in bytes, of Buffer.
2469 @param Buffer Pointer to a system memory buffer receiving the data read.
2477 IN UINTN StartAddress
,
2483 Copy data from MMIO region to system memory by using 32-bit access.
2485 Copy data from MMIO region specified by starting address StartAddress
2486 to system memory specified by Buffer by using 32-bit access. The total
2487 number of byte to be copied is specified by Length. Buffer is returned.
2489 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2491 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2492 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2494 If Length is not aligned on a 32-bit boundary, then ASSERT().
2495 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2497 @param StartAddress Starting address for the MMIO region to be copied from.
2498 @param Length The size, in bytes, of Buffer.
2499 @param Buffer Pointer to a system memory buffer receiving the data read.
2507 IN UINTN StartAddress
,
2513 Copy data from MMIO region to system memory by using 64-bit access.
2515 Copy data from MMIO region specified by starting address StartAddress
2516 to system memory specified by Buffer by using 64-bit access. The total
2517 number of byte to be copied is specified by Length. Buffer is returned.
2519 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2521 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2522 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2524 If Length is not aligned on a 64-bit boundary, then ASSERT().
2525 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2527 @param StartAddress Starting address for the MMIO region to be copied from.
2528 @param Length The size, in bytes, of Buffer.
2529 @param Buffer Pointer to a system memory buffer receiving the data read.
2537 IN UINTN StartAddress
,
2543 Copy data from system memory to MMIO region by using 8-bit access.
2545 Copy data from system memory specified by Buffer to MMIO region specified
2546 by starting address StartAddress by using 8-bit access. The total number
2547 of byte to be copied is specified by Length. Buffer is returned.
2549 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2550 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2553 @param StartAddress Starting address for the MMIO region to be copied to.
2554 @param Length The size, in bytes, of Buffer.
2555 @param Buffer Pointer to a system memory buffer containing the data to write.
2563 IN UINTN StartAddress
,
2565 IN CONST UINT8
*Buffer
2569 Copy data from system memory to MMIO region by using 16-bit access.
2571 Copy data from system memory specified by Buffer to MMIO region specified
2572 by starting address StartAddress by using 16-bit access. The total number
2573 of byte to be copied is specified by Length. Buffer is returned.
2575 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2577 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2578 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2580 If Length is not aligned on a 16-bit boundary, then ASSERT().
2582 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2584 @param StartAddress Starting address for the MMIO region to be copied to.
2585 @param Length The size, in bytes, of Buffer.
2586 @param Buffer Pointer to a system memory buffer containing the data to write.
2594 IN UINTN StartAddress
,
2596 IN CONST UINT16
*Buffer
2600 Copy data from system memory to MMIO region by using 32-bit access.
2602 Copy data from system memory specified by Buffer to MMIO region specified
2603 by starting address StartAddress by using 32-bit access. The total number
2604 of byte to be copied is specified by Length. Buffer is returned.
2606 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2608 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2609 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2611 If Length is not aligned on a 32-bit boundary, then ASSERT().
2613 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2615 @param StartAddress Starting address for the MMIO region to be copied to.
2616 @param Length The size, in bytes, of Buffer.
2617 @param Buffer Pointer to a system memory buffer containing the data to write.
2625 IN UINTN StartAddress
,
2627 IN CONST UINT32
*Buffer
2631 Copy data from system memory to MMIO region by using 64-bit access.
2633 Copy data from system memory specified by Buffer to MMIO region specified
2634 by starting address StartAddress by using 64-bit access. The total number
2635 of byte to be copied is specified by Length. Buffer is returned.
2637 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2639 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2640 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2642 If Length is not aligned on a 64-bit boundary, then ASSERT().
2644 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2646 @param StartAddress Starting address for the MMIO region to be copied to.
2647 @param Length The size, in bytes, of Buffer.
2648 @param Buffer Pointer to a system memory buffer containing the data to write.
2656 IN UINTN StartAddress
,
2658 IN CONST UINT64
*Buffer