]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/IoLib.h
2 I/O and MMIO Library Services
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #define IO_LIB_ADDRESS(Segment,Port) \
19 ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
22 Reads an 8-bit I/O port.
24 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
25 This function must guarantee that all I/O read and write operations are
28 If 8-bit I/O port operations are not supported, then ASSERT().
30 @param Port The I/O port to read.
32 @return The value read.
42 Writes an 8-bit I/O port.
44 Writes the 8-bit I/O port specified by Port with the value specified by Value
45 and returns Value. This function must guarantee that all I/O read and write
46 operations are serialized.
48 If 8-bit I/O port operations are not supported, then ASSERT().
50 @param Port The I/O port to write.
51 @param Value The value to write to the I/O port.
53 @return The value written the I/O port.
64 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
65 result back to the 8-bit I/O port.
67 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
68 between the read result and the value specified by OrData, and writes the
69 result to the 8-bit I/O port specified by Port. The value written to the I/O
70 port is returned. This function must guarantee that all I/O read and write
71 operations are serialized.
73 If 8-bit I/O port operations are not supported, then ASSERT().
75 @param Port The I/O port to write.
76 @param OrData The value to OR with the read value from the I/O port.
78 @return The value written back to the I/O port.
89 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
90 to the 8-bit I/O port.
92 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
93 the read result and the value specified by AndData, and writes the result to
94 the 8-bit I/O port specified by Port. The value written to the I/O port is
95 returned. This function must guarantee that all I/O read and write operations
98 If 8-bit I/O port operations are not supported, then ASSERT().
100 @param Port The I/O port to write.
101 @param AndData The value to AND with the read value from the I/O port.
103 @return The value written back to the I/O port.
114 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
115 inclusive OR, and writes the result back to the 8-bit I/O port.
117 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
118 the read result and the value specified by AndData, performs a bitwise OR
119 between the result of the AND operation and the value specified by OrData,
120 and writes the result to the 8-bit I/O port specified by Port. The value
121 written to the I/O port is returned. This function must guarantee that all
122 I/O read and write operations are serialized.
124 If 8-bit I/O port operations are not supported, then ASSERT().
126 @param Port The I/O port to write.
127 @param AndData The value to AND with the read value from the I/O port.
128 @param OrData The value to OR with the result of the AND operation.
130 @return The value written back to the I/O port.
142 Reads a bit field of an I/O register.
144 Reads the bit field in an 8-bit I/O register. The bit field is specified by
145 the StartBit and the EndBit. The value of the bit field is returned.
147 If 8-bit I/O port operations are not supported, then ASSERT().
148 If StartBit is greater than 7, then ASSERT().
149 If EndBit is greater than 7, then ASSERT().
150 If EndBit is less than StartBit, then ASSERT().
152 @param Port The I/O port to read.
153 @param StartBit The ordinal of the least significant bit in the bit field.
155 @param EndBit The ordinal of the most significant bit in the bit field.
158 @return The value read.
170 Writes a bit field to an I/O register.
172 Writes Value to the bit field of the I/O register. The bit field is specified
173 by the StartBit and the EndBit. All other bits in the destination I/O
174 register are preserved. The value written to the I/O port is returned. Extra
175 left bits in Value are stripped.
177 If 8-bit I/O port operations are not supported, then ASSERT().
178 If StartBit is greater than 7, then ASSERT().
179 If EndBit is greater than 7, then ASSERT().
180 If EndBit is less than StartBit, then ASSERT().
182 @param Port The I/O port to write.
183 @param StartBit The ordinal of the least significant bit in the bit field.
185 @param EndBit The ordinal of the most significant bit in the bit field.
187 @param Value New value of the bit field.
189 @return The value written back to the I/O port.
202 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
203 result back to the bit field in the 8-bit port.
205 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
206 between the read result and the value specified by OrData, and writes the
207 result to the 8-bit I/O port specified by Port. The value written to the I/O
208 port is returned. This function must guarantee that all I/O read and write
209 operations are serialized. Extra left bits in OrData are stripped.
211 If 8-bit I/O port operations are not supported, then ASSERT().
212 If StartBit is greater than 7, then ASSERT().
213 If EndBit is greater than 7, then ASSERT().
214 If EndBit is less than StartBit, then ASSERT().
216 @param Port The I/O port to write.
217 @param StartBit The ordinal of the least significant bit in the bit field.
219 @param EndBit The ordinal of the most significant bit in the bit field.
221 @param OrData The value to OR with the read value from the I/O port.
223 @return The value written back to the I/O port.
236 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
237 result back to the bit field in the 8-bit port.
239 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
240 the read result and the value specified by AndData, and writes the result to
241 the 8-bit I/O port specified by Port. The value written to the I/O port is
242 returned. This function must guarantee that all I/O read and write operations
243 are serialized. Extra left bits in AndData are stripped.
245 If 8-bit I/O port operations are not supported, then ASSERT().
246 If StartBit is greater than 7, then ASSERT().
247 If EndBit is greater than 7, then ASSERT().
248 If EndBit is less than StartBit, then ASSERT().
250 @param Port The I/O port to write.
251 @param StartBit The ordinal of the least significant bit in the bit field.
253 @param EndBit The ordinal of the most significant bit in the bit field.
255 @param AndData The value to AND with the read value from the I/O port.
257 @return The value written back to the I/O port.
270 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
271 bitwise inclusive OR, and writes the result back to the bit field in the
274 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
275 by a bitwise inclusive OR between the read result and the value specified by
276 AndData, and writes the result to the 8-bit I/O port specified by Port. The
277 value written to the I/O port is returned. This function must guarantee that
278 all I/O read and write operations are serialized. Extra left bits in both
279 AndData and OrData are stripped.
281 If 8-bit I/O port operations are not supported, then ASSERT().
282 If StartBit is greater than 7, then ASSERT().
283 If EndBit is greater than 7, then ASSERT().
284 If EndBit is less than StartBit, then ASSERT().
286 @param Port The I/O port to write.
287 @param StartBit The ordinal of the least significant bit in the bit field.
289 @param EndBit The ordinal of the most significant bit in the bit field.
291 @param AndData The value to AND with the read value from the I/O port.
292 @param OrData The value to OR with the result of the AND operation.
294 @return The value written back to the I/O port.
299 IoBitFieldAndThenOr8 (
308 Reads a 16-bit I/O port.
310 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
311 This function must guarantee that all I/O read and write operations are
314 If 16-bit I/O port operations are not supported, then ASSERT().
316 @param Port The I/O port to read.
318 @return The value read.
328 Writes a 16-bit I/O port.
330 Writes the 16-bit I/O port specified by Port with the value specified by Value
331 and returns Value. This function must guarantee that all I/O read and write
332 operations are serialized.
334 If 16-bit I/O port operations are not supported, then ASSERT().
336 @param Port The I/O port to write.
337 @param Value The value to write to the I/O port.
339 @return The value written the I/O port.
350 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
351 result back to the 16-bit I/O port.
353 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
354 between the read result and the value specified by OrData, and writes the
355 result to the 16-bit I/O port specified by Port. The value written to the I/O
356 port is returned. This function must guarantee that all I/O read and write
357 operations are serialized.
359 If 16-bit I/O port operations are not supported, then ASSERT().
361 @param Port The I/O port to write.
362 @param OrData The value to OR with the read value from the I/O port.
364 @return The value written back to the I/O port.
375 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
376 to the 16-bit I/O port.
378 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
379 the read result and the value specified by AndData, and writes the result to
380 the 16-bit I/O port specified by Port. The value written to the I/O port is
381 returned. This function must guarantee that all I/O read and write operations
384 If 16-bit I/O port operations are not supported, then ASSERT().
386 @param Port The I/O port to write.
387 @param AndData The value to AND with the read value from the I/O port.
389 @return The value written back to the I/O port.
400 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
401 inclusive OR, and writes the result back to the 16-bit I/O port.
403 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
404 the read result and the value specified by AndData, performs a bitwise OR
405 between the result of the AND operation and the value specified by OrData,
406 and writes the result to the 16-bit I/O port specified by Port. The value
407 written to the I/O port is returned. This function must guarantee that all
408 I/O read and write operations are serialized.
410 If 16-bit I/O port operations are not supported, then ASSERT().
412 @param Port The I/O port to write.
413 @param AndData The value to AND with the read value from the I/O port.
414 @param OrData The value to OR with the result of the AND operation.
416 @return The value written back to the I/O port.
428 Reads a bit field of an I/O register.
430 Reads the bit field in a 16-bit I/O register. The bit field is specified by
431 the StartBit and the EndBit. The value of the bit field is returned.
433 If 16-bit I/O port operations are not supported, then ASSERT().
434 If StartBit is greater than 15, then ASSERT().
435 If EndBit is greater than 15, then ASSERT().
436 If EndBit is less than StartBit, then ASSERT().
438 @param Port The I/O port to read.
439 @param StartBit The ordinal of the least significant bit in the bit field.
441 @param EndBit The ordinal of the most significant bit in the bit field.
444 @return The value read.
456 Writes a bit field to an I/O register.
458 Writes Value to the bit field of the I/O register. The bit field is specified
459 by the StartBit and the EndBit. All other bits in the destination I/O
460 register are preserved. The value written to the I/O port is returned. Extra
461 left bits in Value are stripped.
463 If 16-bit I/O port operations are not supported, then ASSERT().
464 If StartBit is greater than 15, then ASSERT().
465 If EndBit is greater than 15, then ASSERT().
466 If EndBit is less than StartBit, then ASSERT().
468 @param Port The I/O port to write.
469 @param StartBit The ordinal of the least significant bit in the bit field.
471 @param EndBit The ordinal of the most significant bit in the bit field.
473 @param Value New value of the bit field.
475 @return The value written back to the I/O port.
488 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
489 result back to the bit field in the 16-bit port.
491 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
492 between the read result and the value specified by OrData, and writes the
493 result to the 16-bit I/O port specified by Port. The value written to the I/O
494 port is returned. This function must guarantee that all I/O read and write
495 operations are serialized. Extra left bits in OrData are stripped.
497 If 16-bit I/O port operations are not supported, then ASSERT().
498 If StartBit is greater than 15, then ASSERT().
499 If EndBit is greater than 15, then ASSERT().
500 If EndBit is less than StartBit, then ASSERT().
502 @param Port The I/O port to write.
503 @param StartBit The ordinal of the least significant bit in the bit field.
505 @param EndBit The ordinal of the most significant bit in the bit field.
507 @param OrData The value to OR with the read value from the I/O port.
509 @return The value written back to the I/O port.
522 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
523 result back to the bit field in the 16-bit port.
525 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
526 the read result and the value specified by AndData, and writes the result to
527 the 16-bit I/O port specified by Port. The value written to the I/O port is
528 returned. This function must guarantee that all I/O read and write operations
529 are serialized. Extra left bits in AndData are stripped.
531 If 16-bit I/O port operations are not supported, then ASSERT().
532 If StartBit is greater than 15, then ASSERT().
533 If EndBit is greater than 15, then ASSERT().
534 If EndBit is less than StartBit, then ASSERT().
536 @param Port The I/O port to write.
537 @param StartBit The ordinal of the least significant bit in the bit field.
539 @param EndBit The ordinal of the most significant bit in the bit field.
541 @param AndData The value to AND with the read value from the I/O port.
543 @return The value written back to the I/O port.
556 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
557 bitwise inclusive OR, and writes the result back to the bit field in the
560 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
561 by a bitwise inclusive OR between the read result and the value specified by
562 AndData, and writes the result to the 16-bit I/O port specified by Port. The
563 value written to the I/O port is returned. This function must guarantee that
564 all I/O read and write operations are serialized. Extra left bits in both
565 AndData and OrData are stripped.
567 If 16-bit I/O port operations are not supported, then ASSERT().
568 If StartBit is greater than 15, then ASSERT().
569 If EndBit is greater than 15, then ASSERT().
570 If EndBit is less than StartBit, then ASSERT().
572 @param Port The I/O port to write.
573 @param StartBit The ordinal of the least significant bit in the bit field.
575 @param EndBit The ordinal of the most significant bit in the bit field.
577 @param AndData The value to AND with the read value from the I/O port.
578 @param OrData The value to OR with the result of the AND operation.
580 @return The value written back to the I/O port.
585 IoBitFieldAndThenOr16 (
594 Reads a 32-bit I/O port.
596 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
597 This function must guarantee that all I/O read and write operations are
600 If 32-bit I/O port operations are not supported, then ASSERT().
602 @param Port The I/O port to read.
604 @return The value read.
614 Writes a 32-bit I/O port.
616 Writes the 32-bit I/O port specified by Port with the value specified by Value
617 and returns Value. This function must guarantee that all I/O read and write
618 operations are serialized.
620 If 32-bit I/O port operations are not supported, then ASSERT().
622 @param Port The I/O port to write.
623 @param Value The value to write to the I/O port.
625 @return The value written the I/O port.
636 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
637 result back to the 32-bit I/O port.
639 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
640 between the read result and the value specified by OrData, and writes the
641 result to the 32-bit I/O port specified by Port. The value written to the I/O
642 port is returned. This function must guarantee that all I/O read and write
643 operations are serialized.
645 If 32-bit I/O port operations are not supported, then ASSERT().
647 @param Port The I/O port to write.
648 @param OrData The value to OR with the read value from the I/O port.
650 @return The value written back to the I/O port.
661 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
662 to the 32-bit I/O port.
664 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
665 the read result and the value specified by AndData, and writes the result to
666 the 32-bit I/O port specified by Port. The value written to the I/O port is
667 returned. This function must guarantee that all I/O read and write operations
670 If 32-bit I/O port operations are not supported, then ASSERT().
672 @param Port The I/O port to write.
673 @param AndData The value to AND with the read value from the I/O port.
675 @return The value written back to the I/O port.
686 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
687 inclusive OR, and writes the result back to the 32-bit I/O port.
689 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
690 the read result and the value specified by AndData, performs a bitwise OR
691 between the result of the AND operation and the value specified by OrData,
692 and writes the result to the 32-bit I/O port specified by Port. The value
693 written to the I/O port is returned. This function must guarantee that all
694 I/O read and write operations are serialized.
696 If 32-bit I/O port operations are not supported, then ASSERT().
698 @param Port The I/O port to write.
699 @param AndData The value to AND with the read value from the I/O port.
700 @param OrData The value to OR with the result of the AND operation.
702 @return The value written back to the I/O port.
714 Reads a bit field of an I/O register.
716 Reads the bit field in a 32-bit I/O register. The bit field is specified by
717 the StartBit and the EndBit. The value of the bit field is returned.
719 If 32-bit I/O port operations are not supported, then ASSERT().
720 If StartBit is greater than 31, then ASSERT().
721 If EndBit is greater than 31, then ASSERT().
722 If EndBit is less than StartBit, then ASSERT().
724 @param Port The I/O port to read.
725 @param StartBit The ordinal of the least significant bit in the bit field.
727 @param EndBit The ordinal of the most significant bit in the bit field.
730 @return The value read.
742 Writes a bit field to an I/O register.
744 Writes Value to the bit field of the I/O register. The bit field is specified
745 by the StartBit and the EndBit. All other bits in the destination I/O
746 register are preserved. The value written to the I/O port is returned. Extra
747 left bits in Value are stripped.
749 If 32-bit I/O port operations are not supported, then ASSERT().
750 If StartBit is greater than 31, then ASSERT().
751 If EndBit is greater than 31, then ASSERT().
752 If EndBit is less than StartBit, then ASSERT().
754 @param Port The I/O port to write.
755 @param StartBit The ordinal of the least significant bit in the bit field.
757 @param EndBit The ordinal of the most significant bit in the bit field.
759 @param Value New value of the bit field.
761 @return The value written back to the I/O port.
774 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
775 result back to the bit field in the 32-bit port.
777 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
778 between the read result and the value specified by OrData, and writes the
779 result to the 32-bit I/O port specified by Port. The value written to the I/O
780 port is returned. This function must guarantee that all I/O read and write
781 operations are serialized. Extra left bits in OrData are stripped.
783 If 32-bit I/O port operations are not supported, then ASSERT().
784 If StartBit is greater than 31, then ASSERT().
785 If EndBit is greater than 31, then ASSERT().
786 If EndBit is less than StartBit, then ASSERT().
788 @param Port The I/O port to write.
789 @param StartBit The ordinal of the least significant bit in the bit field.
791 @param EndBit The ordinal of the most significant bit in the bit field.
793 @param OrData The value to OR with the read value from the I/O port.
795 @return The value written back to the I/O port.
808 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
809 result back to the bit field in the 32-bit port.
811 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
812 the read result and the value specified by AndData, and writes the result to
813 the 32-bit I/O port specified by Port. The value written to the I/O port is
814 returned. This function must guarantee that all I/O read and write operations
815 are serialized. Extra left bits in AndData are stripped.
817 If 32-bit I/O port operations are not supported, then ASSERT().
818 If StartBit is greater than 31, then ASSERT().
819 If EndBit is greater than 31, then ASSERT().
820 If EndBit is less than StartBit, then ASSERT().
822 @param Port The I/O port to write.
823 @param StartBit The ordinal of the least significant bit in the bit field.
825 @param EndBit The ordinal of the most significant bit in the bit field.
827 @param AndData The value to AND with the read value from the I/O port.
829 @return The value written back to the I/O port.
842 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
843 bitwise inclusive OR, and writes the result back to the bit field in the
846 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
847 by a bitwise inclusive OR between the read result and the value specified by
848 AndData, and writes the result to the 32-bit I/O port specified by Port. The
849 value written to the I/O port is returned. This function must guarantee that
850 all I/O read and write operations are serialized. Extra left bits in both
851 AndData and OrData are stripped.
853 If 32-bit I/O port operations are not supported, then ASSERT().
854 If StartBit is greater than 31, then ASSERT().
855 If EndBit is greater than 31, then ASSERT().
856 If EndBit is less than StartBit, then ASSERT().
858 @param Port The I/O port to write.
859 @param StartBit The ordinal of the least significant bit in the bit field.
861 @param EndBit The ordinal of the most significant bit in the bit field.
863 @param AndData The value to AND with the read value from the I/O port.
864 @param OrData The value to OR with the result of the AND operation.
866 @return The value written back to the I/O port.
871 IoBitFieldAndThenOr32 (
880 Reads a 64-bit I/O port.
882 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
883 This function must guarantee that all I/O read and write operations are
886 If 64-bit I/O port operations are not supported, then ASSERT().
888 @param Port The I/O port to read.
890 @return The value read.
900 Writes a 64-bit I/O port.
902 Writes the 64-bit I/O port specified by Port with the value specified by Value
903 and returns Value. This function must guarantee that all I/O read and write
904 operations are serialized.
906 If 64-bit I/O port operations are not supported, then ASSERT().
908 @param Port The I/O port to write.
909 @param Value The value to write to the I/O port.
911 @return The value written the I/O port.
922 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
923 result back to the 64-bit I/O port.
925 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
926 between the read result and the value specified by OrData, and writes the
927 result to the 64-bit I/O port specified by Port. The value written to the I/O
928 port is returned. This function must guarantee that all I/O read and write
929 operations are serialized.
931 If 64-bit I/O port operations are not supported, then ASSERT().
933 @param Port The I/O port to write.
934 @param OrData The value to OR with the read value from the I/O port.
936 @return The value written back to the I/O port.
947 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
948 to the 64-bit I/O port.
950 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
951 the read result and the value specified by AndData, and writes the result to
952 the 64-bit I/O port specified by Port. The value written to the I/O port is
953 returned. This function must guarantee that all I/O read and write operations
956 If 64-bit I/O port operations are not supported, then ASSERT().
958 @param Port The I/O port to write.
959 @param AndData The value to AND with the read value from the I/O port.
961 @return The value written back to the I/O port.
972 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
973 inclusive OR, and writes the result back to the 64-bit I/O port.
975 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
976 the read result and the value specified by AndData, performs a bitwise OR
977 between the result of the AND operation and the value specified by OrData,
978 and writes the result to the 64-bit I/O port specified by Port. The value
979 written to the I/O port is returned. This function must guarantee that all
980 I/O read and write operations are serialized.
982 If 64-bit I/O port operations are not supported, then ASSERT().
984 @param Port The I/O port to write.
985 @param AndData The value to AND with the read value from the I/O port.
986 @param OrData The value to OR with the result of the AND operation.
988 @return The value written back to the I/O port.
1000 Reads a bit field of an I/O register.
1002 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1003 the StartBit and the EndBit. The value of the bit field is returned.
1005 If 64-bit I/O port operations are not supported, then ASSERT().
1006 If StartBit is greater than 63, then ASSERT().
1007 If EndBit is greater than 63, then ASSERT().
1008 If EndBit is less than StartBit, then ASSERT().
1010 @param Port The I/O port to read.
1011 @param StartBit The ordinal of the least significant bit in the bit field.
1013 @param EndBit The ordinal of the most significant bit in the bit field.
1016 @return The value read.
1028 Writes a bit field to an I/O register.
1030 Writes Value to the bit field of the I/O register. The bit field is specified
1031 by the StartBit and the EndBit. All other bits in the destination I/O
1032 register are preserved. The value written to the I/O port is returned. Extra
1033 left bits in Value are stripped.
1035 If 64-bit I/O port operations are not supported, then ASSERT().
1036 If StartBit is greater than 63, then ASSERT().
1037 If EndBit is greater than 63, then ASSERT().
1038 If EndBit is less than StartBit, then ASSERT().
1040 @param Port The I/O port to write.
1041 @param StartBit The ordinal of the least significant bit in the bit field.
1043 @param EndBit The ordinal of the most significant bit in the bit field.
1045 @param Value New value of the bit field.
1047 @return The value written back to the I/O port.
1060 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1061 result back to the bit field in the 64-bit port.
1063 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1064 between the read result and the value specified by OrData, and writes the
1065 result to the 64-bit I/O port specified by Port. The value written to the I/O
1066 port is returned. This function must guarantee that all I/O read and write
1067 operations are serialized. Extra left bits in OrData are stripped.
1069 If 64-bit I/O port operations are not supported, then ASSERT().
1070 If StartBit is greater than 63, then ASSERT().
1071 If EndBit is greater than 63, then ASSERT().
1072 If EndBit is less than StartBit, then ASSERT().
1074 @param Port The I/O port to write.
1075 @param StartBit The ordinal of the least significant bit in the bit field.
1077 @param EndBit The ordinal of the most significant bit in the bit field.
1079 @param OrData The value to OR with the read value from the I/O port.
1081 @return The value written back to the I/O port.
1094 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1095 result back to the bit field in the 64-bit port.
1097 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1098 the read result and the value specified by AndData, and writes the result to
1099 the 64-bit I/O port specified by Port. The value written to the I/O port is
1100 returned. This function must guarantee that all I/O read and write operations
1101 are serialized. Extra left bits in AndData are stripped.
1103 If 64-bit I/O port operations are not supported, then ASSERT().
1104 If StartBit is greater than 63, then ASSERT().
1105 If EndBit is greater than 63, then ASSERT().
1106 If EndBit is less than StartBit, then ASSERT().
1108 @param Port The I/O port to write.
1109 @param StartBit The ordinal of the least significant bit in the bit field.
1111 @param EndBit The ordinal of the most significant bit in the bit field.
1113 @param AndData The value to AND with the read value from the I/O port.
1115 @return The value written back to the I/O port.
1128 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1129 bitwise inclusive OR, and writes the result back to the bit field in the
1132 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1133 by a bitwise inclusive OR between the read result and the value specified by
1134 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1135 value written to the I/O port is returned. This function must guarantee that
1136 all I/O read and write operations are serialized. Extra left bits in both
1137 AndData and OrData are stripped.
1139 If 64-bit I/O port operations are not supported, then ASSERT().
1140 If StartBit is greater than 63, then ASSERT().
1141 If EndBit is greater than 63, then ASSERT().
1142 If EndBit is less than StartBit, then ASSERT().
1144 @param Port The I/O port to write.
1145 @param StartBit The ordinal of the least significant bit in the bit field.
1147 @param EndBit The ordinal of the most significant bit in the bit field.
1149 @param AndData The value to AND with the read value from the I/O port.
1150 @param OrData The value to OR with the result of the AND operation.
1152 @return The value written back to the I/O port.
1157 IoBitFieldAndThenOr64 (
1166 Reads an 8-bit MMIO register.
1168 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1169 returned. This function must guarantee that all MMIO read and write
1170 operations are serialized.
1172 If 8-bit MMIO register operations are not supported, then ASSERT().
1174 @param Address The MMIO register to read.
1176 @return The value read.
1186 Writes an 8-bit MMIO register.
1188 Writes the 8-bit MMIO register specified by Address with the value specified
1189 by Value and returns Value. This function must guarantee that all MMIO read
1190 and write operations are serialized.
1192 If 8-bit MMIO register operations are not supported, then ASSERT().
1194 @param Address The MMIO register to write.
1195 @param Value The value to write to the MMIO register.
1206 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1207 result back to the 8-bit MMIO register.
1209 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1210 inclusive OR between the read result and the value specified by OrData, and
1211 writes the result to the 8-bit MMIO register specified by Address. The value
1212 written to the MMIO register is returned. This function must guarantee that
1213 all MMIO read and write operations are serialized.
1215 If 8-bit MMIO register operations are not supported, then ASSERT().
1217 @param Address The MMIO register to write.
1218 @param OrData The value to OR with the read value from the MMIO register.
1220 @return The value written back to the MMIO register.
1231 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1232 back to the 8-bit MMIO register.
1234 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1235 between the read result and the value specified by AndData, and writes the
1236 result to the 8-bit MMIO register specified by Address. The value written to
1237 the MMIO register is returned. This function must guarantee that all MMIO
1238 read and write operations are serialized.
1240 If 8-bit MMIO register operations are not supported, then ASSERT().
1242 @param Address The MMIO register to write.
1243 @param AndData The value to AND with the read value from the MMIO register.
1245 @return The value written back to the MMIO register.
1256 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1257 inclusive OR, and writes the result back to the 8-bit MMIO register.
1259 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1260 between the read result and the value specified by AndData, performs a
1261 bitwise OR between the result of the AND operation and the value specified by
1262 OrData, and writes the result to the 8-bit MMIO register specified by
1263 Address. The value written to the MMIO register is returned. This function
1264 must guarantee that all MMIO read and write operations are serialized.
1266 If 8-bit MMIO register operations are not supported, then ASSERT().
1269 @param Address The MMIO register to write.
1270 @param AndData The value to AND with the read value from the MMIO register.
1271 @param OrData The value to OR with the result of the AND operation.
1273 @return The value written back to the MMIO register.
1285 Reads a bit field of a MMIO register.
1287 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1288 the StartBit and the EndBit. The value of the bit field is returned.
1290 If 8-bit MMIO register operations are not supported, then ASSERT().
1291 If StartBit is greater than 7, then ASSERT().
1292 If EndBit is greater than 7, then ASSERT().
1293 If EndBit is less than StartBit, then ASSERT().
1295 @param Address MMIO register to read.
1296 @param StartBit The ordinal of the least significant bit in the bit field.
1298 @param EndBit The ordinal of the most significant bit in the bit field.
1301 @return The value read.
1313 Writes a bit field to a MMIO register.
1315 Writes Value to the bit field of the MMIO register. The bit field is
1316 specified by the StartBit and the EndBit. All other bits in the destination
1317 MMIO register are preserved. The new value of the 8-bit register is returned.
1319 If 8-bit MMIO register operations are not supported, then ASSERT().
1320 If StartBit is greater than 7, then ASSERT().
1321 If EndBit is greater than 7, then ASSERT().
1322 If EndBit is less than StartBit, then ASSERT().
1324 @param Address MMIO register to write.
1325 @param StartBit The ordinal of the least significant bit in the bit field.
1327 @param EndBit The ordinal of the most significant bit in the bit field.
1329 @param Value New value of the bit field.
1331 @return The value written back to the MMIO register.
1336 MmioBitFieldWrite8 (
1344 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1345 writes the result back to the bit field in the 8-bit MMIO register.
1347 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1348 inclusive OR between the read result and the value specified by OrData, and
1349 writes the result to the 8-bit MMIO register specified by Address. The value
1350 written to the MMIO register is returned. This function must guarantee that
1351 all MMIO read and write operations are serialized. Extra left bits in OrData
1354 If 8-bit MMIO register operations are not supported, then ASSERT().
1355 If StartBit is greater than 7, then ASSERT().
1356 If EndBit is greater than 7, then ASSERT().
1357 If EndBit is less than StartBit, then ASSERT().
1359 @param Address MMIO register to write.
1360 @param StartBit The ordinal of the least significant bit in the bit field.
1362 @param EndBit The ordinal of the most significant bit in the bit field.
1364 @param OrData The value to OR with read value from the MMIO register.
1366 @return The value written back to the MMIO register.
1379 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1380 writes the result back to the bit field in the 8-bit MMIO register.
1382 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1383 between the read result and the value specified by AndData, and writes the
1384 result to the 8-bit MMIO register specified by Address. The value written to
1385 the MMIO register is returned. This function must guarantee that all MMIO
1386 read and write operations are serialized. Extra left bits in AndData are
1389 If 8-bit MMIO register operations are not supported, then ASSERT().
1390 If StartBit is greater than 7, then ASSERT().
1391 If EndBit is greater than 7, then ASSERT().
1392 If EndBit is less than StartBit, then ASSERT().
1394 @param Address MMIO register to write.
1395 @param StartBit The ordinal of the least significant bit in the bit field.
1397 @param EndBit The ordinal of the most significant bit in the bit field.
1399 @param AndData The value to AND with read value from the MMIO register.
1401 @return The value written back to the MMIO register.
1414 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1415 by a bitwise inclusive OR, and writes the result back to the bit field in the
1416 8-bit MMIO register.
1418 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1419 followed by a bitwise inclusive OR between the read result and the value
1420 specified by AndData, and writes the result to the 8-bit MMIO register
1421 specified by Address. The value written to the MMIO register is returned.
1422 This function must guarantee that all MMIO read and write operations are
1423 serialized. Extra left bits in both AndData and OrData are stripped.
1425 If 8-bit MMIO register operations are not supported, then ASSERT().
1426 If StartBit is greater than 7, then ASSERT().
1427 If EndBit is greater than 7, then ASSERT().
1428 If EndBit is less than StartBit, then ASSERT().
1430 @param Address MMIO register to write.
1431 @param StartBit The ordinal of the least significant bit in the bit field.
1433 @param EndBit The ordinal of the most significant bit in the bit field.
1435 @param AndData The value to AND with read value from the MMIO register.
1436 @param OrData The value to OR with the result of the AND operation.
1438 @return The value written back to the MMIO register.
1443 MmioBitFieldAndThenOr8 (
1452 Reads a 16-bit MMIO register.
1454 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1455 returned. This function must guarantee that all MMIO read and write
1456 operations are serialized.
1458 If 16-bit MMIO register operations are not supported, then ASSERT().
1460 @param Address The MMIO register to read.
1462 @return The value read.
1472 Writes a 16-bit MMIO register.
1474 Writes the 16-bit MMIO register specified by Address with the value specified
1475 by Value and returns Value. This function must guarantee that all MMIO read
1476 and write operations are serialized.
1478 If 16-bit MMIO register operations are not supported, then ASSERT().
1480 @param Address The MMIO register to write.
1481 @param Value The value to write to the MMIO register.
1492 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1493 result back to the 16-bit MMIO register.
1495 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1496 inclusive OR between the read result and the value specified by OrData, and
1497 writes the result to the 16-bit MMIO register specified by Address. The value
1498 written to the MMIO register is returned. This function must guarantee that
1499 all MMIO read and write operations are serialized.
1501 If 16-bit MMIO register operations are not supported, then ASSERT().
1503 @param Address The MMIO register to write.
1504 @param OrData The value to OR with the read value from the MMIO register.
1506 @return The value written back to the MMIO register.
1517 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1518 back to the 16-bit MMIO register.
1520 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1521 between the read result and the value specified by AndData, and writes the
1522 result to the 16-bit MMIO register specified by Address. The value written to
1523 the MMIO register is returned. This function must guarantee that all MMIO
1524 read and write operations are serialized.
1526 If 16-bit MMIO register operations are not supported, then ASSERT().
1528 @param Address The MMIO register to write.
1529 @param AndData The value to AND with the read value from the MMIO register.
1531 @return The value written back to the MMIO register.
1542 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1543 inclusive OR, and writes the result back to the 16-bit MMIO register.
1545 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1546 between the read result and the value specified by AndData, performs a
1547 bitwise OR between the result of the AND operation and the value specified by
1548 OrData, and writes the result to the 16-bit MMIO register specified by
1549 Address. The value written to the MMIO register is returned. This function
1550 must guarantee that all MMIO read and write operations are serialized.
1552 If 16-bit MMIO register operations are not supported, then ASSERT().
1555 @param Address The MMIO register to write.
1556 @param AndData The value to AND with the read value from the MMIO register.
1557 @param OrData The value to OR with the result of the AND operation.
1559 @return The value written back to the MMIO register.
1571 Reads a bit field of a MMIO register.
1573 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1574 the StartBit and the EndBit. The value of the bit field is returned.
1576 If 16-bit MMIO register operations are not supported, then ASSERT().
1577 If StartBit is greater than 15, then ASSERT().
1578 If EndBit is greater than 15, then ASSERT().
1579 If EndBit is less than StartBit, then ASSERT().
1581 @param Address MMIO register to read.
1582 @param StartBit The ordinal of the least significant bit in the bit field.
1584 @param EndBit The ordinal of the most significant bit in the bit field.
1587 @return The value read.
1592 MmioBitFieldRead16 (
1599 Writes a bit field to a MMIO register.
1601 Writes Value to the bit field of the MMIO register. The bit field is
1602 specified by the StartBit and the EndBit. All other bits in the destination
1603 MMIO register are preserved. The new value of the 16-bit register is returned.
1605 If 16-bit MMIO register operations are not supported, then ASSERT().
1606 If StartBit is greater than 15, then ASSERT().
1607 If EndBit is greater than 15, then ASSERT().
1608 If EndBit is less than StartBit, then ASSERT().
1610 @param Address MMIO register to write.
1611 @param StartBit The ordinal of the least significant bit in the bit field.
1613 @param EndBit The ordinal of the most significant bit in the bit field.
1615 @param Value New value of the bit field.
1617 @return The value written back to the MMIO register.
1622 MmioBitFieldWrite16 (
1630 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1631 writes the result back to the bit field in the 16-bit MMIO register.
1633 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1634 inclusive OR between the read result and the value specified by OrData, and
1635 writes the result to the 16-bit MMIO register specified by Address. The value
1636 written to the MMIO register is returned. This function must guarantee that
1637 all MMIO read and write operations are serialized. Extra left bits in OrData
1640 If 16-bit MMIO register operations are not supported, then ASSERT().
1641 If StartBit is greater than 15, then ASSERT().
1642 If EndBit is greater than 15, then ASSERT().
1643 If EndBit is less than StartBit, then ASSERT().
1645 @param Address MMIO register to write.
1646 @param StartBit The ordinal of the least significant bit in the bit field.
1648 @param EndBit The ordinal of the most significant bit in the bit field.
1650 @param OrData The value to OR with read value from the MMIO register.
1652 @return The value written back to the MMIO register.
1665 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1666 writes the result back to the bit field in the 16-bit MMIO register.
1668 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1669 between the read result and the value specified by AndData, and writes the
1670 result to the 16-bit MMIO register specified by Address. The value written to
1671 the MMIO register is returned. This function must guarantee that all MMIO
1672 read and write operations are serialized. Extra left bits in AndData are
1675 If 16-bit MMIO register operations are not supported, then ASSERT().
1676 If StartBit is greater than 15, then ASSERT().
1677 If EndBit is greater than 15, then ASSERT().
1678 If EndBit is less than StartBit, then ASSERT().
1680 @param Address MMIO register to write.
1681 @param StartBit The ordinal of the least significant bit in the bit field.
1683 @param EndBit The ordinal of the most significant bit in the bit field.
1685 @param AndData The value to AND with read value from the MMIO register.
1687 @return The value written back to the MMIO register.
1700 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1701 by a bitwise inclusive OR, and writes the result back to the bit field in the
1702 16-bit MMIO register.
1704 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1705 followed by a bitwise inclusive OR between the read result and the value
1706 specified by AndData, and writes the result to the 16-bit MMIO register
1707 specified by Address. The value written to the MMIO register is returned.
1708 This function must guarantee that all MMIO read and write operations are
1709 serialized. Extra left bits in both AndData and OrData are stripped.
1711 If 16-bit MMIO register operations are not supported, then ASSERT().
1712 If StartBit is greater than 15, then ASSERT().
1713 If EndBit is greater than 15, then ASSERT().
1714 If EndBit is less than StartBit, then ASSERT().
1716 @param Address MMIO register to write.
1717 @param StartBit The ordinal of the least significant bit in the bit field.
1719 @param EndBit The ordinal of the most significant bit in the bit field.
1721 @param AndData The value to AND with read value from the MMIO register.
1722 @param OrData The value to OR with the result of the AND operation.
1724 @return The value written back to the MMIO register.
1729 MmioBitFieldAndThenOr16 (
1738 Reads a 32-bit MMIO register.
1740 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1741 returned. This function must guarantee that all MMIO read and write
1742 operations are serialized.
1744 If 32-bit MMIO register operations are not supported, then ASSERT().
1746 @param Address The MMIO register to read.
1748 @return The value read.
1758 Writes a 32-bit MMIO register.
1760 Writes the 32-bit MMIO register specified by Address with the value specified
1761 by Value and returns Value. This function must guarantee that all MMIO read
1762 and write operations are serialized.
1764 If 32-bit MMIO register operations are not supported, then ASSERT().
1766 @param Address The MMIO register to write.
1767 @param Value The value to write to the MMIO register.
1778 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1779 result back to the 32-bit MMIO register.
1781 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1782 inclusive OR between the read result and the value specified by OrData, and
1783 writes the result to the 32-bit MMIO register specified by Address. The value
1784 written to the MMIO register is returned. This function must guarantee that
1785 all MMIO read and write operations are serialized.
1787 If 32-bit MMIO register operations are not supported, then ASSERT().
1789 @param Address The MMIO register to write.
1790 @param OrData The value to OR with the read value from the MMIO register.
1792 @return The value written back to the MMIO register.
1803 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1804 back to the 32-bit MMIO register.
1806 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1807 between the read result and the value specified by AndData, and writes the
1808 result to the 32-bit MMIO register specified by Address. The value written to
1809 the MMIO register is returned. This function must guarantee that all MMIO
1810 read and write operations are serialized.
1812 If 32-bit MMIO register operations are not supported, then ASSERT().
1814 @param Address The MMIO register to write.
1815 @param AndData The value to AND with the read value from the MMIO register.
1817 @return The value written back to the MMIO register.
1828 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1829 inclusive OR, and writes the result back to the 32-bit MMIO register.
1831 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1832 between the read result and the value specified by AndData, performs a
1833 bitwise OR between the result of the AND operation and the value specified by
1834 OrData, and writes the result to the 32-bit MMIO register specified by
1835 Address. The value written to the MMIO register is returned. This function
1836 must guarantee that all MMIO read and write operations are serialized.
1838 If 32-bit MMIO register operations are not supported, then ASSERT().
1841 @param Address The MMIO register to write.
1842 @param AndData The value to AND with the read value from the MMIO register.
1843 @param OrData The value to OR with the result of the AND operation.
1845 @return The value written back to the MMIO register.
1857 Reads a bit field of a MMIO register.
1859 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1860 the StartBit and the EndBit. The value of the bit field is returned.
1862 If 32-bit MMIO register operations are not supported, then ASSERT().
1863 If StartBit is greater than 31, then ASSERT().
1864 If EndBit is greater than 31, then ASSERT().
1865 If EndBit is less than StartBit, then ASSERT().
1867 @param Address MMIO register to read.
1868 @param StartBit The ordinal of the least significant bit in the bit field.
1870 @param EndBit The ordinal of the most significant bit in the bit field.
1873 @return The value read.
1878 MmioBitFieldRead32 (
1885 Writes a bit field to a MMIO register.
1887 Writes Value to the bit field of the MMIO register. The bit field is
1888 specified by the StartBit and the EndBit. All other bits in the destination
1889 MMIO register are preserved. The new value of the 32-bit register is returned.
1891 If 32-bit MMIO register operations are not supported, then ASSERT().
1892 If StartBit is greater than 31, then ASSERT().
1893 If EndBit is greater than 31, then ASSERT().
1894 If EndBit is less than StartBit, then ASSERT().
1896 @param Address MMIO register to write.
1897 @param StartBit The ordinal of the least significant bit in the bit field.
1899 @param EndBit The ordinal of the most significant bit in the bit field.
1901 @param Value New value of the bit field.
1903 @return The value written back to the MMIO register.
1908 MmioBitFieldWrite32 (
1916 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1917 writes the result back to the bit field in the 32-bit MMIO register.
1919 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1920 inclusive OR between the read result and the value specified by OrData, and
1921 writes the result to the 32-bit MMIO register specified by Address. The value
1922 written to the MMIO register is returned. This function must guarantee that
1923 all MMIO read and write operations are serialized. Extra left bits in OrData
1926 If 32-bit MMIO register operations are not supported, then ASSERT().
1927 If StartBit is greater than 31, then ASSERT().
1928 If EndBit is greater than 31, then ASSERT().
1929 If EndBit is less than StartBit, then ASSERT().
1931 @param Address MMIO register to write.
1932 @param StartBit The ordinal of the least significant bit in the bit field.
1934 @param EndBit The ordinal of the most significant bit in the bit field.
1936 @param OrData The value to OR with read value from the MMIO register.
1938 @return The value written back to the MMIO register.
1951 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1952 writes the result back to the bit field in the 32-bit MMIO register.
1954 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1955 between the read result and the value specified by AndData, and writes the
1956 result to the 32-bit MMIO register specified by Address. The value written to
1957 the MMIO register is returned. This function must guarantee that all MMIO
1958 read and write operations are serialized. Extra left bits in AndData are
1961 If 32-bit MMIO register operations are not supported, then ASSERT().
1962 If StartBit is greater than 31, then ASSERT().
1963 If EndBit is greater than 31, then ASSERT().
1964 If EndBit is less than StartBit, then ASSERT().
1966 @param Address MMIO register to write.
1967 @param StartBit The ordinal of the least significant bit in the bit field.
1969 @param EndBit The ordinal of the most significant bit in the bit field.
1971 @param AndData The value to AND with read value from the MMIO register.
1973 @return The value written back to the MMIO register.
1986 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1987 by a bitwise inclusive OR, and writes the result back to the bit field in the
1988 32-bit MMIO register.
1990 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1991 followed by a bitwise inclusive OR between the read result and the value
1992 specified by AndData, and writes the result to the 32-bit MMIO register
1993 specified by Address. The value written to the MMIO register is returned.
1994 This function must guarantee that all MMIO read and write operations are
1995 serialized. Extra left bits in both AndData and OrData are stripped.
1997 If 32-bit MMIO register operations are not supported, then ASSERT().
1998 If StartBit is greater than 31, then ASSERT().
1999 If EndBit is greater than 31, then ASSERT().
2000 If EndBit is less than StartBit, then ASSERT().
2002 @param Address MMIO register to write.
2003 @param StartBit The ordinal of the least significant bit in the bit field.
2005 @param EndBit The ordinal of the most significant bit in the bit field.
2007 @param AndData The value to AND with read value from the MMIO register.
2008 @param OrData The value to OR with the result of the AND operation.
2010 @return The value written back to the MMIO register.
2015 MmioBitFieldAndThenOr32 (
2024 Reads a 64-bit MMIO register.
2026 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2027 returned. This function must guarantee that all MMIO read and write
2028 operations are serialized.
2030 If 64-bit MMIO register operations are not supported, then ASSERT().
2032 @param Address The MMIO register to read.
2034 @return The value read.
2044 Writes a 64-bit MMIO register.
2046 Writes the 64-bit MMIO register specified by Address with the value specified
2047 by Value and returns Value. This function must guarantee that all MMIO read
2048 and write operations are serialized.
2050 If 64-bit MMIO register operations are not supported, then ASSERT().
2052 @param Address The MMIO register to write.
2053 @param Value The value to write to the MMIO register.
2064 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
2065 result back to the 64-bit MMIO register.
2067 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2068 inclusive OR between the read result and the value specified by OrData, and
2069 writes the result to the 64-bit MMIO register specified by Address. The value
2070 written to the MMIO register is returned. This function must guarantee that
2071 all MMIO read and write operations are serialized.
2073 If 64-bit MMIO register operations are not supported, then ASSERT().
2075 @param Address The MMIO register to write.
2076 @param OrData The value to OR with the read value from the MMIO register.
2078 @return The value written back to the MMIO register.
2089 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2090 back to the 64-bit MMIO register.
2092 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2093 between the read result and the value specified by AndData, and writes the
2094 result to the 64-bit MMIO register specified by Address. The value written to
2095 the MMIO register is returned. This function must guarantee that all MMIO
2096 read and write operations are serialized.
2098 If 64-bit MMIO register operations are not supported, then ASSERT().
2100 @param Address The MMIO register to write.
2101 @param AndData The value to AND with the read value from the MMIO register.
2103 @return The value written back to the MMIO register.
2114 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2115 inclusive OR, and writes the result back to the 64-bit MMIO register.
2117 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2118 between the read result and the value specified by AndData, performs a
2119 bitwise OR between the result of the AND operation and the value specified by
2120 OrData, and writes the result to the 64-bit MMIO register specified by
2121 Address. The value written to the MMIO register is returned. This function
2122 must guarantee that all MMIO read and write operations are serialized.
2124 If 64-bit MMIO register operations are not supported, then ASSERT().
2127 @param Address The MMIO register to write.
2128 @param AndData The value to AND with the read value from the MMIO register.
2129 @param OrData The value to OR with the result of the AND operation.
2131 @return The value written back to the MMIO register.
2143 Reads a bit field of a MMIO register.
2145 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2146 the StartBit and the EndBit. The value of the bit field is returned.
2148 If 64-bit MMIO register operations are not supported, then ASSERT().
2149 If StartBit is greater than 63, then ASSERT().
2150 If EndBit is greater than 63, then ASSERT().
2151 If EndBit is less than StartBit, then ASSERT().
2153 @param Address MMIO register to read.
2154 @param StartBit The ordinal of the least significant bit in the bit field.
2156 @param EndBit The ordinal of the most significant bit in the bit field.
2159 @return The value read.
2164 MmioBitFieldRead64 (
2171 Writes a bit field to a MMIO register.
2173 Writes Value to the bit field of the MMIO register. The bit field is
2174 specified by the StartBit and the EndBit. All other bits in the destination
2175 MMIO register are preserved. The new value of the 64-bit register is returned.
2177 If 64-bit MMIO register operations are not supported, then ASSERT().
2178 If StartBit is greater than 63, then ASSERT().
2179 If EndBit is greater than 63, then ASSERT().
2180 If EndBit is less than StartBit, then ASSERT().
2182 @param Address MMIO register to write.
2183 @param StartBit The ordinal of the least significant bit in the bit field.
2185 @param EndBit The ordinal of the most significant bit in the bit field.
2187 @param Value New value of the bit field.
2189 @return The value written back to the MMIO register.
2194 MmioBitFieldWrite64 (
2202 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2203 writes the result back to the bit field in the 64-bit MMIO register.
2205 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2206 inclusive OR between the read result and the value specified by OrData, and
2207 writes the result to the 64-bit MMIO register specified by Address. The value
2208 written to the MMIO register is returned. This function must guarantee that
2209 all MMIO read and write operations are serialized. Extra left bits in OrData
2212 If 64-bit MMIO register operations are not supported, then ASSERT().
2213 If StartBit is greater than 63, then ASSERT().
2214 If EndBit is greater than 63, then ASSERT().
2215 If EndBit is less than StartBit, then ASSERT().
2217 @param Address MMIO register to write.
2218 @param StartBit The ordinal of the least significant bit in the bit field.
2220 @param EndBit The ordinal of the most significant bit in the bit field.
2222 @param OrData The value to OR with read value from the MMIO register.
2224 @return The value written back to the MMIO register.
2237 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2238 writes the result back to the bit field in the 64-bit MMIO register.
2240 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2241 between the read result and the value specified by AndData, and writes the
2242 result to the 64-bit MMIO register specified by Address. The value written to
2243 the MMIO register is returned. This function must guarantee that all MMIO
2244 read and write operations are serialized. Extra left bits in AndData are
2247 If 64-bit MMIO register operations are not supported, then ASSERT().
2248 If StartBit is greater than 63, then ASSERT().
2249 If EndBit is greater than 63, then ASSERT().
2250 If EndBit is less than StartBit, then ASSERT().
2252 @param Address MMIO register to write.
2253 @param StartBit The ordinal of the least significant bit in the bit field.
2255 @param EndBit The ordinal of the most significant bit in the bit field.
2257 @param AndData The value to AND with read value from the MMIO register.
2259 @return The value written back to the MMIO register.
2272 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2273 by a bitwise inclusive OR, and writes the result back to the bit field in the
2274 64-bit MMIO register.
2276 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2277 followed by a bitwise inclusive OR between the read result and the value
2278 specified by AndData, and writes the result to the 64-bit MMIO register
2279 specified by Address. The value written to the MMIO register is returned.
2280 This function must guarantee that all MMIO read and write operations are
2281 serialized. Extra left bits in both AndData and OrData are stripped.
2283 If 64-bit MMIO register operations are not supported, then ASSERT().
2284 If StartBit is greater than 63, then ASSERT().
2285 If EndBit is greater than 63, then ASSERT().
2286 If EndBit is less than StartBit, then ASSERT().
2288 @param Address MMIO register to write.
2289 @param StartBit The ordinal of the least significant bit in the bit field.
2291 @param EndBit The ordinal of the most significant bit in the bit field.
2293 @param AndData The value to AND with read value from the MMIO register.
2294 @param OrData The value to OR with the result of the AND operation.
2296 @return The value written back to the MMIO register.
2301 MmioBitFieldAndThenOr64 (
2310 Copy data from MMIO region to system memory by using 8-bit access.
2312 Copy data from MMIO region specified by starting address StartAddress
2313 to system memory specified by Buffer by using 8-bit access. The total
2314 number of byte to be copied is specified by Length. Buffer is returned.
2316 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2317 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2320 @param StartAddress Starting address for the MMIO region to be copied from.
2321 @param Length Size in bytes of the copy.
2322 @param Buffer Pointer to a system memory buffer receiving the data read.
2330 IN UINTN StartAddress
,
2336 Copy data from MMIO region to system memory by using 16-bit access.
2338 Copy data from MMIO region specified by starting address StartAddress
2339 to system memory specified by Buffer by using 16-bit access. The total
2340 number of byte to be copied is specified by Length. Buffer is returned.
2342 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2344 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2345 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2347 If Length is not aligned on a 16-bit boundary, then ASSERT().
2348 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2350 @param StartAddress Starting address for the MMIO region to be copied from.
2351 @param Length Size in bytes of the copy.
2352 @param Buffer Pointer to a system memory buffer receiving the data read.
2360 IN UINTN StartAddress
,
2366 Copy data from MMIO region to system memory by using 32-bit access.
2368 Copy data from MMIO region specified by starting address StartAddress
2369 to system memory specified by Buffer by using 32-bit access. The total
2370 number of byte to be copied is specified by Length. Buffer is returned.
2372 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2374 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2375 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2377 If Length is not aligned on a 32-bit boundary, then ASSERT().
2378 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2380 @param StartAddress Starting address for the MMIO region to be copied from.
2381 @param Length Size in bytes of the copy.
2382 @param Buffer Pointer to a system memory buffer receiving the data read.
2390 IN UINTN StartAddress
,
2396 Copy data from MMIO region to system memory by using 64-bit access.
2398 Copy data from MMIO region specified by starting address StartAddress
2399 to system memory specified by Buffer by using 64-bit access. The total
2400 number of byte to be copied is specified by Length. Buffer is returned.
2402 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2404 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2405 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2407 If Length is not aligned on a 64-bit boundary, then ASSERT().
2408 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2410 @param StartAddress Starting address for the MMIO region to be copied from.
2411 @param Length Size in bytes of the copy.
2412 @param Buffer Pointer to a system memory buffer receiving the data read.
2420 IN UINTN StartAddress
,
2426 Copy data from system memory to MMIO region by using 8-bit access.
2428 Copy data from system memory specified by Buffer to MMIO region specified
2429 by starting address StartAddress by using 8-bit access. The total number
2430 of byte to be copied is specified by Length. Buffer is returned.
2432 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2433 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2436 @param StartAddress Starting address for the MMIO region to be copied to.
2437 @param Length Size in bytes of the copy.
2438 @param Buffer Pointer to a system memory buffer containing the data to write.
2440 @return Size in bytes of the copy.
2446 IN UINTN StartAddress
,
2448 IN CONST UINT8
*Buffer
2452 Copy data from system memory to MMIO region by using 16-bit access.
2454 Copy data from system memory specified by Buffer to MMIO region specified
2455 by starting address StartAddress by using 16-bit access. The total number
2456 of byte to be copied is specified by Length. Length is returned.
2458 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2460 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2461 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2463 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 to.
2468 @param Length Size in bytes of the copy.
2469 @param Buffer Pointer to a system memory buffer containing the data to write.
2471 @return Size in bytes of the copy.
2477 IN UINTN StartAddress
,
2479 IN CONST UINT16
*Buffer
2483 Copy data from system memory to MMIO region by using 32-bit access.
2485 Copy data from system memory specified by Buffer to MMIO region specified
2486 by starting address StartAddress by using 32-bit access. The total number
2487 of byte to be copied is specified by Length. Length 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().
2496 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2498 @param StartAddress Starting address for the MMIO region to be copied to.
2499 @param Length Size in bytes of the copy.
2500 @param Buffer Pointer to a system memory buffer containing the data to write.
2502 @return Size in bytes of the copy.
2508 IN UINTN StartAddress
,
2510 IN CONST UINT32
*Buffer
2514 Copy data from system memory to MMIO region by using 64-bit access.
2516 Copy data from system memory specified by Buffer to MMIO region specified
2517 by starting address StartAddress by using 64-bit access. The total number
2518 of byte to be copied is specified by Length. Length is returned.
2520 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2522 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2523 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2525 If Length is not aligned on a 64-bit boundary, then ASSERT().
2527 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2529 @param StartAddress Starting address for the MMIO region to be copied to.
2530 @param Length Size in bytes of the copy.
2531 @param Buffer Pointer to a system memory buffer containing the data to write.
2533 @return Size in bytes of the copy.
2539 IN UINTN StartAddress
,
2541 IN CONST UINT64
*Buffer