d9702c9f57f779e81f69a7153539069d5e3eec37
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 // Include common header file for this module.
29 #include "CommonHeader.h"
32 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
33 result back to the 8-bit I/O port.
35 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
36 between the read result and the value specified by OrData, and writes the
37 result to the 8-bit I/O port specified by Port. The value written to the I/O
38 port is returned. This function must guarantee that all I/O read and write
39 operations are serialized.
41 If 8-bit I/O port operations are not supported, then ASSERT().
43 @param Port The I/O port to write.
44 @param OrData The value to OR with the read value from the I/O port.
46 @return The value written back to the I/O port.
56 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
60 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
61 to the 8-bit I/O port.
63 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
64 the read result and the value specified by AndData, and writes the result to
65 the 8-bit I/O port specified by Port. The value written to the I/O port is
66 returned. This function must guarantee that all I/O read and write operations
69 If 8-bit I/O port operations are not supported, then ASSERT().
71 @param Port The I/O port to write.
72 @param AndData The value to AND with the read value from the I/O port.
74 @return The value written back to the I/O port.
84 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
88 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
89 inclusive OR, and writes the result back to the 8-bit I/O port.
91 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
92 the read result and the value specified by AndData, performs a bitwise OR
93 between the result of the AND operation and the value specified by OrData,
94 and writes the result to the 8-bit I/O port specified by Port. The value
95 written to the I/O port is returned. This function must guarantee that all
96 I/O read and write operations are serialized.
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.
102 @param OrData The value to OR with the result of the AND operation.
104 @return The value written back to the I/O port.
115 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
119 Reads a bit field of an I/O register.
121 Reads the bit field in an 8-bit I/O register. The bit field is specified by
122 the StartBit and the EndBit. The value of the bit field is returned.
124 If 8-bit I/O port operations are not supported, then ASSERT().
125 If StartBit is greater than 7, then ASSERT().
126 If EndBit is greater than 7, then ASSERT().
127 If EndBit is less than StartBit, then ASSERT().
129 @param Port The I/O port to read.
130 @param StartBit The ordinal of the least significant bit in the bit field.
132 @param EndBit The ordinal of the most significant bit in the bit field.
135 @return The value read.
146 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
150 Writes a bit field to an I/O register.
152 Writes Value to the bit field of the I/O register. The bit field is specified
153 by the StartBit and the EndBit. All other bits in the destination I/O
154 register are preserved. The value written to the I/O port is returned. Extra
155 left bits in Value are stripped.
157 If 8-bit I/O port operations are not supported, then ASSERT().
158 If StartBit is greater than 7, then ASSERT().
159 If EndBit is greater than 7, then ASSERT().
160 If EndBit is less than StartBit, then ASSERT().
162 @param Port The I/O port to write.
163 @param StartBit The ordinal of the least significant bit in the bit field.
165 @param EndBit The ordinal of the most significant bit in the bit field.
167 @param Value New value of the bit field.
169 @return The value written back to the I/O port.
183 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
188 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
189 result back to the bit field in the 8-bit port.
191 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
192 between the read result and the value specified by OrData, and writes the
193 result to the 8-bit I/O port specified by Port. The value written to the I/O
194 port is returned. This function must guarantee that all I/O read and write
195 operations are serialized. Extra left bits in OrData are stripped.
197 If 8-bit I/O port operations are not supported, then ASSERT().
198 If StartBit is greater than 7, then ASSERT().
199 If EndBit is greater than 7, then ASSERT().
200 If EndBit is less than StartBit, then ASSERT().
202 @param Port The I/O port to write.
203 @param StartBit The ordinal of the least significant bit in the bit field.
205 @param EndBit The ordinal of the most significant bit in the bit field.
207 @param OrData The value to OR with the read value from the I/O port.
209 @return The value written back to the I/O port.
223 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
228 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
229 result back to the bit field in the 8-bit port.
231 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
232 the read result and the value specified by AndData, and writes the result to
233 the 8-bit I/O port specified by Port. The value written to the I/O port is
234 returned. This function must guarantee that all I/O read and write operations
235 are serialized. Extra left bits in AndData are stripped.
237 If 8-bit I/O port operations are not supported, then ASSERT().
238 If StartBit is greater than 7, then ASSERT().
239 If EndBit is greater than 7, then ASSERT().
240 If EndBit is less than StartBit, then ASSERT().
242 @param Port The I/O port to write.
243 @param StartBit The ordinal of the least significant bit in the bit field.
245 @param EndBit The ordinal of the most significant bit in the bit field.
247 @param AndData The value to AND with the read value from the I/O port.
249 @return The value written back to the I/O port.
263 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
268 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
269 bitwise inclusive OR, and writes the result back to the bit field in the
272 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
273 by a bitwise inclusive OR between the read result and the value specified by
274 AndData, and writes the result to the 8-bit I/O port specified by Port. The
275 value written to the I/O port is returned. This function must guarantee that
276 all I/O read and write operations are serialized. Extra left bits in both
277 AndData and OrData are stripped.
279 If 8-bit I/O port operations are not supported, then ASSERT().
280 If StartBit is greater than 7, then ASSERT().
281 If EndBit is greater than 7, then ASSERT().
282 If EndBit is less than StartBit, then ASSERT().
284 @param Port The I/O port to write.
285 @param StartBit The ordinal of the least significant bit in the bit field.
287 @param EndBit The ordinal of the most significant bit in the bit field.
289 @param AndData The value to AND with the read value from the I/O port.
290 @param OrData The value to OR with the result of the AND operation.
292 @return The value written back to the I/O port.
297 IoBitFieldAndThenOr8 (
307 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
312 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
313 result back to the 16-bit I/O port.
315 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
316 between the read result and the value specified by OrData, and writes the
317 result to the 16-bit I/O port specified by Port. The value written to the I/O
318 port is returned. This function must guarantee that all I/O read and write
319 operations are serialized.
321 If 16-bit I/O port operations are not supported, then ASSERT().
323 @param Port The I/O port to write.
324 @param OrData The value to OR with the read value from the I/O port.
326 @return The value written back to the I/O port.
336 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
340 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
341 to the 16-bit I/O port.
343 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
344 the read result and the value specified by AndData, and writes the result to
345 the 16-bit I/O port specified by Port. The value written to the I/O port is
346 returned. This function must guarantee that all I/O read and write operations
349 If 16-bit I/O port operations are not supported, then ASSERT().
351 @param Port The I/O port to write.
352 @param AndData The value to AND with the read value from the I/O port.
354 @return The value written back to the I/O port.
364 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
368 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
369 inclusive OR, and writes the result back to the 16-bit I/O port.
371 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
372 the read result and the value specified by AndData, performs a bitwise OR
373 between the result of the AND operation and the value specified by OrData,
374 and writes the result to the 16-bit I/O port specified by Port. The value
375 written to the I/O port is returned. This function must guarantee that all
376 I/O read and write operations are serialized.
378 If 16-bit I/O port operations are not supported, then ASSERT().
380 @param Port The I/O port to write.
381 @param AndData The value to AND with the read value from the I/O port.
382 @param OrData The value to OR with the result of the AND operation.
384 @return The value written back to the I/O port.
395 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
399 Reads a bit field of an I/O register.
401 Reads the bit field in a 16-bit I/O register. The bit field is specified by
402 the StartBit and the EndBit. The value of the bit field is returned.
404 If 16-bit I/O port operations are not supported, then ASSERT().
405 If StartBit is greater than 15, then ASSERT().
406 If EndBit is greater than 15, then ASSERT().
407 If EndBit is less than StartBit, then ASSERT().
409 @param Port The I/O port to read.
410 @param StartBit The ordinal of the least significant bit in the bit field.
412 @param EndBit The ordinal of the most significant bit in the bit field.
415 @return The value read.
426 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
430 Writes a bit field to an I/O register.
432 Writes Value to the bit field of the I/O register. The bit field is specified
433 by the StartBit and the EndBit. All other bits in the destination I/O
434 register are preserved. The value written to the I/O port is returned. Extra
435 left bits in Value are stripped.
437 If 16-bit I/O port operations are not supported, then ASSERT().
438 If StartBit is greater than 15, then ASSERT().
439 If EndBit is greater than 15, then ASSERT().
440 If EndBit is less than StartBit, then ASSERT().
442 @param Port The I/O port to write.
443 @param StartBit The ordinal of the least significant bit in the bit field.
445 @param EndBit The ordinal of the most significant bit in the bit field.
447 @param Value New value of the bit field.
449 @return The value written back to the I/O port.
463 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
468 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
469 result back to the bit field in the 16-bit port.
471 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
472 between the read result and the value specified by OrData, and writes the
473 result to the 16-bit I/O port specified by Port. The value written to the I/O
474 port is returned. This function must guarantee that all I/O read and write
475 operations are serialized. Extra left bits in OrData are stripped.
477 If 16-bit I/O port operations are not supported, then ASSERT().
478 If StartBit is greater than 15, then ASSERT().
479 If EndBit is greater than 15, then ASSERT().
480 If EndBit is less than StartBit, then ASSERT().
482 @param Port The I/O port to write.
483 @param StartBit The ordinal of the least significant bit in the bit field.
485 @param EndBit The ordinal of the most significant bit in the bit field.
487 @param OrData The value to OR with the read value from the I/O port.
489 @return The value written back to the I/O port.
503 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
508 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
509 result back to the bit field in the 16-bit port.
511 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
512 the read result and the value specified by AndData, and writes the result to
513 the 16-bit I/O port specified by Port. The value written to the I/O port is
514 returned. This function must guarantee that all I/O read and write operations
515 are serialized. Extra left bits in AndData are stripped.
517 If 16-bit I/O port operations are not supported, then ASSERT().
518 If StartBit is greater than 15, then ASSERT().
519 If EndBit is greater than 15, then ASSERT().
520 If EndBit is less than StartBit, then ASSERT().
522 @param Port The I/O port to write.
523 @param StartBit The ordinal of the least significant bit in the bit field.
525 @param EndBit The ordinal of the most significant bit in the bit field.
527 @param AndData The value to AND with the read value from the I/O port.
529 @return The value written back to the I/O port.
543 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
548 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
549 bitwise inclusive OR, and writes the result back to the bit field in the
552 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
553 by a bitwise inclusive OR between the read result and the value specified by
554 AndData, and writes the result to the 16-bit I/O port specified by Port. The
555 value written to the I/O port is returned. This function must guarantee that
556 all I/O read and write operations are serialized. Extra left bits in both
557 AndData and OrData are stripped.
559 If 16-bit I/O port operations are not supported, then ASSERT().
560 If StartBit is greater than 15, then ASSERT().
561 If EndBit is greater than 15, then ASSERT().
562 If EndBit is less than StartBit, then ASSERT().
564 @param Port The I/O port to write.
565 @param StartBit The ordinal of the least significant bit in the bit field.
567 @param EndBit The ordinal of the most significant bit in the bit field.
569 @param AndData The value to AND with the read value from the I/O port.
570 @param OrData The value to OR with the result of the AND operation.
572 @return The value written back to the I/O port.
577 IoBitFieldAndThenOr16 (
587 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
592 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
593 result back to the 32-bit I/O port.
595 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
596 between the read result and the value specified by OrData, and writes the
597 result to the 32-bit I/O port specified by Port. The value written to the I/O
598 port is returned. This function must guarantee that all I/O read and write
599 operations are serialized.
601 If 32-bit I/O port operations are not supported, then ASSERT().
603 @param Port The I/O port to write.
604 @param OrData The value to OR with the read value from the I/O port.
606 @return The value written back to the I/O port.
616 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
620 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
621 to the 32-bit I/O port.
623 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
624 the read result and the value specified by AndData, and writes the result to
625 the 32-bit I/O port specified by Port. The value written to the I/O port is
626 returned. This function must guarantee that all I/O read and write operations
629 If 32-bit I/O port operations are not supported, then ASSERT().
631 @param Port The I/O port to write.
632 @param AndData The value to AND with the read value from the I/O port.
634 @return The value written back to the I/O port.
644 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
648 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
649 inclusive OR, and writes the result back to the 32-bit I/O port.
651 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
652 the read result and the value specified by AndData, performs a bitwise OR
653 between the result of the AND operation and the value specified by OrData,
654 and writes the result to the 32-bit I/O port specified by Port. The value
655 written to the I/O port is returned. This function must guarantee that all
656 I/O read and write operations are serialized.
658 If 32-bit I/O port operations are not supported, then ASSERT().
660 @param Port The I/O port to write.
661 @param AndData The value to AND with the read value from the I/O port.
662 @param OrData The value to OR with the result of the AND operation.
664 @return The value written back to the I/O port.
675 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
679 Reads a bit field of an I/O register.
681 Reads the bit field in a 32-bit I/O register. The bit field is specified by
682 the StartBit and the EndBit. The value of the bit field is returned.
684 If 32-bit I/O port operations are not supported, then ASSERT().
685 If StartBit is greater than 31, then ASSERT().
686 If EndBit is greater than 31, then ASSERT().
687 If EndBit is less than StartBit, then ASSERT().
689 @param Port The I/O port to read.
690 @param StartBit The ordinal of the least significant bit in the bit field.
692 @param EndBit The ordinal of the most significant bit in the bit field.
695 @return The value read.
706 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
710 Writes a bit field to an I/O register.
712 Writes Value to the bit field of the I/O register. The bit field is specified
713 by the StartBit and the EndBit. All other bits in the destination I/O
714 register are preserved. The value written to the I/O port is returned. Extra
715 left bits in Value are stripped.
717 If 32-bit I/O port operations are not supported, then ASSERT().
718 If StartBit is greater than 31, then ASSERT().
719 If EndBit is greater than 31, then ASSERT().
720 If EndBit is less than StartBit, then ASSERT().
722 @param Port The I/O port to write.
723 @param StartBit The ordinal of the least significant bit in the bit field.
725 @param EndBit The ordinal of the most significant bit in the bit field.
727 @param Value New value of the bit field.
729 @return The value written back to the I/O port.
743 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
748 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
749 result back to the bit field in the 32-bit port.
751 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
752 between the read result and the value specified by OrData, and writes the
753 result to the 32-bit I/O port specified by Port. The value written to the I/O
754 port is returned. This function must guarantee that all I/O read and write
755 operations are serialized. Extra left bits in OrData are stripped.
757 If 32-bit I/O port operations are not supported, then ASSERT().
758 If StartBit is greater than 31, then ASSERT().
759 If EndBit is greater than 31, then ASSERT().
760 If EndBit is less than StartBit, then ASSERT().
762 @param Port The I/O port to write.
763 @param StartBit The ordinal of the least significant bit in the bit field.
765 @param EndBit The ordinal of the most significant bit in the bit field.
767 @param OrData The value to OR with the read value from the I/O port.
769 @return The value written back to the I/O port.
783 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
788 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
789 result back to the bit field in the 32-bit port.
791 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
792 the read result and the value specified by AndData, and writes the result to
793 the 32-bit I/O port specified by Port. The value written to the I/O port is
794 returned. This function must guarantee that all I/O read and write operations
795 are serialized. Extra left bits in AndData are stripped.
797 If 32-bit I/O port operations are not supported, then ASSERT().
798 If StartBit is greater than 31, then ASSERT().
799 If EndBit is greater than 31, then ASSERT().
800 If EndBit is less than StartBit, then ASSERT().
802 @param Port The I/O port to write.
803 @param StartBit The ordinal of the least significant bit in the bit field.
805 @param EndBit The ordinal of the most significant bit in the bit field.
807 @param AndData The value to AND with the read value from the I/O port.
809 @return The value written back to the I/O port.
823 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
828 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
829 bitwise inclusive OR, and writes the result back to the bit field in the
832 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
833 by a bitwise inclusive OR between the read result and the value specified by
834 AndData, and writes the result to the 32-bit I/O port specified by Port. The
835 value written to the I/O port is returned. This function must guarantee that
836 all I/O read and write operations are serialized. Extra left bits in both
837 AndData and OrData are stripped.
839 If 32-bit I/O port operations are not supported, then ASSERT().
840 If StartBit is greater than 31, then ASSERT().
841 If EndBit is greater than 31, then ASSERT().
842 If EndBit is less than StartBit, then ASSERT().
844 @param Port The I/O port to write.
845 @param StartBit The ordinal of the least significant bit in the bit field.
847 @param EndBit The ordinal of the most significant bit in the bit field.
849 @param AndData The value to AND with the read value from the I/O port.
850 @param OrData The value to OR with the result of the AND operation.
852 @return The value written back to the I/O port.
857 IoBitFieldAndThenOr32 (
867 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
872 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
873 result back to the 64-bit I/O port.
875 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
876 between the read result and the value specified by OrData, and writes the
877 result to the 64-bit I/O port specified by Port. The value written to the I/O
878 port is returned. This function must guarantee that all I/O read and write
879 operations are serialized.
881 If 64-bit I/O port operations are not supported, then ASSERT().
883 @param Port The I/O port to write.
884 @param OrData The value to OR with the read value from the I/O port.
886 @return The value written back to the I/O port.
896 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
900 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
901 to the 64-bit I/O port.
903 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
904 the read result and the value specified by AndData, and writes the result to
905 the 64-bit I/O port specified by Port. The value written to the I/O port is
906 returned. This function must guarantee that all I/O read and write operations
909 If 64-bit I/O port operations are not supported, then ASSERT().
911 @param Port The I/O port to write.
912 @param AndData The value to AND with the read value from the I/O port.
914 @return The value written back to the I/O port.
924 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
928 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
929 inclusive OR, and writes the result back to the 64-bit I/O port.
931 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
932 the read result and the value specified by AndData, performs a bitwise OR
933 between the result of the AND operation and the value specified by OrData,
934 and writes the result to the 64-bit I/O port specified by Port. The value
935 written to the I/O port is returned. This function must guarantee that all
936 I/O read and write operations are serialized.
938 If 64-bit I/O port operations are not supported, then ASSERT().
940 @param Port The I/O port to write.
941 @param AndData The value to AND with the read value from the I/O port.
942 @param OrData The value to OR with the result of the AND operation.
944 @return The value written back to the I/O port.
955 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
959 Reads a bit field of an I/O register.
961 Reads the bit field in a 64-bit I/O register. The bit field is specified by
962 the StartBit and the EndBit. The value of the bit field is returned.
964 If 64-bit I/O port operations are not supported, then ASSERT().
965 If StartBit is greater than 63, then ASSERT().
966 If EndBit is greater than 63, then ASSERT().
967 If EndBit is less than StartBit, then ASSERT().
969 @param Port The I/O port to read.
970 @param StartBit The ordinal of the least significant bit in the bit field.
972 @param EndBit The ordinal of the most significant bit in the bit field.
975 @return The value read.
986 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
990 Writes a bit field to an I/O register.
992 Writes Value to the bit field of the I/O register. The bit field is specified
993 by the StartBit and the EndBit. All other bits in the destination I/O
994 register are preserved. The value written to the I/O port is returned. Extra
995 left bits in Value are stripped.
997 If 64-bit I/O port operations are not supported, then ASSERT().
998 If StartBit is greater than 63, then ASSERT().
999 If EndBit is greater than 63, then ASSERT().
1000 If EndBit is less than StartBit, then ASSERT().
1002 @param Port The I/O port to write.
1003 @param StartBit The ordinal of the least significant bit in the bit field.
1005 @param EndBit The ordinal of the most significant bit in the bit field.
1007 @param Value New value of the bit field.
1009 @return The value written back to the I/O port.
1023 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1028 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1029 result back to the bit field in the 64-bit port.
1031 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1032 between the read result and the value specified by OrData, and writes the
1033 result to the 64-bit I/O port specified by Port. The value written to the I/O
1034 port is returned. This function must guarantee that all I/O read and write
1035 operations are serialized. Extra left bits in OrData are stripped.
1037 If 64-bit I/O port operations are not supported, then ASSERT().
1038 If StartBit is greater than 63, then ASSERT().
1039 If EndBit is greater than 63, then ASSERT().
1040 If EndBit is less than StartBit, then ASSERT().
1042 @param Port The I/O port to write.
1043 @param StartBit The ordinal of the least significant bit in the bit field.
1045 @param EndBit The ordinal of the most significant bit in the bit field.
1047 @param OrData The value to OR with the read value from the I/O port.
1049 @return The value written back to the I/O port.
1063 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1068 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1069 result back to the bit field in the 64-bit port.
1071 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1072 the read result and the value specified by AndData, and writes the result to
1073 the 64-bit I/O port specified by Port. The value written to the I/O port is
1074 returned. This function must guarantee that all I/O read and write operations
1075 are serialized. Extra left bits in AndData are stripped.
1077 If 64-bit I/O port operations are not supported, then ASSERT().
1078 If StartBit is greater than 63, then ASSERT().
1079 If EndBit is greater than 63, then ASSERT().
1080 If EndBit is less than StartBit, then ASSERT().
1082 @param Port The I/O port to write.
1083 @param StartBit The ordinal of the least significant bit in the bit field.
1085 @param EndBit The ordinal of the most significant bit in the bit field.
1087 @param AndData The value to AND with the read value from the I/O port.
1089 @return The value written back to the I/O port.
1103 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1108 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1109 bitwise inclusive OR, and writes the result back to the bit field in the
1112 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1113 by a bitwise inclusive OR between the read result and the value specified by
1114 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1115 value written to the I/O port is returned. This function must guarantee that
1116 all I/O read and write operations are serialized. Extra left bits in both
1117 AndData and OrData are stripped.
1119 If 64-bit I/O port operations are not supported, then ASSERT().
1120 If StartBit is greater than 63, then ASSERT().
1121 If EndBit is greater than 63, then ASSERT().
1122 If EndBit is less than StartBit, then ASSERT().
1124 @param Port The I/O port to write.
1125 @param StartBit The ordinal of the least significant bit in the bit field.
1127 @param EndBit The ordinal of the most significant bit in the bit field.
1129 @param AndData The value to AND with the read value from the I/O port.
1130 @param OrData The value to OR with the result of the AND operation.
1132 @return The value written back to the I/O port.
1137 IoBitFieldAndThenOr64 (
1147 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1152 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1153 result back to the 8-bit MMIO register.
1155 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1156 inclusive OR between the read result and the value specified by OrData, and
1157 writes the result to the 8-bit MMIO register specified by Address. The value
1158 written to the MMIO register is returned. This function must guarantee that
1159 all MMIO read and write operations are serialized.
1161 If 8-bit MMIO register operations are not supported, then ASSERT().
1163 @param Address The MMIO register to write.
1164 @param OrData The value to OR with the read value from the MMIO register.
1166 @return The value written back to the MMIO register.
1176 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1180 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1181 back to the 8-bit MMIO register.
1183 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1184 between the read result and the value specified by AndData, and writes the
1185 result to the 8-bit MMIO register specified by Address. The value written to
1186 the MMIO register is returned. This function must guarantee that all MMIO
1187 read and write operations are serialized.
1189 If 8-bit MMIO register operations are not supported, then ASSERT().
1191 @param Address The MMIO register to write.
1192 @param AndData The value to AND with the read value from the MMIO register.
1194 @return The value written back to the MMIO register.
1204 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1208 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1209 inclusive OR, and writes the result back to the 8-bit MMIO register.
1211 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1212 between the read result and the value specified by AndData, performs a
1213 bitwise OR between the result of the AND operation and the value specified by
1214 OrData, and writes the result to the 8-bit MMIO register specified by
1215 Address. The value written to the MMIO register is returned. This function
1216 must guarantee that all MMIO read and write operations are serialized.
1218 If 8-bit MMIO register operations are not supported, then ASSERT().
1221 @param Address The MMIO register to write.
1222 @param AndData The value to AND with the read value from the MMIO register.
1223 @param OrData The value to OR with the result of the AND operation.
1225 @return The value written back to the MMIO register.
1236 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1240 Reads a bit field of a MMIO register.
1242 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1243 the StartBit and the EndBit. The value of the bit field is returned.
1245 If 8-bit MMIO register operations are not supported, then ASSERT().
1246 If StartBit is greater than 7, then ASSERT().
1247 If EndBit is greater than 7, then ASSERT().
1248 If EndBit is less than StartBit, then ASSERT().
1250 @param Address MMIO register to read.
1251 @param StartBit The ordinal of the least significant bit in the bit field.
1253 @param EndBit The ordinal of the most significant bit in the bit field.
1256 @return The value read.
1267 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1271 Writes a bit field to a MMIO register.
1273 Writes Value to the bit field of the MMIO register. The bit field is
1274 specified by the StartBit and the EndBit. All other bits in the destination
1275 MMIO register are preserved. The new value of the 8-bit register is returned.
1277 If 8-bit MMIO register operations are not supported, then ASSERT().
1278 If StartBit is greater than 7, then ASSERT().
1279 If EndBit is greater than 7, then ASSERT().
1280 If EndBit is less than StartBit, then ASSERT().
1282 @param Address MMIO register to write.
1283 @param StartBit The ordinal of the least significant bit in the bit field.
1285 @param EndBit The ordinal of the most significant bit in the bit field.
1287 @param Value New value of the bit field.
1289 @return The value written back to the MMIO register.
1294 MmioBitFieldWrite8 (
1303 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1308 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1309 writes the result back to the bit field in the 8-bit MMIO register.
1311 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1312 inclusive OR between the read result and the value specified by OrData, and
1313 writes the result to the 8-bit MMIO register specified by Address. The value
1314 written to the MMIO register is returned. This function must guarantee that
1315 all MMIO read and write operations are serialized. Extra left bits in OrData
1318 If 8-bit MMIO register operations are not supported, then ASSERT().
1319 If StartBit is greater than 7, then ASSERT().
1320 If EndBit is greater than 7, then ASSERT().
1321 If EndBit is less than StartBit, then ASSERT().
1323 @param Address MMIO register to write.
1324 @param StartBit The ordinal of the least significant bit in the bit field.
1326 @param EndBit The ordinal of the most significant bit in the bit field.
1328 @param OrData The value to OR with read value from the MMIO register.
1330 @return The value written back to the MMIO register.
1344 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1349 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1350 writes the result back to the bit field in the 8-bit MMIO register.
1352 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1353 between the read result and the value specified by AndData, and writes the
1354 result to the 8-bit MMIO register specified by Address. The value written to
1355 the MMIO register is returned. This function must guarantee that all MMIO
1356 read and write operations are serialized. Extra left bits in AndData are
1359 If 8-bit MMIO register operations are not supported, then ASSERT().
1360 If StartBit is greater than 7, then ASSERT().
1361 If EndBit is greater than 7, then ASSERT().
1362 If EndBit is less than StartBit, then ASSERT().
1364 @param Address MMIO register to write.
1365 @param StartBit The ordinal of the least significant bit in the bit field.
1367 @param EndBit The ordinal of the most significant bit in the bit field.
1369 @param AndData The value to AND with read value from the MMIO register.
1371 @return The value written back to the MMIO register.
1385 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1390 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1391 by a bitwise inclusive OR, and writes the result back to the bit field in the
1392 8-bit MMIO register.
1394 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1395 followed by a bitwise inclusive OR between the read result and the value
1396 specified by AndData, and writes the result to the 8-bit MMIO register
1397 specified by Address. The value written to the MMIO register is returned.
1398 This function must guarantee that all MMIO read and write operations are
1399 serialized. Extra left bits in both AndData and OrData are stripped.
1401 If 8-bit MMIO register operations are not supported, then ASSERT().
1402 If StartBit is greater than 7, then ASSERT().
1403 If EndBit is greater than 7, then ASSERT().
1404 If EndBit is less than StartBit, then ASSERT().
1406 @param Address MMIO register to write.
1407 @param StartBit The ordinal of the least significant bit in the bit field.
1409 @param EndBit The ordinal of the most significant bit in the bit field.
1411 @param AndData The value to AND with read value from the MMIO register.
1412 @param OrData The value to OR with the result of the AND operation.
1414 @return The value written back to the MMIO register.
1419 MmioBitFieldAndThenOr8 (
1429 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1434 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1435 result back to the 16-bit MMIO register.
1437 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1438 inclusive OR between the read result and the value specified by OrData, and
1439 writes the result to the 16-bit MMIO register specified by Address. The value
1440 written to the MMIO register is returned. This function must guarantee that
1441 all MMIO read and write operations are serialized.
1443 If 16-bit MMIO register operations are not supported, then ASSERT().
1445 @param Address The MMIO register to write.
1446 @param OrData The value to OR with the read value from the MMIO register.
1448 @return The value written back to the MMIO register.
1458 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1462 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1463 back to the 16-bit MMIO register.
1465 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1466 between the read result and the value specified by AndData, and writes the
1467 result to the 16-bit MMIO register specified by Address. The value written to
1468 the MMIO register is returned. This function must guarantee that all MMIO
1469 read and write operations are serialized.
1471 If 16-bit MMIO register operations are not supported, then ASSERT().
1473 @param Address The MMIO register to write.
1474 @param AndData The value to AND with the read value from the MMIO register.
1476 @return The value written back to the MMIO register.
1486 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1490 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1491 inclusive OR, and writes the result back to the 16-bit MMIO register.
1493 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1494 between the read result and the value specified by AndData, performs a
1495 bitwise OR between the result of the AND operation and the value specified by
1496 OrData, and writes the result to the 16-bit MMIO register specified by
1497 Address. The value written to the MMIO register is returned. This function
1498 must guarantee that all MMIO read and write operations are serialized.
1500 If 16-bit MMIO register operations are not supported, then ASSERT().
1503 @param Address The MMIO register to write.
1504 @param AndData The value to AND with the read value from the MMIO register.
1505 @param OrData The value to OR with the result of the AND operation.
1507 @return The value written back to the MMIO register.
1518 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1522 Reads a bit field of a MMIO register.
1524 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1525 the StartBit and the EndBit. The value of the bit field is returned.
1527 If 16-bit MMIO register operations are not supported, then ASSERT().
1528 If StartBit is greater than 15, then ASSERT().
1529 If EndBit is greater than 15, then ASSERT().
1530 If EndBit is less than StartBit, then ASSERT().
1532 @param Address MMIO register to read.
1533 @param StartBit The ordinal of the least significant bit in the bit field.
1535 @param EndBit The ordinal of the most significant bit in the bit field.
1538 @return The value read.
1543 MmioBitFieldRead16 (
1549 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1553 Writes a bit field to a MMIO register.
1555 Writes Value to the bit field of the MMIO register. The bit field is
1556 specified by the StartBit and the EndBit. All other bits in the destination
1557 MMIO register are preserved. The new value of the 16-bit register is returned.
1559 If 16-bit MMIO register operations are not supported, then ASSERT().
1560 If StartBit is greater than 15, then ASSERT().
1561 If EndBit is greater than 15, then ASSERT().
1562 If EndBit is less than StartBit, then ASSERT().
1564 @param Address MMIO register to write.
1565 @param StartBit The ordinal of the least significant bit in the bit field.
1567 @param EndBit The ordinal of the most significant bit in the bit field.
1569 @param Value New value of the bit field.
1571 @return The value written back to the MMIO register.
1576 MmioBitFieldWrite16 (
1583 return MmioWrite16 (
1585 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1590 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1591 writes the result back to the bit field in the 16-bit MMIO register.
1593 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1594 inclusive OR between the read result and the value specified by OrData, and
1595 writes the result to the 16-bit MMIO register specified by Address. The value
1596 written to the MMIO register is returned. This function must guarantee that
1597 all MMIO read and write operations are serialized. Extra left bits in OrData
1600 If 16-bit MMIO register operations are not supported, then ASSERT().
1601 If StartBit is greater than 15, then ASSERT().
1602 If EndBit is greater than 15, then ASSERT().
1603 If EndBit is less than StartBit, then ASSERT().
1605 @param Address MMIO register to write.
1606 @param StartBit The ordinal of the least significant bit in the bit field.
1608 @param EndBit The ordinal of the most significant bit in the bit field.
1610 @param OrData The value to OR with read value from the MMIO register.
1612 @return The value written back to the MMIO register.
1624 return MmioWrite16 (
1626 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1631 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1632 writes the result back to the bit field in the 16-bit MMIO register.
1634 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1635 between the read result and the value specified by AndData, and writes the
1636 result to the 16-bit MMIO register specified by Address. The value written to
1637 the MMIO register is returned. This function must guarantee that all MMIO
1638 read and write operations are serialized. Extra left bits in AndData are
1641 If 16-bit MMIO register operations are not supported, then ASSERT().
1642 If StartBit is greater than 15, then ASSERT().
1643 If EndBit is greater than 15, then ASSERT().
1644 If EndBit is less than StartBit, then ASSERT().
1646 @param Address MMIO register to write.
1647 @param StartBit The ordinal of the least significant bit in the bit field.
1649 @param EndBit The ordinal of the most significant bit in the bit field.
1651 @param AndData The value to AND with read value from the MMIO register.
1653 @return The value written back to the MMIO register.
1665 return MmioWrite16 (
1667 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1672 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1673 by a bitwise inclusive OR, and writes the result back to the bit field in the
1674 16-bit MMIO register.
1676 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1677 followed by a bitwise inclusive OR between the read result and the value
1678 specified by AndData, and writes the result to the 16-bit MMIO register
1679 specified by Address. The value written to the MMIO register is returned.
1680 This function must guarantee that all MMIO read and write operations are
1681 serialized. Extra left bits in both AndData and OrData are stripped.
1683 If 16-bit MMIO register operations are not supported, then ASSERT().
1684 If StartBit is greater than 15, then ASSERT().
1685 If EndBit is greater than 15, then ASSERT().
1686 If EndBit is less than StartBit, then ASSERT().
1688 @param Address MMIO register to write.
1689 @param StartBit The ordinal of the least significant bit in the bit field.
1691 @param EndBit The ordinal of the most significant bit in the bit field.
1693 @param AndData The value to AND with read value from the MMIO register.
1694 @param OrData The value to OR with the result of the AND operation.
1696 @return The value written back to the MMIO register.
1701 MmioBitFieldAndThenOr16 (
1709 return MmioWrite16 (
1711 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1716 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1717 result back to the 32-bit MMIO register.
1719 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1720 inclusive OR between the read result and the value specified by OrData, and
1721 writes the result to the 32-bit MMIO register specified by Address. The value
1722 written to the MMIO register is returned. This function must guarantee that
1723 all MMIO read and write operations are serialized.
1725 If 32-bit MMIO register operations are not supported, then ASSERT().
1727 @param Address The MMIO register to write.
1728 @param OrData The value to OR with the read value from the MMIO register.
1730 @return The value written back to the MMIO register.
1740 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1744 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1745 back to the 32-bit MMIO register.
1747 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1748 between the read result and the value specified by AndData, and writes the
1749 result to the 32-bit MMIO register specified by Address. The value written to
1750 the MMIO register is returned. This function must guarantee that all MMIO
1751 read and write operations are serialized.
1753 If 32-bit MMIO register operations are not supported, then ASSERT().
1755 @param Address The MMIO register to write.
1756 @param AndData The value to AND with the read value from the MMIO register.
1758 @return The value written back to the MMIO register.
1768 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1772 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1773 inclusive OR, and writes the result back to the 32-bit MMIO register.
1775 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1776 between the read result and the value specified by AndData, performs a
1777 bitwise OR between the result of the AND operation and the value specified by
1778 OrData, and writes the result to the 32-bit MMIO register specified by
1779 Address. The value written to the MMIO register is returned. This function
1780 must guarantee that all MMIO read and write operations are serialized.
1782 If 32-bit MMIO register operations are not supported, then ASSERT().
1785 @param Address The MMIO register to write.
1786 @param AndData The value to AND with the read value from the MMIO register.
1787 @param OrData The value to OR with the result of the AND operation.
1789 @return The value written back to the MMIO register.
1800 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1804 Reads a bit field of a MMIO register.
1806 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1807 the StartBit and the EndBit. The value of the bit field is returned.
1809 If 32-bit MMIO register operations are not supported, then ASSERT().
1810 If StartBit is greater than 31, then ASSERT().
1811 If EndBit is greater than 31, then ASSERT().
1812 If EndBit is less than StartBit, then ASSERT().
1814 @param Address MMIO register to read.
1815 @param StartBit The ordinal of the least significant bit in the bit field.
1817 @param EndBit The ordinal of the most significant bit in the bit field.
1820 @return The value read.
1825 MmioBitFieldRead32 (
1831 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1835 Writes a bit field to a MMIO register.
1837 Writes Value to the bit field of the MMIO register. The bit field is
1838 specified by the StartBit and the EndBit. All other bits in the destination
1839 MMIO register are preserved. The new value of the 32-bit register is returned.
1841 If 32-bit MMIO register operations are not supported, then ASSERT().
1842 If StartBit is greater than 31, then ASSERT().
1843 If EndBit is greater than 31, then ASSERT().
1844 If EndBit is less than StartBit, then ASSERT().
1846 @param Address MMIO register to write.
1847 @param StartBit The ordinal of the least significant bit in the bit field.
1849 @param EndBit The ordinal of the most significant bit in the bit field.
1851 @param Value New value of the bit field.
1853 @return The value written back to the MMIO register.
1858 MmioBitFieldWrite32 (
1865 return MmioWrite32 (
1867 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1872 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1873 writes the result back to the bit field in the 32-bit MMIO register.
1875 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1876 inclusive OR between the read result and the value specified by OrData, and
1877 writes the result to the 32-bit MMIO register specified by Address. The value
1878 written to the MMIO register is returned. This function must guarantee that
1879 all MMIO read and write operations are serialized. Extra left bits in OrData
1882 If 32-bit MMIO register operations are not supported, then ASSERT().
1883 If StartBit is greater than 31, then ASSERT().
1884 If EndBit is greater than 31, then ASSERT().
1885 If EndBit is less than StartBit, then ASSERT().
1887 @param Address MMIO register to write.
1888 @param StartBit The ordinal of the least significant bit in the bit field.
1890 @param EndBit The ordinal of the most significant bit in the bit field.
1892 @param OrData The value to OR with read value from the MMIO register.
1894 @return The value written back to the MMIO register.
1906 return MmioWrite32 (
1908 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1913 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1914 writes the result back to the bit field in the 32-bit MMIO register.
1916 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1917 between the read result and the value specified by AndData, and writes the
1918 result to the 32-bit MMIO register specified by Address. The value written to
1919 the MMIO register is returned. This function must guarantee that all MMIO
1920 read and write operations are serialized. Extra left bits in AndData are
1923 If 32-bit MMIO register operations are not supported, then ASSERT().
1924 If StartBit is greater than 31, then ASSERT().
1925 If EndBit is greater than 31, then ASSERT().
1926 If EndBit is less than StartBit, then ASSERT().
1928 @param Address MMIO register to write.
1929 @param StartBit The ordinal of the least significant bit in the bit field.
1931 @param EndBit The ordinal of the most significant bit in the bit field.
1933 @param AndData The value to AND with read value from the MMIO register.
1935 @return The value written back to the MMIO register.
1947 return MmioWrite32 (
1949 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1954 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1955 by a bitwise inclusive OR, and writes the result back to the bit field in the
1956 32-bit MMIO register.
1958 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1959 followed by a bitwise inclusive OR between the read result and the value
1960 specified by AndData, and writes the result to the 32-bit MMIO register
1961 specified by Address. The value written to the MMIO register is returned.
1962 This function must guarantee that all MMIO read and write operations are
1963 serialized. Extra left bits in both AndData and OrData are stripped.
1965 If 32-bit MMIO register operations are not supported, then ASSERT().
1966 If StartBit is greater than 31, then ASSERT().
1967 If EndBit is greater than 31, then ASSERT().
1968 If EndBit is less than StartBit, then ASSERT().
1970 @param Address MMIO register to write.
1971 @param StartBit The ordinal of the least significant bit in the bit field.
1973 @param EndBit The ordinal of the most significant bit in the bit field.
1975 @param AndData The value to AND with read value from the MMIO register.
1976 @param OrData The value to OR with the result of the AND operation.
1978 @return The value written back to the MMIO register.
1983 MmioBitFieldAndThenOr32 (
1991 return MmioWrite32 (
1993 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1998 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
1999 result back to the 64-bit MMIO register.
2001 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2002 inclusive OR between the read result and the value specified by OrData, and
2003 writes the result to the 64-bit MMIO register specified by Address. The value
2004 written to the MMIO register is returned. This function must guarantee that
2005 all MMIO read and write operations are serialized.
2007 If 64-bit MMIO register operations are not supported, then ASSERT().
2009 @param Address The MMIO register to write.
2010 @param OrData The value to OR with the read value from the MMIO register.
2012 @return The value written back to the MMIO register.
2022 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2026 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2027 back to the 64-bit MMIO register.
2029 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2030 between the read result and the value specified by AndData, and writes the
2031 result to the 64-bit MMIO register specified by Address. The value written to
2032 the MMIO register is returned. This function must guarantee that all MMIO
2033 read and write operations are serialized.
2035 If 64-bit MMIO register operations are not supported, then ASSERT().
2037 @param Address The MMIO register to write.
2038 @param AndData The value to AND with the read value from the MMIO register.
2040 @return The value written back to the MMIO register.
2050 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2054 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2055 inclusive OR, and writes the result back to the 64-bit MMIO register.
2057 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2058 between the read result and the value specified by AndData, performs a
2059 bitwise OR between the result of the AND operation and the value specified by
2060 OrData, and writes the result to the 64-bit MMIO register specified by
2061 Address. The value written to the MMIO register is returned. This function
2062 must guarantee that all MMIO read and write operations are serialized.
2064 If 64-bit MMIO register operations are not supported, then ASSERT().
2067 @param Address The MMIO register to write.
2068 @param AndData The value to AND with the read value from the MMIO register.
2069 @param OrData The value to OR with the result of the AND operation.
2071 @return The value written back to the MMIO register.
2082 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2086 Reads a bit field of a MMIO register.
2088 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2089 the StartBit and the EndBit. The value of the bit field is returned.
2091 If 64-bit MMIO register operations are not supported, then ASSERT().
2092 If StartBit is greater than 63, then ASSERT().
2093 If EndBit is greater than 63, then ASSERT().
2094 If EndBit is less than StartBit, then ASSERT().
2096 @param Address MMIO register to read.
2097 @param StartBit The ordinal of the least significant bit in the bit field.
2099 @param EndBit The ordinal of the most significant bit in the bit field.
2102 @return The value read.
2107 MmioBitFieldRead64 (
2113 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2117 Writes a bit field to a MMIO register.
2119 Writes Value to the bit field of the MMIO register. The bit field is
2120 specified by the StartBit and the EndBit. All other bits in the destination
2121 MMIO register are preserved. The new value of the 64-bit register is returned.
2123 If 64-bit MMIO register operations are not supported, then ASSERT().
2124 If StartBit is greater than 63, then ASSERT().
2125 If EndBit is greater than 63, then ASSERT().
2126 If EndBit is less than StartBit, then ASSERT().
2128 @param Address MMIO register to write.
2129 @param StartBit The ordinal of the least significant bit in the bit field.
2131 @param EndBit The ordinal of the most significant bit in the bit field.
2133 @param Value New value of the bit field.
2135 @return The value written back to the MMIO register.
2140 MmioBitFieldWrite64 (
2147 return MmioWrite64 (
2149 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2154 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2155 writes the result back to the bit field in the 64-bit MMIO register.
2157 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2158 inclusive OR between the read result and the value specified by OrData, and
2159 writes the result to the 64-bit MMIO register specified by Address. The value
2160 written to the MMIO register is returned. This function must guarantee that
2161 all MMIO read and write operations are serialized. Extra left bits in OrData
2164 If 64-bit MMIO register operations are not supported, then ASSERT().
2165 If StartBit is greater than 63, then ASSERT().
2166 If EndBit is greater than 63, then ASSERT().
2167 If EndBit is less than StartBit, then ASSERT().
2169 @param Address MMIO register to write.
2170 @param StartBit The ordinal of the least significant bit in the bit field.
2172 @param EndBit The ordinal of the most significant bit in the bit field.
2174 @param OrData The value to OR with read value from the MMIO register.
2176 @return The value written back to the MMIO register.
2188 return MmioWrite64 (
2190 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2195 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2196 writes the result back to the bit field in the 64-bit MMIO register.
2198 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2199 between the read result and the value specified by AndData, and writes the
2200 result to the 64-bit MMIO register specified by Address. The value written to
2201 the MMIO register is returned. This function must guarantee that all MMIO
2202 read and write operations are serialized. Extra left bits in AndData are
2205 If 64-bit MMIO register operations are not supported, then ASSERT().
2206 If StartBit is greater than 63, then ASSERT().
2207 If EndBit is greater than 63, then ASSERT().
2208 If EndBit is less than StartBit, then ASSERT().
2210 @param Address MMIO register to write.
2211 @param StartBit The ordinal of the least significant bit in the bit field.
2213 @param EndBit The ordinal of the most significant bit in the bit field.
2215 @param AndData The value to AND with read value from the MMIO register.
2217 @return The value written back to the MMIO register.
2229 return MmioWrite64 (
2231 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2236 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2237 by a bitwise inclusive OR, and writes the result back to the bit field in the
2238 64-bit MMIO register.
2240 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2241 followed by a bitwise inclusive OR between the read result and the value
2242 specified by AndData, and writes the result to the 64-bit MMIO register
2243 specified by Address. The value written to the MMIO register is returned.
2244 This function must guarantee that all MMIO read and write operations are
2245 serialized. Extra left bits in both AndData and OrData are stripped.
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.
2258 @param OrData The value to OR with the result of the AND operation.
2260 @return The value written back to the MMIO register.
2265 MmioBitFieldAndThenOr64 (
2273 return MmioWrite64 (
2275 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)