]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueIoLib.h
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Public header file for IO Lib
23 #ifndef __EDKII_GLUE_IO_LIB_H__
24 #define __EDKII_GLUE_IO_LIB_H__
27 #define IoRead8(_PORT) GlueIoRead8(_PORT)
28 #define IoWrite8(_PORT,_VALUE) GlueIoWrite8(_PORT,_VALUE)
29 #define IoRead16(_PORT) GlueIoRead16(_PORT)
30 #define IoWrite16(_PORT,_VALUE) GlueIoWrite16(_PORT,_VALUE)
31 #define IoRead32(_PORT) GlueIoRead32(_PORT)
32 #define IoWrite32(_PORT,_VALUE) GlueIoWrite32(_PORT,_VALUE)
35 #define IO_LIB_ADDRESS(Segment,Port) \
36 ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
39 Reads an 8-bit I/O port.
41 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
42 This function must guarantee that all I/O read and write operations are
45 If 8-bit I/O port operations are not supported, then ASSERT().
47 @param Port The I/O port to read.
49 @return The value read.
59 Writes an 8-bit I/O port.
61 Writes the 8-bit I/O port specified by Port with the value specified by Value
62 and returns Value. This function must guarantee that all I/O read and write
63 operations are serialized.
65 If 8-bit I/O port operations are not supported, then ASSERT().
67 @param Port The I/O port to write.
68 @param Value The value to write to the I/O port.
70 @return The value written the I/O port.
81 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
82 result back to the 8-bit I/O port.
84 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
85 between the read result and the value specified by OrData, and writes the
86 result to the 8-bit I/O port specified by Port. The value written to the I/O
87 port is returned. This function must guarantee that all I/O read and write
88 operations are serialized.
90 If 8-bit I/O port operations are not supported, then ASSERT().
92 @param Port The I/O port to write.
93 @param OrData The value to OR with the read value from the I/O port.
95 @return The value written back to the I/O port.
106 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
107 to the 8-bit I/O port.
109 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
110 the read result and the value specified by AndData, and writes the result to
111 the 8-bit I/O port specified by Port. The value written to the I/O port is
112 returned. This function must guarantee that all I/O read and write operations
115 If 8-bit I/O port operations are not supported, then ASSERT().
117 @param Port The I/O port to write.
118 @param AndData The value to AND with the read value from the I/O port.
120 @return The value written back to the I/O port.
131 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
132 inclusive OR, and writes the result back to the 8-bit I/O port.
134 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
135 the read result and the value specified by AndData, performs a bitwise OR
136 between the result of the AND operation and the value specified by OrData,
137 and writes the result to the 8-bit I/O port specified by Port. The value
138 written to the I/O port is returned. This function must guarantee that all
139 I/O read and write operations are serialized.
141 If 8-bit I/O port operations are not supported, then ASSERT().
143 @param Port The I/O port to write.
144 @param AndData The value to AND with the read value from the I/O port.
145 @param OrData The value to OR with the result of the AND operation.
147 @return The value written back to the I/O port.
159 Reads a bit field of an I/O register.
161 Reads the bit field in an 8-bit I/O register. The bit field is specified by
162 the StartBit and the EndBit. The value of the bit field is returned.
164 If 8-bit I/O port operations are not supported, then ASSERT().
165 If StartBit is greater than 7, then ASSERT().
166 If EndBit is greater than 7, then ASSERT().
167 If EndBit is less than StartBit, then ASSERT().
169 @param Port The I/O port to read.
170 @param StartBit The ordinal of the least significant bit in the bit field.
172 @param EndBit The ordinal of the most significant bit in the bit field.
175 @return The value read.
187 Writes a bit field to an I/O register.
189 Writes Value to the bit field of the I/O register. The bit field is specified
190 by the StartBit and the EndBit. All other bits in the destination I/O
191 register are preserved. The value written to the I/O port is returned. Extra
192 left bits in Value are stripped.
194 If 8-bit I/O port operations are not supported, then ASSERT().
195 If StartBit is greater than 7, then ASSERT().
196 If EndBit is greater than 7, then ASSERT().
197 If EndBit is less than StartBit, then ASSERT().
199 @param Port The I/O port to write.
200 @param StartBit The ordinal of the least significant bit in the bit field.
202 @param EndBit The ordinal of the most significant bit in the bit field.
204 @param Value New value of the bit field.
206 @return The value written back to the I/O port.
219 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
220 result back to the bit field in the 8-bit port.
222 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
223 between the read result and the value specified by OrData, and writes the
224 result to the 8-bit I/O port specified by Port. The value written to the I/O
225 port is returned. This function must guarantee that all I/O read and write
226 operations are serialized. Extra left bits in OrData are stripped.
228 If 8-bit I/O port operations are not supported, then ASSERT().
229 If StartBit is greater than 7, then ASSERT().
230 If EndBit is greater than 7, then ASSERT().
231 If EndBit is less than StartBit, then ASSERT().
233 @param Port The I/O port to write.
234 @param StartBit The ordinal of the least significant bit in the bit field.
236 @param EndBit The ordinal of the most significant bit in the bit field.
238 @param OrData The value to OR with the read value from the I/O port.
240 @return The value written back to the I/O port.
253 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
254 result back to the bit field in the 8-bit port.
256 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
257 the read result and the value specified by AndData, and writes the result to
258 the 8-bit I/O port specified by Port. The value written to the I/O port is
259 returned. This function must guarantee that all I/O read and write operations
260 are serialized. Extra left bits in AndData are stripped.
262 If 8-bit I/O port operations are not supported, then ASSERT().
263 If StartBit is greater than 7, then ASSERT().
264 If EndBit is greater than 7, then ASSERT().
265 If EndBit is less than StartBit, 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 inclusive 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 inclusive 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().
303 @param Port The I/O port to write.
304 @param StartBit The ordinal of the least significant bit in the bit field.
306 @param EndBit The ordinal of the most significant bit in the bit field.
308 @param AndData The value to AND with the read value from the I/O port.
309 @param OrData The value to OR with the result of the AND operation.
311 @return The value written back to the I/O port.
316 IoBitFieldAndThenOr8 (
325 Reads a 16-bit I/O port.
327 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
328 This function must guarantee that all I/O read and write operations are
331 If 16-bit I/O port operations are not supported, then ASSERT().
333 @param Port The I/O port to read.
335 @return The value read.
345 Writes a 16-bit I/O port.
347 Writes the 16-bit I/O port specified by Port with the value specified by Value
348 and returns Value. This function must guarantee that all I/O read and write
349 operations are serialized.
351 If 16-bit I/O port operations are not supported, 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().
378 @param Port The I/O port to write.
379 @param OrData The value to OR with the read value from the I/O port.
381 @return The value written back to the I/O port.
392 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
393 to the 16-bit I/O port.
395 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
396 the read result and the value specified by AndData, and writes the result to
397 the 16-bit I/O port specified by Port. The value written to the I/O port is
398 returned. This function must guarantee that all I/O read and write operations
401 If 16-bit I/O port operations are not supported, then ASSERT().
403 @param Port The I/O port to write.
404 @param AndData The value to AND with the read value from the I/O port.
406 @return The value written back to the I/O port.
417 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
418 inclusive OR, and writes the result back to the 16-bit I/O port.
420 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
421 the read result and the value specified by AndData, performs a bitwise OR
422 between the result of the AND operation and the value specified by OrData,
423 and writes the result to the 16-bit I/O port specified by Port. The value
424 written to the I/O port is returned. This function must guarantee that all
425 I/O read and write operations are serialized.
427 If 16-bit I/O port operations are not supported, then ASSERT().
429 @param Port The I/O port to write.
430 @param AndData The value to AND with the read value from the I/O port.
431 @param OrData The value to OR with the result of the AND operation.
433 @return The value written back to the I/O port.
445 Reads a bit field of an I/O register.
447 Reads the bit field in a 16-bit I/O register. The bit field is specified by
448 the StartBit and the EndBit. The value of the bit field is returned.
450 If 16-bit I/O port operations are not supported, then ASSERT().
451 If StartBit is greater than 15, then ASSERT().
452 If EndBit is greater than 15, then ASSERT().
453 If EndBit is less than StartBit, then ASSERT().
455 @param Port The I/O port to read.
456 @param StartBit The ordinal of the least significant bit in the bit field.
458 @param EndBit The ordinal of the most significant bit in the bit field.
461 @return The value read.
473 Writes a bit field to an I/O register.
475 Writes Value to the bit field of the I/O register. The bit field is specified
476 by the StartBit and the EndBit. All other bits in the destination I/O
477 register are preserved. The value written to the I/O port is returned. Extra
478 left bits in Value are stripped.
480 If 16-bit I/O port operations are not supported, then ASSERT().
481 If StartBit is greater than 15, then ASSERT().
482 If EndBit is greater than 15, then ASSERT().
483 If EndBit is less than StartBit, then ASSERT().
485 @param Port The I/O port to write.
486 @param StartBit The ordinal of the least significant bit in the bit field.
488 @param EndBit The ordinal of the most significant bit in the bit field.
490 @param Value New value of the bit field.
492 @return The value written back to the I/O port.
505 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
506 result back to the bit field in the 16-bit port.
508 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
509 between the read result and the value specified by OrData, and writes the
510 result to the 16-bit I/O port specified by Port. The value written to the I/O
511 port is returned. This function must guarantee that all I/O read and write
512 operations are serialized. Extra left bits in OrData are stripped.
514 If 16-bit I/O port operations are not supported, then ASSERT().
515 If StartBit is greater than 15, then ASSERT().
516 If EndBit is greater than 15, then ASSERT().
517 If EndBit is less than StartBit, then ASSERT().
519 @param Port The I/O port to write.
520 @param StartBit The ordinal of the least significant bit in the bit field.
522 @param EndBit The ordinal of the most significant bit in the bit field.
524 @param OrData The value to OR with the read value from the I/O port.
526 @return The value written back to the I/O port.
539 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
540 result back to the bit field in the 16-bit port.
542 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
543 the read result and the value specified by AndData, and writes the result to
544 the 16-bit I/O port specified by Port. The value written to the I/O port is
545 returned. This function must guarantee that all I/O read and write operations
546 are serialized. Extra left bits in AndData are stripped.
548 If 16-bit I/O port operations are not supported, then ASSERT().
549 If StartBit is greater than 15, then ASSERT().
550 If EndBit is greater than 15, then ASSERT().
551 If EndBit is less than StartBit, then ASSERT().
553 @param Port The I/O port to write.
554 @param StartBit The ordinal of the least significant bit in the bit field.
556 @param EndBit The ordinal of the most significant bit in the bit field.
558 @param AndData The value to AND with the read value from the I/O port.
560 @return The value written back to the I/O port.
573 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
574 bitwise inclusive OR, and writes the result back to the bit field in the
577 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
578 by a bitwise inclusive OR between the read result and the value specified by
579 AndData, and writes the result to the 16-bit I/O port specified by Port. The
580 value written to the I/O port is returned. This function must guarantee that
581 all I/O read and write operations are serialized. Extra left bits in both
582 AndData and OrData are stripped.
584 If 16-bit I/O port operations are not supported, then ASSERT().
585 If StartBit is greater than 15, then ASSERT().
586 If EndBit is greater than 15, then ASSERT().
587 If EndBit is less than StartBit, then ASSERT().
589 @param Port The I/O port to write.
590 @param StartBit The ordinal of the least significant bit in the bit field.
592 @param EndBit The ordinal of the most significant bit in the bit field.
594 @param AndData The value to AND with the read value from the I/O port.
595 @param OrData The value to OR with the result of the AND operation.
597 @return The value written back to the I/O port.
602 IoBitFieldAndThenOr16 (
611 Reads a 32-bit I/O port.
613 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
614 This function must guarantee that all I/O read and write operations are
617 If 32-bit I/O port operations are not supported, then ASSERT().
619 @param Port The I/O port to read.
621 @return The value read.
631 Writes a 32-bit I/O port.
633 Writes the 32-bit I/O port specified by Port with the value specified by Value
634 and returns Value. This function must guarantee that all I/O read and write
635 operations are serialized.
637 If 32-bit I/O port operations are not supported, then ASSERT().
639 @param Port The I/O port to write.
640 @param Value The value to write to the I/O port.
642 @return The value written the I/O port.
653 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
654 result back to the 32-bit I/O port.
656 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
657 between the read result and the value specified by OrData, and writes the
658 result to the 32-bit I/O port specified by Port. The value written to the I/O
659 port is returned. This function must guarantee that all I/O read and write
660 operations are serialized.
662 If 32-bit I/O port operations are not supported, then ASSERT().
664 @param Port The I/O port to write.
665 @param OrData The value to OR with the read value from the I/O port.
667 @return The value written back to the I/O port.
678 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
679 to the 32-bit I/O port.
681 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
682 the read result and the value specified by AndData, and writes the result to
683 the 32-bit I/O port specified by Port. The value written to the I/O port is
684 returned. This function must guarantee that all I/O read and write operations
687 If 32-bit I/O port operations are not supported, then ASSERT().
689 @param Port The I/O port to write.
690 @param AndData The value to AND with the read value from the I/O port.
692 @return The value written back to the I/O port.
703 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
704 inclusive OR, and writes the result back to the 32-bit I/O port.
706 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
707 the read result and the value specified by AndData, performs a bitwise OR
708 between the result of the AND operation and the value specified by OrData,
709 and writes the result to the 32-bit I/O port specified by Port. The value
710 written to the I/O port is returned. This function must guarantee that all
711 I/O read and write operations are serialized.
713 If 32-bit I/O port operations are not supported, then ASSERT().
715 @param Port The I/O port to write.
716 @param AndData The value to AND with the read value from the I/O port.
717 @param OrData The value to OR with the result of the AND operation.
719 @return The value written back to the I/O port.
731 Reads a bit field of an I/O register.
733 Reads the bit field in a 32-bit I/O register. The bit field is specified by
734 the StartBit and the EndBit. The value of the bit field is returned.
736 If 32-bit I/O port operations are not supported, then ASSERT().
737 If StartBit is greater than 31, then ASSERT().
738 If EndBit is greater than 31, then ASSERT().
739 If EndBit is less than StartBit, then ASSERT().
741 @param Port The I/O port to read.
742 @param StartBit The ordinal of the least significant bit in the bit field.
744 @param EndBit The ordinal of the most significant bit in the bit field.
747 @return The value read.
759 Writes a bit field to an I/O register.
761 Writes Value to the bit field of the I/O register. The bit field is specified
762 by the StartBit and the EndBit. All other bits in the destination I/O
763 register are preserved. The value written to the I/O port is returned. Extra
764 left bits in Value are stripped.
766 If 32-bit I/O port operations are not supported, then ASSERT().
767 If StartBit is greater than 31, then ASSERT().
768 If EndBit is greater than 31, then ASSERT().
769 If EndBit is less than StartBit, then ASSERT().
771 @param Port The I/O port to write.
772 @param StartBit The ordinal of the least significant bit in the bit field.
774 @param EndBit The ordinal of the most significant bit in the bit field.
776 @param Value New value of the bit field.
778 @return The value written back to the I/O port.
791 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
792 result back to the bit field in the 32-bit port.
794 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
795 between the read result and the value specified by OrData, and writes the
796 result to the 32-bit I/O port specified by Port. The value written to the I/O
797 port is returned. This function must guarantee that all I/O read and write
798 operations are serialized. Extra left bits in OrData are stripped.
800 If 32-bit I/O port operations are not supported, then ASSERT().
801 If StartBit is greater than 31, then ASSERT().
802 If EndBit is greater than 31, then ASSERT().
803 If EndBit is less than StartBit, then ASSERT().
805 @param Port The I/O port to write.
806 @param StartBit The ordinal of the least significant bit in the bit field.
808 @param EndBit The ordinal of the most significant bit in the bit field.
810 @param OrData The value to OR with the read value from the I/O port.
812 @return The value written back to the I/O port.
825 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
826 result back to the bit field in the 32-bit port.
828 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
829 the read result and the value specified by AndData, and writes the result to
830 the 32-bit I/O port specified by Port. The value written to the I/O port is
831 returned. This function must guarantee that all I/O read and write operations
832 are serialized. Extra left bits in AndData are stripped.
834 If 32-bit I/O port operations are not supported, then ASSERT().
835 If StartBit is greater than 31, then ASSERT().
836 If EndBit is greater than 31, then ASSERT().
837 If EndBit is less than StartBit, then ASSERT().
839 @param Port The I/O port to write.
840 @param StartBit The ordinal of the least significant bit in the bit field.
842 @param EndBit The ordinal of the most significant bit in the bit field.
844 @param AndData The value to AND with the read value from the I/O port.
846 @return The value written back to the I/O port.
859 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
860 bitwise inclusive OR, and writes the result back to the bit field in the
863 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
864 by a bitwise inclusive OR between the read result and the value specified by
865 AndData, and writes the result to the 32-bit I/O port specified by Port. The
866 value written to the I/O port is returned. This function must guarantee that
867 all I/O read and write operations are serialized. Extra left bits in both
868 AndData and OrData are stripped.
870 If 32-bit I/O port operations are not supported, then ASSERT().
871 If StartBit is greater than 31, then ASSERT().
872 If EndBit is greater than 31, then ASSERT().
873 If EndBit is less than StartBit, then ASSERT().
875 @param Port The I/O port to write.
876 @param StartBit The ordinal of the least significant bit in the bit field.
878 @param EndBit The ordinal of the most significant bit in the bit field.
880 @param AndData The value to AND with the read value from the I/O port.
881 @param OrData The value to OR with the result of the AND operation.
883 @return The value written back to the I/O port.
888 IoBitFieldAndThenOr32 (
897 Reads a 64-bit I/O port.
899 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
900 This function must guarantee that all I/O read and write operations are
903 If 64-bit I/O port operations are not supported, then ASSERT().
905 @param Port The I/O port to read.
907 @return The value read.
917 Writes a 64-bit I/O port.
919 Writes the 64-bit I/O port specified by Port with the value specified by Value
920 and returns Value. This function must guarantee that all I/O read and write
921 operations are serialized.
923 If 64-bit I/O port operations are not supported, then ASSERT().
925 @param Port The I/O port to write.
926 @param Value The value to write to the I/O port.
928 @return The value written the I/O port.
939 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
940 result back to the 64-bit I/O port.
942 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
943 between the read result and the value specified by OrData, and writes the
944 result to the 64-bit I/O port specified by Port. The value written to the I/O
945 port is returned. This function must guarantee that all I/O read and write
946 operations are serialized.
948 If 64-bit I/O port operations are not supported, then ASSERT().
950 @param Port The I/O port to write.
951 @param OrData The value to OR with the read value from the I/O port.
953 @return The value written back to the I/O port.
964 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
965 to the 64-bit I/O port.
967 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
968 the read result and the value specified by AndData, and writes the result to
969 the 64-bit I/O port specified by Port. The value written to the I/O port is
970 returned. This function must guarantee that all I/O read and write operations
973 If 64-bit I/O port operations are not supported, then ASSERT().
975 @param Port The I/O port to write.
976 @param AndData The value to AND with the read value from the I/O port.
978 @return The value written back to the I/O port.
989 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
990 inclusive OR, and writes the result back to the 64-bit I/O port.
992 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
993 the read result and the value specified by AndData, performs a bitwise OR
994 between the result of the AND operation and the value specified by OrData,
995 and writes the result to the 64-bit I/O port specified by Port. The value
996 written to the I/O port is returned. This function must guarantee that all
997 I/O read and write operations are serialized.
999 If 64-bit I/O port operations are not supported, then ASSERT().
1001 @param Port The I/O port to write.
1002 @param AndData The value to AND with the read value from the I/O port.
1003 @param OrData The value to OR with the result of the AND operation.
1005 @return The value written back to the I/O port.
1017 Reads a bit field of an I/O register.
1019 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1020 the StartBit and the EndBit. The value of the bit field is returned.
1022 If 64-bit I/O port operations are not supported, then ASSERT().
1023 If StartBit is greater than 63, then ASSERT().
1024 If EndBit is greater than 63, then ASSERT().
1025 If EndBit is less than StartBit, then ASSERT().
1027 @param Port The I/O port to read.
1028 @param StartBit The ordinal of the least significant bit in the bit field.
1030 @param EndBit The ordinal of the most significant bit in the bit field.
1033 @return The value read.
1045 Writes a bit field to an I/O register.
1047 Writes Value to the bit field of the I/O register. The bit field is specified
1048 by the StartBit and the EndBit. All other bits in the destination I/O
1049 register are preserved. The value written to the I/O port is returned. Extra
1050 left bits in Value are stripped.
1052 If 64-bit I/O port operations are not supported, then ASSERT().
1053 If StartBit is greater than 63, then ASSERT().
1054 If EndBit is greater than 63, then ASSERT().
1055 If EndBit is less than StartBit, then ASSERT().
1057 @param Port The I/O port to write.
1058 @param StartBit The ordinal of the least significant bit in the bit field.
1060 @param EndBit The ordinal of the most significant bit in the bit field.
1062 @param Value New value of the bit field.
1064 @return The value written back to the I/O port.
1077 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1078 result back to the bit field in the 64-bit port.
1080 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1081 between the read result and the value specified by OrData, and writes the
1082 result to the 64-bit I/O port specified by Port. The value written to the I/O
1083 port is returned. This function must guarantee that all I/O read and write
1084 operations are serialized. Extra left bits in OrData are stripped.
1086 If 64-bit I/O port operations are not supported, then ASSERT().
1087 If StartBit is greater than 63, then ASSERT().
1088 If EndBit is greater than 63, then ASSERT().
1089 If EndBit is less than StartBit, then ASSERT().
1091 @param Port The I/O port to write.
1092 @param StartBit The ordinal of the least significant bit in the bit field.
1094 @param EndBit The ordinal of the most significant bit in the bit field.
1096 @param OrData The value to OR with the read value from the I/O port.
1098 @return The value written back to the I/O port.
1111 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1112 result back to the bit field in the 64-bit port.
1114 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1115 the read result and the value specified by AndData, and writes the result to
1116 the 64-bit I/O port specified by Port. The value written to the I/O port is
1117 returned. This function must guarantee that all I/O read and write operations
1118 are serialized. Extra left bits in AndData are stripped.
1120 If 64-bit I/O port operations are not supported, then ASSERT().
1121 If StartBit is greater than 63, then ASSERT().
1122 If EndBit is greater than 63, then ASSERT().
1123 If EndBit is less than StartBit, then ASSERT().
1125 @param Port The I/O port to write.
1126 @param StartBit The ordinal of the least significant bit in the bit field.
1128 @param EndBit The ordinal of the most significant bit in the bit field.
1130 @param AndData The value to AND with the read value from the I/O port.
1132 @return The value written back to the I/O port.
1145 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1146 bitwise inclusive OR, and writes the result back to the bit field in the
1149 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1150 by a bitwise inclusive OR between the read result and the value specified by
1151 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1152 value written to the I/O port is returned. This function must guarantee that
1153 all I/O read and write operations are serialized. Extra left bits in both
1154 AndData and OrData are stripped.
1156 If 64-bit I/O port operations are not supported, then ASSERT().
1157 If StartBit is greater than 63, then ASSERT().
1158 If EndBit is greater than 63, then ASSERT().
1159 If EndBit is less than StartBit, then ASSERT().
1161 @param Port The I/O port to write.
1162 @param StartBit The ordinal of the least significant bit in the bit field.
1164 @param EndBit The ordinal of the most significant bit in the bit field.
1166 @param AndData The value to AND with the read value from the I/O port.
1167 @param OrData The value to OR with the result of the AND operation.
1169 @return The value written back to the I/O port.
1174 IoBitFieldAndThenOr64 (
1183 Reads an 8-bit MMIO register.
1185 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1186 returned. This function must guarantee that all MMIO read and write
1187 operations are serialized.
1189 If 8-bit MMIO register operations are not supported, then ASSERT().
1191 @param Address The MMIO register to read.
1193 @return The value read.
1203 Writes an 8-bit MMIO register.
1205 Writes the 8-bit MMIO register specified by Address with the value specified
1206 by Value and returns Value. This function must guarantee that all MMIO read
1207 and write operations are serialized.
1209 If 8-bit MMIO register operations are not supported, then ASSERT().
1211 @param Address The MMIO register to write.
1212 @param Value The value to write to the MMIO register.
1223 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1224 result back to the 8-bit MMIO register.
1226 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1227 inclusive OR between the read result and the value specified by OrData, and
1228 writes the result to the 8-bit MMIO register specified by Address. The value
1229 written to the MMIO register is returned. This function must guarantee that
1230 all MMIO read and write operations are serialized.
1232 If 8-bit MMIO register operations are not supported, then ASSERT().
1234 @param Address The MMIO register to write.
1235 @param OrData The value to OR with the read value from the MMIO register.
1237 @return The value written back to the MMIO register.
1248 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1249 back to the 8-bit MMIO register.
1251 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1252 between the read result and the value specified by AndData, and writes the
1253 result to the 8-bit MMIO register specified by Address. The value written to
1254 the MMIO register is returned. This function must guarantee that all MMIO
1255 read and write operations are serialized.
1257 If 8-bit MMIO register operations are not supported, then ASSERT().
1259 @param Address The MMIO register to write.
1260 @param AndData The value to AND with the read value from the MMIO register.
1262 @return The value written back to the MMIO register.
1273 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1274 inclusive OR, and writes the result back to the 8-bit MMIO register.
1276 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1277 between the read result and the value specified by AndData, performs a
1278 bitwise OR between the result of the AND operation and the value specified by
1279 OrData, and writes the result to the 8-bit MMIO register specified by
1280 Address. The value written to the MMIO register is returned. This function
1281 must guarantee that all MMIO read and write operations are serialized.
1283 If 8-bit MMIO register operations are not supported, then ASSERT().
1286 @param Address The MMIO register to write.
1287 @param AndData The value to AND with the read value from the MMIO register.
1288 @param OrData The value to OR with the result of the AND operation.
1290 @return The value written back to the MMIO register.
1302 Reads a bit field of a MMIO register.
1304 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1305 the StartBit and the EndBit. The value of the bit field is returned.
1307 If 8-bit MMIO register operations are not supported, then ASSERT().
1308 If StartBit is greater than 7, then ASSERT().
1309 If EndBit is greater than 7, then ASSERT().
1310 If EndBit is less than StartBit, then ASSERT().
1312 @param Address MMIO register to read.
1313 @param StartBit The ordinal of the least significant bit in the bit field.
1315 @param EndBit The ordinal of the most significant bit in the bit field.
1318 @return The value read.
1330 Writes a bit field to a MMIO register.
1332 Writes Value to the bit field of the MMIO register. The bit field is
1333 specified by the StartBit and the EndBit. All other bits in the destination
1334 MMIO register are preserved. The new value of the 8-bit register is returned.
1336 If 8-bit MMIO register operations are not supported, then ASSERT().
1337 If StartBit is greater than 7, then ASSERT().
1338 If EndBit is greater than 7, then ASSERT().
1339 If EndBit is less than StartBit, then ASSERT().
1341 @param Address MMIO register to write.
1342 @param StartBit The ordinal of the least significant bit in the bit field.
1344 @param EndBit The ordinal of the most significant bit in the bit field.
1346 @param Value New value of the bit field.
1348 @return The value written back to the MMIO register.
1353 MmioBitFieldWrite8 (
1361 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1362 writes the result back to the bit field in the 8-bit MMIO register.
1364 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1365 inclusive OR between the read result and the value specified by OrData, and
1366 writes the result to the 8-bit MMIO register specified by Address. The value
1367 written to the MMIO register is returned. This function must guarantee that
1368 all MMIO read and write operations are serialized. Extra left bits in OrData
1371 If 8-bit MMIO register operations are not supported, then ASSERT().
1372 If StartBit is greater than 7, then ASSERT().
1373 If EndBit is greater than 7, then ASSERT().
1374 If EndBit is less than StartBit, then ASSERT().
1376 @param Address MMIO register to write.
1377 @param StartBit The ordinal of the least significant bit in the bit field.
1379 @param EndBit The ordinal of the most significant bit in the bit field.
1381 @param OrData The value to OR with read value from the MMIO register.
1383 @return The value written back to the MMIO register.
1396 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1397 writes the result back to the bit field in the 8-bit MMIO register.
1399 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1400 between the read result and the value specified by AndData, and writes the
1401 result to the 8-bit MMIO register specified by Address. The value written to
1402 the MMIO register is returned. This function must guarantee that all MMIO
1403 read and write operations are serialized. Extra left bits in AndData are
1406 If 8-bit MMIO register operations are not supported, then ASSERT().
1407 If StartBit is greater than 7, then ASSERT().
1408 If EndBit is greater than 7, then ASSERT().
1409 If EndBit is less than StartBit, then ASSERT().
1411 @param Address MMIO register to write.
1412 @param StartBit The ordinal of the least significant bit in the bit field.
1414 @param EndBit The ordinal of the most significant bit in the bit field.
1416 @param AndData The value to AND with read value from the MMIO register.
1418 @return The value written back to the MMIO register.
1431 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1432 by a bitwise inclusive OR, and writes the result back to the bit field in the
1433 8-bit MMIO register.
1435 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1436 followed by a bitwise inclusive OR between the read result and the value
1437 specified by AndData, and writes the result to the 8-bit MMIO register
1438 specified by Address. The value written to the MMIO register is returned.
1439 This function must guarantee that all MMIO read and write operations are
1440 serialized. Extra left bits in both AndData and OrData are stripped.
1442 If 8-bit MMIO register operations are not supported, then ASSERT().
1443 If StartBit is greater than 7, then ASSERT().
1444 If EndBit is greater than 7, then ASSERT().
1445 If EndBit is less than StartBit, then ASSERT().
1447 @param Address MMIO register to write.
1448 @param StartBit The ordinal of the least significant bit in the bit field.
1450 @param EndBit The ordinal of the most significant bit in the bit field.
1452 @param AndData The value to AND with read value from the MMIO register.
1453 @param OrData The value to OR with the result of the AND operation.
1455 @return The value written back to the MMIO register.
1460 MmioBitFieldAndThenOr8 (
1469 Reads a 16-bit MMIO register.
1471 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1472 returned. This function must guarantee that all MMIO read and write
1473 operations are serialized.
1475 If 16-bit MMIO register operations are not supported, then ASSERT().
1477 @param Address The MMIO register to read.
1479 @return The value read.
1489 Writes a 16-bit MMIO register.
1491 Writes the 16-bit MMIO register specified by Address with the value specified
1492 by Value and returns Value. This function must guarantee that all MMIO read
1493 and write operations are serialized.
1495 If 16-bit MMIO register operations are not supported, then ASSERT().
1497 @param Address The MMIO register to write.
1498 @param Value The value to write to the MMIO register.
1509 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1510 result back to the 16-bit MMIO register.
1512 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1513 inclusive OR between the read result and the value specified by OrData, and
1514 writes the result to the 16-bit MMIO register specified by Address. The value
1515 written to the MMIO register is returned. This function must guarantee that
1516 all MMIO read and write operations are serialized.
1518 If 16-bit MMIO register operations are not supported, then ASSERT().
1520 @param Address The MMIO register to write.
1521 @param OrData The value to OR with the read value from the MMIO register.
1523 @return The value written back to the MMIO register.
1534 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1535 back to the 16-bit MMIO register.
1537 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1538 between the read result and the value specified by AndData, and writes the
1539 result to the 16-bit MMIO register specified by Address. The value written to
1540 the MMIO register is returned. This function must guarantee that all MMIO
1541 read and write operations are serialized.
1543 If 16-bit MMIO register operations are not supported, then ASSERT().
1545 @param Address The MMIO register to write.
1546 @param AndData The value to AND with the read value from the MMIO register.
1548 @return The value written back to the MMIO register.
1559 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1560 inclusive OR, and writes the result back to the 16-bit MMIO register.
1562 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1563 between the read result and the value specified by AndData, performs a
1564 bitwise OR between the result of the AND operation and the value specified by
1565 OrData, and writes the result to the 16-bit MMIO register specified by
1566 Address. The value written to the MMIO register is returned. This function
1567 must guarantee that all MMIO read and write operations are serialized.
1569 If 16-bit MMIO register operations are not supported, then ASSERT().
1572 @param Address The MMIO register to write.
1573 @param AndData The value to AND with the read value from the MMIO register.
1574 @param OrData The value to OR with the result of the AND operation.
1576 @return The value written back to the MMIO register.
1588 Reads a bit field of a MMIO register.
1590 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1591 the StartBit and the EndBit. The value of the bit field is returned.
1593 If 16-bit MMIO register operations are not supported, then ASSERT().
1594 If StartBit is greater than 15, then ASSERT().
1595 If EndBit is greater than 15, then ASSERT().
1596 If EndBit is less than StartBit, then ASSERT().
1598 @param Address MMIO register to read.
1599 @param StartBit The ordinal of the least significant bit in the bit field.
1601 @param EndBit The ordinal of the most significant bit in the bit field.
1604 @return The value read.
1609 MmioBitFieldRead16 (
1616 Writes a bit field to a MMIO register.
1618 Writes Value to the bit field of the MMIO register. The bit field is
1619 specified by the StartBit and the EndBit. All other bits in the destination
1620 MMIO register are preserved. The new value of the 16-bit register is returned.
1622 If 16-bit MMIO register operations are not supported, then ASSERT().
1623 If StartBit is greater than 15, then ASSERT().
1624 If EndBit is greater than 15, then ASSERT().
1625 If EndBit is less than StartBit, then ASSERT().
1627 @param Address MMIO register to write.
1628 @param StartBit The ordinal of the least significant bit in the bit field.
1630 @param EndBit The ordinal of the most significant bit in the bit field.
1632 @param Value New value of the bit field.
1634 @return The value written back to the MMIO register.
1639 MmioBitFieldWrite16 (
1647 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1648 writes the result back to the bit field in the 16-bit MMIO register.
1650 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1651 inclusive OR between the read result and the value specified by OrData, and
1652 writes the result to the 16-bit MMIO register specified by Address. The value
1653 written to the MMIO register is returned. This function must guarantee that
1654 all MMIO read and write operations are serialized. Extra left bits in OrData
1657 If 16-bit MMIO register operations are not supported, then ASSERT().
1658 If StartBit is greater than 15, then ASSERT().
1659 If EndBit is greater than 15, then ASSERT().
1660 If EndBit is less than StartBit, then ASSERT().
1662 @param Address MMIO register to write.
1663 @param StartBit The ordinal of the least significant bit in the bit field.
1665 @param EndBit The ordinal of the most significant bit in the bit field.
1667 @param OrData The value to OR with read value from the MMIO register.
1669 @return The value written back to the MMIO register.
1682 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1683 writes the result back to the bit field in the 16-bit MMIO register.
1685 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1686 between the read result and the value specified by AndData, and writes the
1687 result to the 16-bit MMIO register specified by Address. The value written to
1688 the MMIO register is returned. This function must guarantee that all MMIO
1689 read and write operations are serialized. Extra left bits in AndData are
1692 If 16-bit MMIO register operations are not supported, 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 AndData The value to AND 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 followed
1718 by a bitwise inclusive OR, and writes the result back to the bit field in the
1719 16-bit MMIO register.
1721 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1722 followed by a bitwise inclusive OR between the read result and the value
1723 specified by AndData, and writes the result to the 16-bit MMIO register
1724 specified by Address. The value written to the MMIO register is returned.
1725 This function must guarantee that all MMIO read and write operations are
1726 serialized. Extra left bits in both AndData and OrData are stripped.
1728 If 16-bit MMIO register operations are not supported, 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.
1739 @param OrData The value to OR with the result of the AND operation.
1741 @return The value written back to the MMIO register.
1746 MmioBitFieldAndThenOr16 (
1755 Reads a 32-bit MMIO register.
1757 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1758 returned. This function must guarantee that all MMIO read and write
1759 operations are serialized.
1761 If 32-bit MMIO register operations are not supported, then ASSERT().
1763 @param Address The MMIO register to read.
1765 @return The value read.
1775 Writes a 32-bit MMIO register.
1777 Writes the 32-bit MMIO register specified by Address with the value specified
1778 by Value and returns Value. This function must guarantee that all MMIO read
1779 and write operations are serialized.
1781 If 32-bit MMIO register operations are not supported, then ASSERT().
1783 @param Address The MMIO register to write.
1784 @param Value The value to write to the MMIO register.
1795 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1796 result back to the 32-bit MMIO register.
1798 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1799 inclusive OR between the read result and the value specified by OrData, and
1800 writes the result to the 32-bit MMIO register specified by Address. The value
1801 written to the MMIO register is returned. This function must guarantee that
1802 all MMIO read and write operations are serialized.
1804 If 32-bit MMIO register operations are not supported, then ASSERT().
1806 @param Address The MMIO register to write.
1807 @param OrData The value to OR with the read value from the MMIO register.
1809 @return The value written back to the MMIO register.
1820 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1821 back to the 32-bit MMIO register.
1823 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1824 between the read result and the value specified by AndData, and writes the
1825 result to the 32-bit MMIO register specified by Address. The value written to
1826 the MMIO register is returned. This function must guarantee that all MMIO
1827 read and write operations are serialized.
1829 If 32-bit MMIO register operations are not supported, then ASSERT().
1831 @param Address The MMIO register to write.
1832 @param AndData The value to AND with the read value from the MMIO register.
1834 @return The value written back to the MMIO register.
1845 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1846 inclusive OR, and writes the result back to the 32-bit MMIO register.
1848 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1849 between the read result and the value specified by AndData, performs a
1850 bitwise OR between the result of the AND operation and the value specified by
1851 OrData, and writes the result to the 32-bit MMIO register specified by
1852 Address. The value written to the MMIO register is returned. This function
1853 must guarantee that all MMIO read and write operations are serialized.
1855 If 32-bit MMIO register operations are not supported, then ASSERT().
1858 @param Address The MMIO register to write.
1859 @param AndData The value to AND with the read value from the MMIO register.
1860 @param OrData The value to OR with the result of the AND operation.
1862 @return The value written back to the MMIO register.
1874 Reads a bit field of a MMIO register.
1876 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1877 the StartBit and the EndBit. The value of the bit field is returned.
1879 If 32-bit MMIO register operations are not supported, then ASSERT().
1880 If StartBit is greater than 31, then ASSERT().
1881 If EndBit is greater than 31, then ASSERT().
1882 If EndBit is less than StartBit, then ASSERT().
1884 @param Address MMIO register to read.
1885 @param StartBit The ordinal of the least significant bit in the bit field.
1887 @param EndBit The ordinal of the most significant bit in the bit field.
1890 @return The value read.
1895 MmioBitFieldRead32 (
1902 Writes a bit field to a MMIO register.
1904 Writes Value to the bit field of the MMIO register. The bit field is
1905 specified by the StartBit and the EndBit. All other bits in the destination
1906 MMIO register are preserved. The new value of the 32-bit register is returned.
1908 If 32-bit MMIO register operations are not supported, then ASSERT().
1909 If StartBit is greater than 31, then ASSERT().
1910 If EndBit is greater than 31, then ASSERT().
1911 If EndBit is less than StartBit, then ASSERT().
1913 @param Address MMIO register to write.
1914 @param StartBit The ordinal of the least significant bit in the bit field.
1916 @param EndBit The ordinal of the most significant bit in the bit field.
1918 @param Value New value of the bit field.
1920 @return The value written back to the MMIO register.
1925 MmioBitFieldWrite32 (
1933 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1934 writes the result back to the bit field in the 32-bit MMIO register.
1936 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1937 inclusive OR between the read result and the value specified by OrData, and
1938 writes the result to the 32-bit MMIO register specified by Address. The value
1939 written to the MMIO register is returned. This function must guarantee that
1940 all MMIO read and write operations are serialized. Extra left bits in OrData
1943 If 32-bit MMIO register operations are not supported, then ASSERT().
1944 If StartBit is greater than 31, then ASSERT().
1945 If EndBit is greater than 31, then ASSERT().
1946 If EndBit is less than StartBit, then ASSERT().
1948 @param Address MMIO register to write.
1949 @param StartBit The ordinal of the least significant bit in the bit field.
1951 @param EndBit The ordinal of the most significant bit in the bit field.
1953 @param OrData The value to OR with read value from the MMIO register.
1955 @return The value written back to the MMIO register.
1968 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1969 writes the result back to the bit field in the 32-bit MMIO register.
1971 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1972 between the read result and the value specified by AndData, and writes the
1973 result to the 32-bit MMIO register specified by Address. The value written to
1974 the MMIO register is returned. This function must guarantee that all MMIO
1975 read and write operations are serialized. Extra left bits in AndData are
1978 If 32-bit MMIO register operations are not supported, then ASSERT().
1979 If StartBit is greater than 31, then ASSERT().
1980 If EndBit is greater than 31, then ASSERT().
1981 If EndBit is less than StartBit, then ASSERT().
1983 @param Address MMIO register to write.
1984 @param StartBit The ordinal of the least significant bit in the bit field.
1986 @param EndBit The ordinal of the most significant bit in the bit field.
1988 @param AndData The value to AND with read value from the MMIO register.
1990 @return The value written back to the MMIO register.
2003 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2004 by a bitwise inclusive OR, and writes the result back to the bit field in the
2005 32-bit MMIO register.
2007 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2008 followed by a bitwise inclusive OR between the read result and the value
2009 specified by AndData, and writes the result to the 32-bit MMIO register
2010 specified by Address. The value written to the MMIO register is returned.
2011 This function must guarantee that all MMIO read and write operations are
2012 serialized. Extra left bits in both AndData and OrData are stripped.
2014 If 32-bit MMIO register operations are not supported, then ASSERT().
2015 If StartBit is greater than 31, then ASSERT().
2016 If EndBit is greater than 31, then ASSERT().
2017 If EndBit is less than StartBit, then ASSERT().
2019 @param Address MMIO register to write.
2020 @param StartBit The ordinal of the least significant bit in the bit field.
2022 @param EndBit The ordinal of the most significant bit in the bit field.
2024 @param AndData The value to AND with read value from the MMIO register.
2025 @param OrData The value to OR with the result of the AND operation.
2027 @return The value written back to the MMIO register.
2032 MmioBitFieldAndThenOr32 (
2041 Reads a 64-bit MMIO register.
2043 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2044 returned. This function must guarantee that all MMIO read and write
2045 operations are serialized.
2047 If 64-bit MMIO register operations are not supported, then ASSERT().
2049 @param Address The MMIO register to read.
2051 @return The value read.
2061 Writes a 64-bit MMIO register.
2063 Writes the 64-bit MMIO register specified by Address with the value specified
2064 by Value and returns Value. This function must guarantee that all MMIO read
2065 and write operations are serialized.
2067 If 64-bit MMIO register operations are not supported, then ASSERT().
2069 @param Address The MMIO register to write.
2070 @param Value The value to write to the MMIO register.
2081 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
2082 result back to the 64-bit MMIO register.
2084 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2085 inclusive OR between the read result and the value specified by OrData, and
2086 writes the result to the 64-bit MMIO register specified by Address. The value
2087 written to the MMIO register is returned. This function must guarantee that
2088 all MMIO read and write operations are serialized.
2090 If 64-bit MMIO register operations are not supported, then ASSERT().
2092 @param Address The MMIO register to write.
2093 @param OrData The value to OR with the read value from the MMIO register.
2095 @return The value written back to the MMIO register.
2106 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2107 back to the 64-bit MMIO register.
2109 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2110 between the read result and the value specified by AndData, and writes the
2111 result to the 64-bit MMIO register specified by Address. The value written to
2112 the MMIO register is returned. This function must guarantee that all MMIO
2113 read and write operations are serialized.
2115 If 64-bit MMIO register operations are not supported, then ASSERT().
2117 @param Address The MMIO register to write.
2118 @param AndData The value to AND with the read value from the MMIO register.
2120 @return The value written back to the MMIO register.
2131 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2132 inclusive OR, and writes the result back to the 64-bit MMIO register.
2134 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2135 between the read result and the value specified by AndData, performs a
2136 bitwise OR between the result of the AND operation and the value specified by
2137 OrData, and writes the result to the 64-bit MMIO register specified by
2138 Address. The value written to the MMIO register is returned. This function
2139 must guarantee that all MMIO read and write operations are serialized.
2141 If 64-bit MMIO register operations are not supported, then ASSERT().
2144 @param Address The MMIO register to write.
2145 @param AndData The value to AND with the read value from the MMIO register.
2146 @param OrData The value to OR with the result of the AND operation.
2148 @return The value written back to the MMIO register.
2160 Reads a bit field of a MMIO register.
2162 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2163 the StartBit and the EndBit. The value of the bit field is returned.
2165 If 64-bit MMIO register operations are not supported, then ASSERT().
2166 If StartBit is greater than 63, then ASSERT().
2167 If EndBit is greater than 63, then ASSERT().
2168 If EndBit is less than StartBit, then ASSERT().
2170 @param Address MMIO register to read.
2171 @param StartBit The ordinal of the least significant bit in the bit field.
2173 @param EndBit The ordinal of the most significant bit in the bit field.
2176 @return The value read.
2181 MmioBitFieldRead64 (
2188 Writes a bit field to a MMIO register.
2190 Writes Value to the bit field of the MMIO register. The bit field is
2191 specified by the StartBit and the EndBit. All other bits in the destination
2192 MMIO register are preserved. The new value of the 64-bit register is returned.
2194 If 64-bit MMIO register operations are not supported, then ASSERT().
2195 If StartBit is greater than 63, then ASSERT().
2196 If EndBit is greater than 63, then ASSERT().
2197 If EndBit is less than StartBit, then ASSERT().
2199 @param Address MMIO register to write.
2200 @param StartBit The ordinal of the least significant bit in the bit field.
2202 @param EndBit The ordinal of the most significant bit in the bit field.
2204 @param Value New value of the bit field.
2206 @return The value written back to the MMIO register.
2211 MmioBitFieldWrite64 (
2219 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2220 writes the result back to the bit field in the 64-bit MMIO register.
2222 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2223 inclusive OR between the read result and the value specified by OrData, and
2224 writes the result to the 64-bit MMIO register specified by Address. The value
2225 written to the MMIO register is returned. This function must guarantee that
2226 all MMIO read and write operations are serialized. Extra left bits in OrData
2229 If 64-bit MMIO register operations are not supported, then ASSERT().
2230 If StartBit is greater than 63, then ASSERT().
2231 If EndBit is greater than 63, then ASSERT().
2232 If EndBit is less than StartBit, then ASSERT().
2234 @param Address MMIO register to write.
2235 @param StartBit The ordinal of the least significant bit in the bit field.
2237 @param EndBit The ordinal of the most significant bit in the bit field.
2239 @param OrData The value to OR with read value from the MMIO register.
2241 @return The value written back to the MMIO register.
2254 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2255 writes the result back to the bit field in the 64-bit MMIO register.
2257 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2258 between the read result and the value specified by AndData, and writes the
2259 result to the 64-bit MMIO register specified by Address. The value written to
2260 the MMIO register is returned. This function must guarantee that all MMIO
2261 read and write operations are serialized. Extra left bits in AndData are
2264 If 64-bit MMIO register operations are not supported, then ASSERT().
2265 If StartBit is greater than 63, then ASSERT().
2266 If EndBit is greater than 63, then ASSERT().
2267 If EndBit is less than StartBit, then ASSERT().
2269 @param Address MMIO register to write.
2270 @param StartBit The ordinal of the least significant bit in the bit field.
2272 @param EndBit The ordinal of the most significant bit in the bit field.
2274 @param AndData The value to AND with read value from the MMIO register.
2276 @return The value written back to the MMIO register.
2289 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2290 by a bitwise inclusive OR, and writes the result back to the bit field in the
2291 64-bit MMIO register.
2293 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2294 followed by a bitwise inclusive OR between the read result and the value
2295 specified by AndData, and writes the result to the 64-bit MMIO register
2296 specified by Address. The value written to the MMIO register is returned.
2297 This function must guarantee that all MMIO read and write operations are
2298 serialized. Extra left bits in both AndData and OrData are stripped.
2300 If 64-bit MMIO register operations are not supported, then ASSERT().
2301 If StartBit is greater than 63, then ASSERT().
2302 If EndBit is greater than 63, then ASSERT().
2303 If EndBit is less than StartBit, then ASSERT().
2305 @param Address MMIO register to write.
2306 @param StartBit The ordinal of the least significant bit in the bit field.
2308 @param EndBit The ordinal of the most significant bit in the bit field.
2310 @param AndData The value to AND with read value from the MMIO register.
2311 @param OrData The value to OR with the result of the AND operation.
2313 @return The value written back to the MMIO register.
2318 MmioBitFieldAndThenOr64 (
2327 Copy data from MMIO region to system memory by using 8-bit access.
2329 Copy data from MMIO region specified by starting address StartAddress
2330 to system memory specified by Buffer by using 8-bit access. The total
2331 number of byte to be copied is specified by Length. Buffer is returned.
2333 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2334 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2337 @param StartAddress Starting address for the MMIO region to be copied from.
2338 @param Length Size in bytes of the copy.
2339 @param Buffer Pointer to a system memory buffer receiving the data read.
2347 IN UINTN StartAddress
,
2353 Copy data from MMIO region to system memory by using 16-bit access.
2355 Copy data from MMIO region specified by starting address StartAddress
2356 to system memory specified by Buffer by using 16-bit access. The total
2357 number of byte to be copied is specified by Length. Buffer is returned.
2359 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2361 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2362 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2364 If Length is not aligned on a 16-bit boundary, then ASSERT().
2365 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2367 @param StartAddress Starting address for the MMIO region to be copied from.
2368 @param Length Size in bytes of the copy.
2369 @param Buffer Pointer to a system memory buffer receiving the data read.
2377 IN UINTN StartAddress
,
2383 Copy data from MMIO region to system memory by using 32-bit access.
2385 Copy data from MMIO region specified by starting address StartAddress
2386 to system memory specified by Buffer by using 32-bit access. The total
2387 number of byte to be copied is specified by Length. Buffer is returned.
2389 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2391 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2392 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2394 If Length is not aligned on a 32-bit boundary, then ASSERT().
2395 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2397 @param StartAddress Starting address for the MMIO region to be copied from.
2398 @param Length Size in bytes of the copy.
2399 @param Buffer Pointer to a system memory buffer receiving the data read.
2407 IN UINTN StartAddress
,
2413 Copy data from MMIO region to system memory by using 64-bit access.
2415 Copy data from MMIO region specified by starting address StartAddress
2416 to system memory specified by Buffer by using 64-bit access. The total
2417 number of byte to be copied is specified by Length. Buffer is returned.
2419 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2421 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2422 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2424 If Length is not aligned on a 64-bit boundary, then ASSERT().
2425 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2427 @param StartAddress Starting address for the MMIO region to be copied from.
2428 @param Length Size in bytes of the copy.
2429 @param Buffer Pointer to a system memory buffer receiving the data read.
2437 IN UINTN StartAddress
,
2443 Copy data from system memory to MMIO region by using 8-bit access.
2445 Copy data from system memory specified by Buffer to MMIO region specified
2446 by starting address StartAddress by using 8-bit access. The total number
2447 of byte to be copied is specified by Length. Buffer is returned.
2449 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2450 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2453 @param StartAddress Starting address for the MMIO region to be copied to.
2454 @param Length Size in bytes of the copy.
2455 @param Buffer Pointer to a system memory buffer containing the data to write.
2457 @return Size in bytes of the copy.
2463 IN UINTN StartAddress
,
2465 IN CONST UINT8
*Buffer
2469 Copy data from system memory to MMIO region by using 16-bit access.
2471 Copy data from system memory specified by Buffer to MMIO region specified
2472 by starting address StartAddress by using 16-bit access. The total number
2473 of byte to be copied is specified by Length. Length is returned.
2475 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2477 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2478 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2480 If Length is not aligned on a 16-bit boundary, then ASSERT().
2482 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2484 @param StartAddress Starting address for the MMIO region to be copied to.
2485 @param Length Size in bytes of the copy.
2486 @param Buffer Pointer to a system memory buffer containing the data to write.
2488 @return Size in bytes of the copy.
2494 IN UINTN StartAddress
,
2496 IN CONST UINT16
*Buffer
2500 Copy data from system memory to MMIO region by using 32-bit access.
2502 Copy data from system memory specified by Buffer to MMIO region specified
2503 by starting address StartAddress by using 32-bit access. The total number
2504 of byte to be copied is specified by Length. Length is returned.
2506 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2508 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2509 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2511 If Length is not aligned on a 32-bit boundary, then ASSERT().
2513 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2515 @param StartAddress Starting address for the MMIO region to be copied to.
2516 @param Length Size in bytes of the copy.
2517 @param Buffer Pointer to a system memory buffer containing the data to write.
2519 @return Size in bytes of the copy.
2525 IN UINTN StartAddress
,
2527 IN CONST UINT32
*Buffer
2531 Copy data from system memory to MMIO region by using 64-bit access.
2533 Copy data from system memory specified by Buffer to MMIO region specified
2534 by starting address StartAddress by using 64-bit access. The total number
2535 of byte to be copied is specified by Length. Length is returned.
2537 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2539 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2540 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2542 If Length is not aligned on a 64-bit boundary, then ASSERT().
2544 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2546 @param StartAddress Starting address for the MMIO region to be copied to.
2547 @param Length Size in bytes of the copy.
2548 @param Buffer Pointer to a system memory buffer containing the data to write.
2550 @return Size in bytes of the copy.
2556 IN UINTN StartAddress
,
2558 IN CONST UINT64
*Buffer