2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2006, Intel Corporation<BR>
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 Module Name: IoHighLevel.c
18 The following IoLib instances share the same version of this file:
27 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
28 result back to the 8-bit I/O port.
30 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
31 between the read result and the value specified by OrData, and writes the
32 result to the 8-bit I/O port specified by Port. The value written to the I/O
33 port is returned. This function must guarantee that all I/O read and write
34 operations are serialized.
36 If 8-bit I/O port operations are not supported, then ASSERT().
38 @param Port The I/O port to write.
39 @param OrData The value to OR with the read value from the I/O port.
41 @return The value written back to the I/O port.
51 return IoWrite8 (Port
, IoRead8 (Port
) | OrData
);
55 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
56 to the 8-bit I/O port.
58 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
59 the read result and the value specified by AndData, and writes the result to
60 the 8-bit I/O port specified by Port. The value written to the I/O port is
61 returned. This function must guarantee that all I/O read and write operations
64 If 8-bit I/O port operations are not supported, then ASSERT().
66 @param Port The I/O port to write.
67 @param AndData The value to AND with the read value from the I/O port.
69 @return The value written back to the I/O port.
79 return IoWrite8 (Port
, IoRead8 (Port
) & AndData
);
83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
84 inclusive OR, and writes the result back to the 8-bit I/O port.
86 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
87 the read result and the value specified by AndData, performs a bitwise OR
88 between the result of the AND operation and the value specified by OrData,
89 and writes the result to the 8-bit I/O port specified by Port. The value
90 written to the I/O port is returned. This function must guarantee that all
91 I/O read and write operations are serialized.
93 If 8-bit I/O port operations are not supported, then ASSERT().
95 @param Port The I/O port to write.
96 @param AndData The value to AND with the read value from the I/O port.
97 @param OrData The value to OR with the result of the AND operation.
99 @return The value written back to the I/O port.
110 return IoWrite8 (Port
, (IoRead8 (Port
) & AndData
) | OrData
);
114 Reads a bit field of an I/O register.
116 Reads the bit field in an 8-bit I/O register. The bit field is specified by
117 the StartBit and the EndBit. The value of the bit field is returned.
119 If 8-bit I/O port operations are not supported, then ASSERT().
120 If StartBit is greater than 7, then ASSERT().
121 If EndBit is greater than 7, then ASSERT().
122 If EndBit is less than or equal to StartBit, then ASSERT().
124 @param Port The I/O port to read.
125 @param StartBit The ordinal of the least significant bit in the bit field.
127 @param EndBit The ordinal of the most significant bit in the bit field.
130 @return The value read.
141 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
145 Writes a bit field to an I/O register.
147 Writes Value to the bit field of the I/O register. The bit field is specified
148 by the StartBit and the EndBit. All other bits in the destination I/O
149 register are preserved. The value written to the I/O port is returned. Extra
150 left bits in Value are stripped.
152 If 8-bit I/O port operations are not supported, then ASSERT().
153 If StartBit is greater than 7, then ASSERT().
154 If EndBit is greater than 7, then ASSERT().
155 If EndBit is less than or equal to StartBit, then ASSERT().
157 @param Port The I/O port to write.
158 @param StartBit The ordinal of the least significant bit in the bit field.
160 @param EndBit The ordinal of the most significant bit in the bit field.
162 @param Value New value of the bit field.
164 @return The value written back to the I/O port.
178 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
183 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
184 result back to the bit field in the 8-bit port.
186 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
187 between the read result and the value specified by OrData, and writes the
188 result to the 8-bit I/O port specified by Port. The value written to the I/O
189 port is returned. This function must guarantee that all I/O read and write
190 operations are serialized. Extra left bits in OrData are stripped.
192 If 8-bit I/O port operations are not supported, then ASSERT().
193 If StartBit is greater than 7, then ASSERT().
194 If EndBit is greater than 7, then ASSERT().
195 If EndBit is less than or equal to StartBit, then ASSERT().
197 @param Port The I/O port to write.
198 @param StartBit The ordinal of the least significant bit in the bit field.
200 @param EndBit The ordinal of the most significant bit in the bit field.
202 @param OrData The value to OR with the read value from the I/O port.
204 @return The value written back to the I/O port.
218 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
223 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
224 result back to the bit field in the 8-bit port.
226 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
227 the read result and the value specified by AndData, and writes the result to
228 the 8-bit I/O port specified by Port. The value written to the I/O port is
229 returned. This function must guarantee that all I/O read and write operations
230 are serialized. Extra left bits in AndData are stripped.
232 If 8-bit I/O port operations are not supported, then ASSERT().
233 If StartBit is greater than 7, then ASSERT().
234 If EndBit is greater than 7, then ASSERT().
235 If EndBit is less than or equal to StartBit, then ASSERT().
237 @param Port The I/O port to write.
238 @param StartBit The ordinal of the least significant bit in the bit field.
240 @param EndBit The ordinal of the most significant bit in the bit field.
242 @param AndData The value to AND with the read value from the I/O port.
244 @return The value written back to the I/O port.
258 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
263 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
264 bitwise inclusive OR, and writes the result back to the bit field in the
267 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
268 by a bitwise inclusive OR between the read result and the value specified by
269 AndData, and writes the result to the 8-bit I/O port specified by Port. The
270 value written to the I/O port is returned. This function must guarantee that
271 all I/O read and write operations are serialized. Extra left bits in both
272 AndData and OrData are stripped.
274 If 8-bit I/O port operations are not supported, then ASSERT().
275 If StartBit is greater than 7, then ASSERT().
276 If EndBit is greater than 7, then ASSERT().
277 If EndBit is less than or equal to StartBit, then ASSERT().
279 @param Port The I/O port to write.
280 @param StartBit The ordinal of the least significant bit in the bit field.
282 @param EndBit The ordinal of the most significant bit in the bit field.
284 @param AndData The value to AND with the read value from the I/O port.
285 @param OrData The value to OR with the result of the AND operation.
287 @return The value written back to the I/O port.
292 IoBitFieldAndThenOr8 (
302 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
307 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
308 result back to the 16-bit I/O port.
310 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
311 between the read result and the value specified by OrData, and writes the
312 result to the 16-bit I/O port specified by Port. The value written to the I/O
313 port is returned. This function must guarantee that all I/O read and write
314 operations are serialized.
316 If 16-bit I/O port operations are not supported, then ASSERT().
318 @param Port The I/O port to write.
319 @param OrData The value to OR with the read value from the I/O port.
321 @return The value written back to the I/O port.
331 return IoWrite16 (Port
, IoRead16 (Port
) | OrData
);
335 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
336 to the 16-bit I/O port.
338 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
339 the read result and the value specified by AndData, and writes the result to
340 the 16-bit I/O port specified by Port. The value written to the I/O port is
341 returned. This function must guarantee that all I/O read and write operations
344 If 16-bit I/O port operations are not supported, then ASSERT().
346 @param Port The I/O port to write.
347 @param AndData The value to AND with the read value from the I/O port.
349 @return The value written back to the I/O port.
359 return IoWrite16 (Port
, IoRead16 (Port
) & AndData
);
363 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
364 inclusive OR, and writes the result back to the 16-bit I/O port.
366 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
367 the read result and the value specified by AndData, performs a bitwise OR
368 between the result of the AND operation and the value specified by OrData,
369 and writes the result to the 16-bit I/O port specified by Port. The value
370 written to the I/O port is returned. This function must guarantee that all
371 I/O read and write operations are serialized.
373 If 16-bit I/O port operations are not supported, then ASSERT().
375 @param Port The I/O port to write.
376 @param AndData The value to AND with the read value from the I/O port.
377 @param OrData The value to OR with the result of the AND operation.
379 @return The value written back to the I/O port.
390 return IoWrite16 (Port
, (IoRead16 (Port
) & AndData
) | OrData
);
394 Reads a bit field of an I/O register.
396 Reads the bit field in a 16-bit I/O register. The bit field is specified by
397 the StartBit and the EndBit. The value of the bit field is returned.
399 If 16-bit I/O port operations are not supported, then ASSERT().
400 If StartBit is greater than 15, then ASSERT().
401 If EndBit is greater than 15, then ASSERT().
402 If EndBit is less than or equal to StartBit, then ASSERT().
404 @param Port The I/O port to read.
405 @param StartBit The ordinal of the least significant bit in the bit field.
407 @param EndBit The ordinal of the most significant bit in the bit field.
410 @return The value read.
421 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
425 Writes a bit field to an I/O register.
427 Writes Value to the bit field of the I/O register. The bit field is specified
428 by the StartBit and the EndBit. All other bits in the destination I/O
429 register are preserved. The value written to the I/O port is returned. Extra
430 left bits in Value are stripped.
432 If 16-bit I/O port operations are not supported, then ASSERT().
433 If StartBit is greater than 15, then ASSERT().
434 If EndBit is greater than 15, then ASSERT().
435 If EndBit is less than or equal to StartBit, then ASSERT().
437 @param Port The I/O port to write.
438 @param StartBit The ordinal of the least significant bit in the bit field.
440 @param EndBit The ordinal of the most significant bit in the bit field.
442 @param Value New value of the bit field.
444 @return The value written back to the I/O port.
458 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
463 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
464 result back to the bit field in the 16-bit port.
466 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
467 between the read result and the value specified by OrData, and writes the
468 result to the 16-bit I/O port specified by Port. The value written to the I/O
469 port is returned. This function must guarantee that all I/O read and write
470 operations are serialized. Extra left bits in OrData are stripped.
472 If 16-bit I/O port operations are not supported, then ASSERT().
473 If StartBit is greater than 15, then ASSERT().
474 If EndBit is greater than 15, then ASSERT().
475 If EndBit is less than or equal to StartBit, then ASSERT().
477 @param Port The I/O port to write.
478 @param StartBit The ordinal of the least significant bit in the bit field.
480 @param EndBit The ordinal of the most significant bit in the bit field.
482 @param OrData The value to OR with the read value from the I/O port.
484 @return The value written back to the I/O port.
498 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
503 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
504 result back to the bit field in the 16-bit port.
506 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
507 the read result and the value specified by AndData, and writes the result to
508 the 16-bit I/O port specified by Port. The value written to the I/O port is
509 returned. This function must guarantee that all I/O read and write operations
510 are serialized. Extra left bits in AndData are stripped.
512 If 16-bit I/O port operations are not supported, then ASSERT().
513 If StartBit is greater than 15, then ASSERT().
514 If EndBit is greater than 15, then ASSERT().
515 If EndBit is less than or equal to StartBit, then ASSERT().
517 @param Port The I/O port to write.
518 @param StartBit The ordinal of the least significant bit in the bit field.
520 @param EndBit The ordinal of the most significant bit in the bit field.
522 @param AndData The value to AND with the read value from the I/O port.
524 @return The value written back to the I/O port.
538 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
543 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
544 bitwise inclusive OR, and writes the result back to the bit field in the
547 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
548 by a bitwise inclusive OR between the read result and the value specified by
549 AndData, and writes the result to the 16-bit I/O port specified by Port. The
550 value written to the I/O port is returned. This function must guarantee that
551 all I/O read and write operations are serialized. Extra left bits in both
552 AndData and OrData are stripped.
554 If 16-bit I/O port operations are not supported, then ASSERT().
555 If StartBit is greater than 15, then ASSERT().
556 If EndBit is greater than 15, then ASSERT().
557 If EndBit is less than or equal to StartBit, then ASSERT().
559 @param Port The I/O port to write.
560 @param StartBit The ordinal of the least significant bit in the bit field.
562 @param EndBit The ordinal of the most significant bit in the bit field.
564 @param AndData The value to AND with the read value from the I/O port.
565 @param OrData The value to OR with the result of the AND operation.
567 @return The value written back to the I/O port.
572 IoBitFieldAndThenOr16 (
582 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
587 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
588 result back to the 32-bit I/O port.
590 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
591 between the read result and the value specified by OrData, and writes the
592 result to the 32-bit I/O port specified by Port. The value written to the I/O
593 port is returned. This function must guarantee that all I/O read and write
594 operations are serialized.
596 If 32-bit I/O port operations are not supported, then ASSERT().
598 @param Port The I/O port to write.
599 @param OrData The value to OR with the read value from the I/O port.
601 @return The value written back to the I/O port.
611 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
615 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
616 to the 32-bit I/O port.
618 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
619 the read result and the value specified by AndData, and writes the result to
620 the 32-bit I/O port specified by Port. The value written to the I/O port is
621 returned. This function must guarantee that all I/O read and write operations
624 If 32-bit I/O port operations are not supported, then ASSERT().
626 @param Port The I/O port to write.
627 @param AndData The value to AND with the read value from the I/O port.
629 @return The value written back to the I/O port.
639 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
643 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
644 inclusive OR, and writes the result back to the 32-bit I/O port.
646 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
647 the read result and the value specified by AndData, performs a bitwise OR
648 between the result of the AND operation and the value specified by OrData,
649 and writes the result to the 32-bit I/O port specified by Port. The value
650 written to the I/O port is returned. This function must guarantee that all
651 I/O read and write operations are serialized.
653 If 32-bit I/O port operations are not supported, then ASSERT().
655 @param Port The I/O port to write.
656 @param AndData The value to AND with the read value from the I/O port.
657 @param OrData The value to OR with the result of the AND operation.
659 @return The value written back to the I/O port.
670 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
674 Reads a bit field of an I/O register.
676 Reads the bit field in a 32-bit I/O register. The bit field is specified by
677 the StartBit and the EndBit. The value of the bit field is returned.
679 If 32-bit I/O port operations are not supported, then ASSERT().
680 If StartBit is greater than 31, then ASSERT().
681 If EndBit is greater than 31, then ASSERT().
682 If EndBit is less than or equal to StartBit, then ASSERT().
684 @param Port The I/O port to read.
685 @param StartBit The ordinal of the least significant bit in the bit field.
687 @param EndBit The ordinal of the most significant bit in the bit field.
690 @return The value read.
701 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
705 Writes a bit field to an I/O register.
707 Writes Value to the bit field of the I/O register. The bit field is specified
708 by the StartBit and the EndBit. All other bits in the destination I/O
709 register are preserved. The value written to the I/O port is returned. Extra
710 left bits in Value are stripped.
712 If 32-bit I/O port operations are not supported, then ASSERT().
713 If StartBit is greater than 31, then ASSERT().
714 If EndBit is greater than 31, then ASSERT().
715 If EndBit is less than or equal to StartBit, then ASSERT().
717 @param Port The I/O port to write.
718 @param StartBit The ordinal of the least significant bit in the bit field.
720 @param EndBit The ordinal of the most significant bit in the bit field.
722 @param Value New value of the bit field.
724 @return The value written back to the I/O port.
738 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
743 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
744 result back to the bit field in the 32-bit port.
746 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
747 between the read result and the value specified by OrData, and writes the
748 result to the 32-bit I/O port specified by Port. The value written to the I/O
749 port is returned. This function must guarantee that all I/O read and write
750 operations are serialized. Extra left bits in OrData are stripped.
752 If 32-bit I/O port operations are not supported, then ASSERT().
753 If StartBit is greater than 31, then ASSERT().
754 If EndBit is greater than 31, then ASSERT().
755 If EndBit is less than or equal to StartBit, then ASSERT().
757 @param Port The I/O port to write.
758 @param StartBit The ordinal of the least significant bit in the bit field.
760 @param EndBit The ordinal of the most significant bit in the bit field.
762 @param OrData The value to OR with the read value from the I/O port.
764 @return The value written back to the I/O port.
778 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
783 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
784 result back to the bit field in the 32-bit port.
786 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
787 the read result and the value specified by AndData, and writes the result to
788 the 32-bit I/O port specified by Port. The value written to the I/O port is
789 returned. This function must guarantee that all I/O read and write operations
790 are serialized. Extra left bits in AndData are stripped.
792 If 32-bit I/O port operations are not supported, then ASSERT().
793 If StartBit is greater than 31, then ASSERT().
794 If EndBit is greater than 31, then ASSERT().
795 If EndBit is less than or equal to StartBit, then ASSERT().
797 @param Port The I/O port to write.
798 @param StartBit The ordinal of the least significant bit in the bit field.
800 @param EndBit The ordinal of the most significant bit in the bit field.
802 @param AndData The value to AND with the read value from the I/O port.
804 @return The value written back to the I/O port.
818 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
823 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
824 bitwise inclusive OR, and writes the result back to the bit field in the
827 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
828 by a bitwise inclusive OR between the read result and the value specified by
829 AndData, and writes the result to the 32-bit I/O port specified by Port. The
830 value written to the I/O port is returned. This function must guarantee that
831 all I/O read and write operations are serialized. Extra left bits in both
832 AndData and OrData 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 or equal to 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.
845 @param OrData The value to OR with the result of the AND operation.
847 @return The value written back to the I/O port.
852 IoBitFieldAndThenOr32 (
862 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
867 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
868 result back to the 64-bit I/O port.
870 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
871 between the read result and the value specified by OrData, and writes the
872 result to the 64-bit I/O port specified by Port. The value written to the I/O
873 port is returned. This function must guarantee that all I/O read and write
874 operations are serialized.
876 If 64-bit I/O port operations are not supported, then ASSERT().
878 @param Port The I/O port to write.
879 @param OrData The value to OR with the read value from the I/O port.
881 @return The value written back to the I/O port.
891 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
895 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
896 to the 64-bit I/O port.
898 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
899 the read result and the value specified by AndData, and writes the result to
900 the 64-bit I/O port specified by Port. The value written to the I/O port is
901 returned. This function must guarantee that all I/O read and write operations
904 If 64-bit I/O port operations are not supported, then ASSERT().
906 @param Port The I/O port to write.
907 @param AndData The value to AND with the read value from the I/O port.
909 @return The value written back to the I/O port.
919 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
923 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
924 inclusive OR, and writes the result back to the 64-bit I/O port.
926 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
927 the read result and the value specified by AndData, performs a bitwise OR
928 between the result of the AND operation and the value specified by OrData,
929 and writes the result to the 64-bit I/O port specified by Port. The value
930 written to the I/O port is returned. This function must guarantee that all
931 I/O read and write operations are serialized.
933 If 64-bit I/O port operations are not supported, then ASSERT().
935 @param Port The I/O port to write.
936 @param AndData The value to AND with the read value from the I/O port.
937 @param OrData The value to OR with the result of the AND operation.
939 @return The value written back to the I/O port.
950 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
954 Reads a bit field of an I/O register.
956 Reads the bit field in a 64-bit I/O register. The bit field is specified by
957 the StartBit and the EndBit. The value of the bit field is returned.
959 If 64-bit I/O port operations are not supported, then ASSERT().
960 If StartBit is greater than 63, then ASSERT().
961 If EndBit is greater than 63, then ASSERT().
962 If EndBit is less than or equal to StartBit, then ASSERT().
964 @param Port The I/O port to read.
965 @param StartBit The ordinal of the least significant bit in the bit field.
967 @param EndBit The ordinal of the most significant bit in the bit field.
970 @return The value read.
981 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
985 Writes a bit field to an I/O register.
987 Writes Value to the bit field of the I/O register. The bit field is specified
988 by the StartBit and the EndBit. All other bits in the destination I/O
989 register are preserved. The value written to the I/O port is returned. Extra
990 left bits in Value are stripped.
992 If 64-bit I/O port operations are not supported, then ASSERT().
993 If StartBit is greater than 63, then ASSERT().
994 If EndBit is greater than 63, then ASSERT().
995 If EndBit is less than or equal to StartBit, then ASSERT().
997 @param Port The I/O port to write.
998 @param StartBit The ordinal of the least significant bit in the bit field.
1000 @param EndBit The ordinal of the most significant bit in the bit field.
1002 @param Value New value of the bit field.
1004 @return The value written back to the I/O port.
1018 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1023 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1024 result back to the bit field in the 64-bit port.
1026 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1027 between the read result and the value specified by OrData, and writes the
1028 result to the 64-bit I/O port specified by Port. The value written to the I/O
1029 port is returned. This function must guarantee that all I/O read and write
1030 operations are serialized. Extra left bits in OrData are stripped.
1032 If 64-bit I/O port operations are not supported, then ASSERT().
1033 If StartBit is greater than 63, then ASSERT().
1034 If EndBit is greater than 63, then ASSERT().
1035 If EndBit is less than or equal to StartBit, then ASSERT().
1037 @param Port The I/O port to write.
1038 @param StartBit The ordinal of the least significant bit in the bit field.
1040 @param EndBit The ordinal of the most significant bit in the bit field.
1042 @param OrData The value to OR with the read value from the I/O port.
1044 @return The value written back to the I/O port.
1058 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1063 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1064 result back to the bit field in the 64-bit port.
1066 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1067 the read result and the value specified by AndData, and writes the result to
1068 the 64-bit I/O port specified by Port. The value written to the I/O port is
1069 returned. This function must guarantee that all I/O read and write operations
1070 are serialized. Extra left bits in AndData are stripped.
1072 If 64-bit I/O port operations are not supported, then ASSERT().
1073 If StartBit is greater than 63, then ASSERT().
1074 If EndBit is greater than 63, then ASSERT().
1075 If EndBit is less than or equal to StartBit, then ASSERT().
1077 @param Port The I/O port to write.
1078 @param StartBit The ordinal of the least significant bit in the bit field.
1080 @param EndBit The ordinal of the most significant bit in the bit field.
1082 @param AndData The value to AND with the read value from the I/O port.
1084 @return The value written back to the I/O port.
1098 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1103 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1104 bitwise inclusive OR, and writes the result back to the bit field in the
1107 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1108 by a bitwise inclusive OR between the read result and the value specified by
1109 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1110 value written to the I/O port is returned. This function must guarantee that
1111 all I/O read and write operations are serialized. Extra left bits in both
1112 AndData and OrData are stripped.
1114 If 64-bit I/O port operations are not supported, then ASSERT().
1115 If StartBit is greater than 63, then ASSERT().
1116 If EndBit is greater than 63, then ASSERT().
1117 If EndBit is less than or equal to StartBit, then ASSERT().
1119 @param Port The I/O port to write.
1120 @param StartBit The ordinal of the least significant bit in the bit field.
1122 @param EndBit The ordinal of the most significant bit in the bit field.
1124 @param AndData The value to AND with the read value from the I/O port.
1125 @param OrData The value to OR with the result of the AND operation.
1127 @return The value written back to the I/O port.
1132 IoBitFieldAndThenOr64 (
1142 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1147 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1148 result back to the 8-bit MMIO register.
1150 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1151 inclusive OR between the read result and the value specified by OrData, and
1152 writes the result to the 8-bit MMIO register specified by Address. The value
1153 written to the MMIO register is returned. This function must guarantee that
1154 all MMIO read and write operations are serialized.
1156 If 8-bit MMIO register operations are not supported, then ASSERT().
1158 @param Address The MMIO register to write.
1159 @param OrData The value to OR with the read value from the MMIO register.
1161 @return The value written back to the MMIO register.
1171 return MmioWrite8 (Address
, MmioRead8 (Address
) | OrData
);
1175 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1176 back to the 8-bit MMIO register.
1178 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1179 between the read result and the value specified by AndData, and writes the
1180 result to the 8-bit MMIO register specified by Address. The value written to
1181 the MMIO register is returned. This function must guarantee that all MMIO
1182 read and write operations are serialized.
1184 If 8-bit MMIO register operations are not supported, then ASSERT().
1186 @param Address The MMIO register to write.
1187 @param AndData The value to AND with the read value from the MMIO register.
1189 @return The value written back to the MMIO register.
1199 return MmioWrite8 (Address
, MmioRead8 (Address
) & AndData
);
1203 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1204 inclusive OR, and writes the result back to the 8-bit MMIO register.
1206 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1207 between the read result and the value specified by AndData, performs a
1208 bitwise OR between the result of the AND operation and the value specified by
1209 OrData, and writes the result to the 8-bit MMIO register specified by
1210 Address. The value written to the MMIO register is returned. This function
1211 must guarantee that all MMIO read and write operations are serialized.
1213 If 8-bit MMIO register operations are not supported, then ASSERT().
1216 @param Address The MMIO register to write.
1217 @param AndData The value to AND with the read value from the MMIO register.
1218 @param OrData The value to OR with the result of the AND operation.
1220 @return The value written back to the MMIO register.
1231 return MmioWrite8 (Address
, (MmioRead8 (Address
) & AndData
) | OrData
);
1235 Reads a bit field of a MMIO register.
1237 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1238 the StartBit and the EndBit. The value of the bit field is returned.
1240 If 8-bit MMIO register operations are not supported, then ASSERT().
1241 If StartBit is greater than 7, then ASSERT().
1242 If EndBit is greater than 7, then ASSERT().
1243 If EndBit is less than or equal to StartBit, then ASSERT().
1245 @param Address MMIO register to read.
1246 @param StartBit The ordinal of the least significant bit in the bit field.
1248 @param EndBit The ordinal of the most significant bit in the bit field.
1251 @return The value read.
1262 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1266 Writes a bit field to a MMIO register.
1268 Writes Value to the bit field of the MMIO register. The bit field is
1269 specified by the StartBit and the EndBit. All other bits in the destination
1270 MMIO register are preserved. The new value of the 8-bit register is returned.
1272 If 8-bit MMIO register operations are not supported, then ASSERT().
1273 If StartBit is greater than 7, then ASSERT().
1274 If EndBit is greater than 7, then ASSERT().
1275 If EndBit is less than or equal to StartBit, then ASSERT().
1277 @param Address MMIO register to write.
1278 @param StartBit The ordinal of the least significant bit in the bit field.
1280 @param EndBit The ordinal of the most significant bit in the bit field.
1282 @param Value New value of the bit field.
1284 @return The value written back to the MMIO register.
1289 MmioBitFieldWrite8 (
1298 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1303 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1304 writes the result back to the bit field in the 8-bit MMIO register.
1306 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1307 inclusive OR between the read result and the value specified by OrData, and
1308 writes the result to the 8-bit MMIO register specified by Address. The value
1309 written to the MMIO register is returned. This function must guarantee that
1310 all MMIO read and write operations are serialized. Extra left bits in OrData
1313 If 8-bit MMIO register operations are not supported, then ASSERT().
1314 If StartBit is greater than 7, then ASSERT().
1315 If EndBit is greater than 7, then ASSERT().
1316 If EndBit is less than or equal to StartBit, then ASSERT().
1318 @param Address MMIO register to write.
1319 @param StartBit The ordinal of the least significant bit in the bit field.
1321 @param EndBit The ordinal of the most significant bit in the bit field.
1323 @param OrData The value to OR with read value from the MMIO register.
1325 @return The value written back to the MMIO register.
1339 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1344 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, 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 AND
1348 between the read result and the value specified by AndData, and writes the
1349 result to the 8-bit MMIO register specified by Address. The value written to
1350 the MMIO register is returned. This function must guarantee that all MMIO
1351 read and write operations are serialized. Extra left bits in AndData are
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 or equal to 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 AndData The value to AND with read value from the MMIO register.
1366 @return The value written back to the MMIO register.
1380 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1385 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1386 by a bitwise inclusive OR, and writes the result back to the bit field in the
1387 8-bit MMIO register.
1389 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1390 followed by a bitwise inclusive OR between the read result and the value
1391 specified by AndData, and writes the result to the 8-bit MMIO register
1392 specified by Address. The value written to the MMIO register is returned.
1393 This function must guarantee that all MMIO read and write operations are
1394 serialized. Extra left bits in both AndData and OrData are stripped.
1396 If 8-bit MMIO register operations are not supported, then ASSERT().
1397 If StartBit is greater than 7, then ASSERT().
1398 If EndBit is greater than 7, then ASSERT().
1399 If EndBit is less than or equal to StartBit, then ASSERT().
1401 @param Address MMIO register to write.
1402 @param StartBit The ordinal of the least significant bit in the bit field.
1404 @param EndBit The ordinal of the most significant bit in the bit field.
1406 @param AndData The value to AND with read value from the MMIO register.
1407 @param OrData The value to OR with the result of the AND operation.
1409 @return The value written back to the MMIO register.
1414 MmioBitFieldAndThenOr8 (
1424 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1429 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1430 result back to the 16-bit MMIO register.
1432 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1433 inclusive OR between the read result and the value specified by OrData, and
1434 writes the result to the 16-bit MMIO register specified by Address. The value
1435 written to the MMIO register is returned. This function must guarantee that
1436 all MMIO read and write operations are serialized.
1438 If 16-bit MMIO register operations are not supported, then ASSERT().
1440 @param Address The MMIO register to write.
1441 @param OrData The value to OR with the read value from the MMIO register.
1443 @return The value written back to the MMIO register.
1453 return MmioWrite16 (Address
, MmioRead16 (Address
) | OrData
);
1457 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1458 back to the 16-bit MMIO register.
1460 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1461 between the read result and the value specified by AndData, and writes the
1462 result to the 16-bit MMIO register specified by Address. The value written to
1463 the MMIO register is returned. This function must guarantee that all MMIO
1464 read and write operations are serialized.
1466 If 16-bit MMIO register operations are not supported, then ASSERT().
1468 @param Address The MMIO register to write.
1469 @param AndData The value to AND with the read value from the MMIO register.
1471 @return The value written back to the MMIO register.
1481 return MmioWrite16 (Address
, MmioRead16 (Address
) & AndData
);
1485 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1486 inclusive OR, and writes the result back to the 16-bit MMIO register.
1488 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1489 between the read result and the value specified by AndData, performs a
1490 bitwise OR between the result of the AND operation and the value specified by
1491 OrData, and writes the result to the 16-bit MMIO register specified by
1492 Address. The value written to the MMIO register is returned. This function
1493 must guarantee that all MMIO read and write operations are serialized.
1495 If 16-bit MMIO register operations are not supported, then ASSERT().
1498 @param Address The MMIO register to write.
1499 @param AndData The value to AND with the read value from the MMIO register.
1500 @param OrData The value to OR with the result of the AND operation.
1502 @return The value written back to the MMIO register.
1513 return MmioWrite16 (Address
, (MmioRead16 (Address
) & AndData
) | OrData
);
1517 Reads a bit field of a MMIO register.
1519 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1520 the StartBit and the EndBit. The value of the bit field is returned.
1522 If 16-bit MMIO register operations are not supported, then ASSERT().
1523 If StartBit is greater than 15, then ASSERT().
1524 If EndBit is greater than 15, then ASSERT().
1525 If EndBit is less than or equal to StartBit, then ASSERT().
1527 @param Address MMIO register to read.
1528 @param StartBit The ordinal of the least significant bit in the bit field.
1530 @param EndBit The ordinal of the most significant bit in the bit field.
1533 @return The value read.
1538 MmioBitFieldRead16 (
1544 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1548 Writes a bit field to a MMIO register.
1550 Writes Value to the bit field of the MMIO register. The bit field is
1551 specified by the StartBit and the EndBit. All other bits in the destination
1552 MMIO register are preserved. The new value of the 16-bit register is returned.
1554 If 16-bit MMIO register operations are not supported, then ASSERT().
1555 If StartBit is greater than 15, then ASSERT().
1556 If EndBit is greater than 15, then ASSERT().
1557 If EndBit is less than or equal to StartBit, then ASSERT().
1559 @param Address MMIO register to write.
1560 @param StartBit The ordinal of the least significant bit in the bit field.
1562 @param EndBit The ordinal of the most significant bit in the bit field.
1564 @param Value New value of the bit field.
1566 @return The value written back to the MMIO register.
1571 MmioBitFieldWrite16 (
1578 return MmioWrite16 (
1580 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1585 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1586 writes the result back to the bit field in the 16-bit MMIO register.
1588 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1589 inclusive OR between the read result and the value specified by OrData, and
1590 writes the result to the 16-bit MMIO register specified by Address. The value
1591 written to the MMIO register is returned. This function must guarantee that
1592 all MMIO read and write operations are serialized. Extra left bits in OrData
1595 If 16-bit MMIO register operations are not supported, then ASSERT().
1596 If StartBit is greater than 15, then ASSERT().
1597 If EndBit is greater than 15, then ASSERT().
1598 If EndBit is less than or equal to StartBit, then ASSERT().
1600 @param Address MMIO register to write.
1601 @param StartBit The ordinal of the least significant bit in the bit field.
1603 @param EndBit The ordinal of the most significant bit in the bit field.
1605 @param OrData The value to OR with read value from the MMIO register.
1607 @return The value written back to the MMIO register.
1619 return MmioWrite16 (
1621 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1626 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1627 writes the result back to the bit field in the 16-bit MMIO register.
1629 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1630 between the read result and the value specified by AndData, and writes the
1631 result to the 16-bit MMIO register specified by Address. The value written to
1632 the MMIO register is returned. This function must guarantee that all MMIO
1633 read and write operations are serialized. Extra left bits in AndData are
1636 If 16-bit MMIO register operations are not supported, then ASSERT().
1637 If StartBit is greater than 15, then ASSERT().
1638 If EndBit is greater than 15, then ASSERT().
1639 If EndBit is less than or equal to StartBit, then ASSERT().
1641 @param Address MMIO register to write.
1642 @param StartBit The ordinal of the least significant bit in the bit field.
1644 @param EndBit The ordinal of the most significant bit in the bit field.
1646 @param AndData The value to AND with read value from the MMIO register.
1648 @return The value written back to the MMIO register.
1660 return MmioWrite16 (
1662 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1667 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1668 by a bitwise inclusive OR, and writes the result back to the bit field in the
1669 16-bit MMIO register.
1671 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1672 followed by a bitwise inclusive OR between the read result and the value
1673 specified by AndData, and writes the result to the 16-bit MMIO register
1674 specified by Address. The value written to the MMIO register is returned.
1675 This function must guarantee that all MMIO read and write operations are
1676 serialized. Extra left bits in both AndData and OrData are stripped.
1678 If 16-bit MMIO register operations are not supported, then ASSERT().
1679 If StartBit is greater than 15, then ASSERT().
1680 If EndBit is greater than 15, then ASSERT().
1681 If EndBit is less than or equal to StartBit, then ASSERT().
1683 @param Address MMIO register to write.
1684 @param StartBit The ordinal of the least significant bit in the bit field.
1686 @param EndBit The ordinal of the most significant bit in the bit field.
1688 @param AndData The value to AND with read value from the MMIO register.
1689 @param OrData The value to OR with the result of the AND operation.
1691 @return The value written back to the MMIO register.
1696 MmioBitFieldAndThenOr16 (
1704 return MmioWrite16 (
1706 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1711 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1712 result back to the 32-bit MMIO register.
1714 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1715 inclusive OR between the read result and the value specified by OrData, and
1716 writes the result to the 32-bit MMIO register specified by Address. The value
1717 written to the MMIO register is returned. This function must guarantee that
1718 all MMIO read and write operations are serialized.
1720 If 32-bit MMIO register operations are not supported, then ASSERT().
1722 @param Address The MMIO register to write.
1723 @param OrData The value to OR with the read value from the MMIO register.
1725 @return The value written back to the MMIO register.
1735 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1739 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1740 back to the 32-bit MMIO register.
1742 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1743 between the read result and the value specified by AndData, and writes the
1744 result to the 32-bit MMIO register specified by Address. The value written to
1745 the MMIO register is returned. This function must guarantee that all MMIO
1746 read and write operations are serialized.
1748 If 32-bit MMIO register operations are not supported, then ASSERT().
1750 @param Address The MMIO register to write.
1751 @param AndData The value to AND with the read value from the MMIO register.
1753 @return The value written back to the MMIO register.
1763 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1767 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1768 inclusive OR, and writes the result back to the 32-bit MMIO register.
1770 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1771 between the read result and the value specified by AndData, performs a
1772 bitwise OR between the result of the AND operation and the value specified by
1773 OrData, and writes the result to the 32-bit MMIO register specified by
1774 Address. The value written to the MMIO register is returned. This function
1775 must guarantee that all MMIO read and write operations are serialized.
1777 If 32-bit MMIO register operations are not supported, then ASSERT().
1780 @param Address The MMIO register to write.
1781 @param AndData The value to AND with the read value from the MMIO register.
1782 @param OrData The value to OR with the result of the AND operation.
1784 @return The value written back to the MMIO register.
1795 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1799 Reads a bit field of a MMIO register.
1801 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1802 the StartBit and the EndBit. The value of the bit field is returned.
1804 If 32-bit MMIO register operations are not supported, then ASSERT().
1805 If StartBit is greater than 31, then ASSERT().
1806 If EndBit is greater than 31, then ASSERT().
1807 If EndBit is less than or equal to StartBit, then ASSERT().
1809 @param Address MMIO register to read.
1810 @param StartBit The ordinal of the least significant bit in the bit field.
1812 @param EndBit The ordinal of the most significant bit in the bit field.
1815 @return The value read.
1820 MmioBitFieldRead32 (
1826 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1830 Writes a bit field to a MMIO register.
1832 Writes Value to the bit field of the MMIO register. The bit field is
1833 specified by the StartBit and the EndBit. All other bits in the destination
1834 MMIO register are preserved. The new value of the 32-bit register is returned.
1836 If 32-bit MMIO register operations are not supported, then ASSERT().
1837 If StartBit is greater than 31, then ASSERT().
1838 If EndBit is greater than 31, then ASSERT().
1839 If EndBit is less than or equal to StartBit, then ASSERT().
1841 @param Address MMIO register to write.
1842 @param StartBit The ordinal of the least significant bit in the bit field.
1844 @param EndBit The ordinal of the most significant bit in the bit field.
1846 @param Value New value of the bit field.
1848 @return The value written back to the MMIO register.
1853 MmioBitFieldWrite32 (
1860 return MmioWrite32 (
1862 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1867 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1868 writes the result back to the bit field in the 32-bit MMIO register.
1870 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1871 inclusive OR between the read result and the value specified by OrData, and
1872 writes the result to the 32-bit MMIO register specified by Address. The value
1873 written to the MMIO register is returned. This function must guarantee that
1874 all MMIO read and write operations are serialized. Extra left bits in OrData
1877 If 32-bit MMIO register operations are not supported, then ASSERT().
1878 If StartBit is greater than 31, then ASSERT().
1879 If EndBit is greater than 31, then ASSERT().
1880 If EndBit is less than or equal to StartBit, then ASSERT().
1882 @param Address MMIO register to write.
1883 @param StartBit The ordinal of the least significant bit in the bit field.
1885 @param EndBit The ordinal of the most significant bit in the bit field.
1887 @param OrData The value to OR with read value from the MMIO register.
1889 @return The value written back to the MMIO register.
1901 return MmioWrite32 (
1903 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1908 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1909 writes the result back to the bit field in the 32-bit MMIO register.
1911 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1912 between the read result and the value specified by AndData, and writes the
1913 result to the 32-bit MMIO register specified by Address. The value written to
1914 the MMIO register is returned. This function must guarantee that all MMIO
1915 read and write operations are serialized. Extra left bits in AndData are
1918 If 32-bit MMIO register operations are not supported, then ASSERT().
1919 If StartBit is greater than 31, then ASSERT().
1920 If EndBit is greater than 31, then ASSERT().
1921 If EndBit is less than or equal to StartBit, then ASSERT().
1923 @param Address MMIO register to write.
1924 @param StartBit The ordinal of the least significant bit in the bit field.
1926 @param EndBit The ordinal of the most significant bit in the bit field.
1928 @param AndData The value to AND with read value from the MMIO register.
1930 @return The value written back to the MMIO register.
1942 return MmioWrite32 (
1944 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1949 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1950 by a bitwise inclusive OR, and writes the result back to the bit field in the
1951 32-bit MMIO register.
1953 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1954 followed by a bitwise inclusive OR between the read result and the value
1955 specified by AndData, and writes the result to the 32-bit MMIO register
1956 specified by Address. The value written to the MMIO register is returned.
1957 This function must guarantee that all MMIO read and write operations are
1958 serialized. Extra left bits in both AndData and OrData are stripped.
1960 If 32-bit MMIO register operations are not supported, then ASSERT().
1961 If StartBit is greater than 31, then ASSERT().
1962 If EndBit is greater than 31, then ASSERT().
1963 If EndBit is less than or equal to StartBit, then ASSERT().
1965 @param Address MMIO register to write.
1966 @param StartBit The ordinal of the least significant bit in the bit field.
1968 @param EndBit The ordinal of the most significant bit in the bit field.
1970 @param AndData The value to AND with read value from the MMIO register.
1971 @param OrData The value to OR with the result of the AND operation.
1973 @return The value written back to the MMIO register.
1978 MmioBitFieldAndThenOr32 (
1986 return MmioWrite32 (
1988 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1993 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
1994 result back to the 64-bit MMIO register.
1996 Reads the 64-bit MMIO register specified by Address, performs a bitwise
1997 inclusive OR between the read result and the value specified by OrData, and
1998 writes the result to the 64-bit MMIO register specified by Address. The value
1999 written to the MMIO register is returned. This function must guarantee that
2000 all MMIO read and write operations are serialized.
2002 If 64-bit MMIO register operations are not supported, then ASSERT().
2004 @param Address The MMIO register to write.
2005 @param OrData The value to OR with the read value from the MMIO register.
2007 @return The value written back to the MMIO register.
2017 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2021 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2022 back to the 64-bit MMIO register.
2024 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2025 between the read result and the value specified by AndData, and writes the
2026 result to the 64-bit MMIO register specified by Address. The value written to
2027 the MMIO register is returned. This function must guarantee that all MMIO
2028 read and write operations are serialized.
2030 If 64-bit MMIO register operations are not supported, then ASSERT().
2032 @param Address The MMIO register to write.
2033 @param AndData The value to AND with the read value from the MMIO register.
2035 @return The value written back to the MMIO register.
2045 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2049 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2050 inclusive OR, and writes the result back to the 64-bit MMIO register.
2052 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2053 between the read result and the value specified by AndData, performs a
2054 bitwise OR between the result of the AND operation and the value specified by
2055 OrData, and writes the result to the 64-bit MMIO register specified by
2056 Address. The value written to the MMIO register is returned. This function
2057 must guarantee that all MMIO read and write operations are serialized.
2059 If 64-bit MMIO register operations are not supported, then ASSERT().
2062 @param Address The MMIO register to write.
2063 @param AndData The value to AND with the read value from the MMIO register.
2064 @param OrData The value to OR with the result of the AND operation.
2066 @return The value written back to the MMIO register.
2077 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2081 Reads a bit field of a MMIO register.
2083 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2084 the StartBit and the EndBit. The value of the bit field is returned.
2086 If 64-bit MMIO register operations are not supported, then ASSERT().
2087 If StartBit is greater than 63, then ASSERT().
2088 If EndBit is greater than 63, then ASSERT().
2089 If EndBit is less than or equal to StartBit, then ASSERT().
2091 @param Address MMIO register to read.
2092 @param StartBit The ordinal of the least significant bit in the bit field.
2094 @param EndBit The ordinal of the most significant bit in the bit field.
2097 @return The value read.
2102 MmioBitFieldRead64 (
2108 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2112 Writes a bit field to a MMIO register.
2114 Writes Value to the bit field of the MMIO register. The bit field is
2115 specified by the StartBit and the EndBit. All other bits in the destination
2116 MMIO register are preserved. The new value of the 64-bit register is returned.
2118 If 64-bit MMIO register operations are not supported, then ASSERT().
2119 If StartBit is greater than 63, then ASSERT().
2120 If EndBit is greater than 63, then ASSERT().
2121 If EndBit is less than or equal to StartBit, then ASSERT().
2123 @param Address MMIO register to write.
2124 @param StartBit The ordinal of the least significant bit in the bit field.
2126 @param EndBit The ordinal of the most significant bit in the bit field.
2128 @param Value New value of the bit field.
2130 @return The value written back to the MMIO register.
2135 MmioBitFieldWrite64 (
2142 return MmioWrite64 (
2144 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2149 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2150 writes the result back to the bit field in the 64-bit MMIO register.
2152 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2153 inclusive OR between the read result and the value specified by OrData, and
2154 writes the result to the 64-bit MMIO register specified by Address. The value
2155 written to the MMIO register is returned. This function must guarantee that
2156 all MMIO read and write operations are serialized. Extra left bits in OrData
2159 If 64-bit MMIO register operations are not supported, then ASSERT().
2160 If StartBit is greater than 63, then ASSERT().
2161 If EndBit is greater than 63, then ASSERT().
2162 If EndBit is less than or equal to StartBit, then ASSERT().
2164 @param Address MMIO register to write.
2165 @param StartBit The ordinal of the least significant bit in the bit field.
2167 @param EndBit The ordinal of the most significant bit in the bit field.
2169 @param OrData The value to OR with read value from the MMIO register.
2171 @return The value written back to the MMIO register.
2183 return MmioWrite64 (
2185 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2190 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2191 writes the result back to the bit field in the 64-bit MMIO register.
2193 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2194 between the read result and the value specified by AndData, and writes the
2195 result to the 64-bit MMIO register specified by Address. The value written to
2196 the MMIO register is returned. This function must guarantee that all MMIO
2197 read and write operations are serialized. Extra left bits in AndData are
2200 If 64-bit MMIO register operations are not supported, then ASSERT().
2201 If StartBit is greater than 63, then ASSERT().
2202 If EndBit is greater than 63, then ASSERT().
2203 If EndBit is less than or equal to StartBit, then ASSERT().
2205 @param Address MMIO register to write.
2206 @param StartBit The ordinal of the least significant bit in the bit field.
2208 @param EndBit The ordinal of the most significant bit in the bit field.
2210 @param AndData The value to AND with read value from the MMIO register.
2212 @return The value written back to the MMIO register.
2224 return MmioWrite64 (
2226 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2231 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2232 by a bitwise inclusive OR, and writes the result back to the bit field in the
2233 64-bit MMIO register.
2235 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2236 followed by a bitwise inclusive OR between the read result and the value
2237 specified by AndData, and writes the result to the 64-bit MMIO register
2238 specified by Address. The value written to the MMIO register is returned.
2239 This function must guarantee that all MMIO read and write operations are
2240 serialized. Extra left bits in both AndData and OrData are stripped.
2242 If 64-bit MMIO register operations are not supported, then ASSERT().
2243 If StartBit is greater than 63, then ASSERT().
2244 If EndBit is greater than 63, then ASSERT().
2245 If EndBit is less than or equal to StartBit, then ASSERT().
2247 @param Address MMIO register to write.
2248 @param StartBit The ordinal of the least significant bit in the bit field.
2250 @param EndBit The ordinal of the most significant bit in the bit field.
2252 @param AndData The value to AND with read value from the MMIO register.
2253 @param OrData The value to OR with the result of the AND operation.
2255 @return The value written back to the MMIO register.
2260 MmioBitFieldAndThenOr64 (
2268 return MmioWrite64 (
2270 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)