]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
344a9faf8bff75aa894584796b2a6d0f1c62e243
2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2006 - 2008, 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 The following IoLib instances contain the same copy of this file:
24 #include "BaseIoLibIntrinsicInternal.h"
27 Reads an 8-bit I/O port, performs a bitwise 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 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
, (UINT8
) (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
, (UINT8
) (IoRead8 (Port
) & AndData
));
83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
84 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
, (UINT8
) ((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 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 from I/O port specified by StartBit and
142 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
146 Writes a bit field to an I/O register.
148 Writes Value to the bit field of the I/O register. The bit field is specified
149 by the StartBit and the EndBit. All other bits in the destination I/O
150 register are preserved. The value written to the I/O port is returned.
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 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 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 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 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 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 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 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 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 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
, (UINT16
) (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
, (UINT16
) (IoRead16 (Port
) & AndData
));
363 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
364 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
, (UINT16
) ((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 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 from I/O port specified by StartBit and
422 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
426 Writes a bit field to an I/O register.
428 Writes Value to the bit field of the I/O register. The bit field is specified
429 by the StartBit and the EndBit. All other bits in the destination I/O
430 register are preserved. The value written to the I/O port is returned. Extra
431 left bits in Value are stripped.
433 If 16-bit I/O port operations are not supported, then ASSERT().
434 If StartBit is greater than 15, then ASSERT().
435 If EndBit is greater than 15, then ASSERT().
436 If EndBit is less than StartBit, then ASSERT().
438 @param Port The I/O port to write.
439 @param StartBit The ordinal of the least significant bit in the bit field.
441 @param EndBit The ordinal of the most significant bit in the bit field.
443 @param Value New value of the bit field.
445 @return The value written back to the I/O port.
459 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
464 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
465 result back to the bit field in the 16-bit port.
467 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
468 between the read result and the value specified by OrData, and writes the
469 result to the 16-bit I/O port specified by Port. The value written to the I/O
470 port is returned. This function must guarantee that all I/O read and write
471 operations are serialized. Extra left bits in OrData are stripped.
473 If 16-bit I/O port operations are not supported, then ASSERT().
474 If StartBit is greater than 15, then ASSERT().
475 If EndBit is greater than 15, then ASSERT().
476 If EndBit is less than StartBit, then ASSERT().
478 @param Port The I/O port to write.
479 @param StartBit The ordinal of the least significant bit in the bit field.
481 @param EndBit The ordinal of the most significant bit in the bit field.
483 @param OrData The value to OR with the read value from the I/O port.
485 @return The value written back to the I/O port.
499 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
504 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
505 result back to the bit field in the 16-bit port.
507 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
508 the read result and the value specified by AndData, and writes the result to
509 the 16-bit I/O port specified by Port. The value written to the I/O port is
510 returned. This function must guarantee that all I/O read and write operations
511 are serialized. Extra left bits in AndData are stripped.
513 If 16-bit I/O port operations are not supported, then ASSERT().
514 If StartBit is greater than 15, then ASSERT().
515 If EndBit is greater than 15, then ASSERT().
516 If EndBit is less than StartBit, then ASSERT().
518 @param Port The I/O port to write.
519 @param StartBit The ordinal of the least significant bit in the bit field.
521 @param EndBit The ordinal of the most significant bit in the bit field.
523 @param AndData The value to AND with the read value from the I/O port.
525 @return The value written back to the I/O port.
539 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
544 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
545 bitwise OR, and writes the result back to the bit field in the
548 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
549 by a bitwise OR between the read result and the value specified by
550 AndData, and writes the result to the 16-bit I/O port specified by Port. The
551 value written to the I/O port is returned. This function must guarantee that
552 all I/O read and write operations are serialized. Extra left bits in both
553 AndData and OrData are stripped.
555 If 16-bit I/O port operations are not supported, then ASSERT().
556 If StartBit is greater than 15, then ASSERT().
557 If EndBit is greater than 15, then ASSERT().
558 If EndBit is less than StartBit, then ASSERT().
560 @param Port The I/O port to write.
561 @param StartBit The ordinal of the least significant bit in the bit field.
563 @param EndBit The ordinal of the most significant bit in the bit field.
565 @param AndData The value to AND with the read value from the I/O port.
566 @param OrData The value to OR with the result of the AND operation.
568 @return The value written back to the I/O port.
573 IoBitFieldAndThenOr16 (
583 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
588 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
589 result back to the 32-bit I/O port.
591 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
592 between the read result and the value specified by OrData, and writes the
593 result to the 32-bit I/O port specified by Port. The value written to the I/O
594 port is returned. This function must guarantee that all I/O read and write
595 operations are serialized.
597 If 32-bit I/O port operations are not supported, then ASSERT().
599 @param Port The I/O port to write.
600 @param OrData The value to OR with the read value from the I/O port.
602 @return The value written back to the I/O port.
612 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
616 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
617 to the 32-bit I/O port.
619 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
620 the read result and the value specified by AndData, and writes the result to
621 the 32-bit I/O port specified by Port. The value written to the I/O port is
622 returned. This function must guarantee that all I/O read and write operations
625 If 32-bit I/O port operations are not supported, then ASSERT().
627 @param Port The I/O port to write.
628 @param AndData The value to AND with the read value from the I/O port.
630 @return The value written back to the I/O port.
640 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
644 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
645 OR, and writes the result back to the 32-bit I/O port.
647 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
648 the read result and the value specified by AndData, performs a bitwise OR
649 between the result of the AND operation and the value specified by OrData,
650 and writes the result to the 32-bit I/O port specified by Port. The value
651 written to the I/O port is returned. This function must guarantee that all
652 I/O read and write operations are serialized.
654 If 32-bit I/O port operations are not supported, then ASSERT().
656 @param Port The I/O port to write.
657 @param AndData The value to AND with the read value from the I/O port.
658 @param OrData The value to OR with the result of the AND operation.
660 @return The value written back to the I/O port.
671 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
675 Reads a bit field of an I/O register.
677 Reads the bit field in a 32-bit I/O register. The bit field is specified by
678 the StartBit and the EndBit. The value of the bit field is returned.
680 If 32-bit I/O port operations are not supported, then ASSERT().
681 If StartBit is greater than 31, then ASSERT().
682 If EndBit is greater than 31, then ASSERT().
683 If EndBit is less than StartBit, then ASSERT().
685 @param Port The I/O port to read.
686 @param StartBit The ordinal of the least significant bit in the bit field.
688 @param EndBit The ordinal of the most significant bit in the bit field.
691 @return The value read from I/O port specified by StartBit and
703 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
707 Writes a bit field to an I/O register.
709 Writes Value to the bit field of the I/O register. The bit field is specified
710 by the StartBit and the EndBit. All other bits in the destination I/O
711 register are preserved. The value written to the I/O port is returned. Extra
712 left bits in Value are stripped.
714 If 32-bit I/O port operations are not supported, then ASSERT().
715 If StartBit is greater than 31, then ASSERT().
716 If EndBit is greater than 31, then ASSERT().
717 If EndBit is less than StartBit, then ASSERT().
719 @param Port The I/O port to write.
720 @param StartBit The ordinal of the least significant bit in the bit field.
722 @param EndBit The ordinal of the most significant bit in the bit field.
724 @param Value New value of the bit field.
726 @return The value written back to the I/O port.
740 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
745 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
746 result back to the bit field in the 32-bit port.
748 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
749 between the read result and the value specified by OrData, and writes the
750 result to the 32-bit I/O port specified by Port. The value written to the I/O
751 port is returned. This function must guarantee that all I/O read and write
752 operations are serialized. Extra left bits in OrData are stripped.
754 If 32-bit I/O port operations are not supported, then ASSERT().
755 If StartBit is greater than 31, then ASSERT().
756 If EndBit is greater than 31, then ASSERT().
757 If EndBit is less than StartBit, then ASSERT().
759 @param Port The I/O port to write.
760 @param StartBit The ordinal of the least significant bit in the bit field.
762 @param EndBit The ordinal of the most significant bit in the bit field.
764 @param OrData The value to OR with the read value from the I/O port.
766 @return The value written back to the I/O port.
780 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
785 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
786 result back to the bit field in the 32-bit port.
788 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
789 the read result and the value specified by AndData, and writes the result to
790 the 32-bit I/O port specified by Port. The value written to the I/O port is
791 returned. This function must guarantee that all I/O read and write operations
792 are serialized. Extra left bits in AndData are stripped.
794 If 32-bit I/O port operations are not supported, then ASSERT().
795 If StartBit is greater than 31, then ASSERT().
796 If EndBit is greater than 31, then ASSERT().
797 If EndBit is less than StartBit, then ASSERT().
799 @param Port The I/O port to write.
800 @param StartBit The ordinal of the least significant bit in the bit field.
802 @param EndBit The ordinal of the most significant bit in the bit field.
804 @param AndData The value to AND with the read value from the I/O port.
806 @return The value written back to the I/O port.
820 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
825 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
826 bitwise OR, and writes the result back to the bit field in the
829 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
830 by a bitwise OR between the read result and the value specified by
831 AndData, and writes the result to the 32-bit I/O port specified by Port. The
832 value written to the I/O port is returned. This function must guarantee that
833 all I/O read and write operations are serialized. Extra left bits in both
834 AndData and OrData are stripped.
836 If 32-bit I/O port operations are not supported, then ASSERT().
837 If StartBit is greater than 31, then ASSERT().
838 If EndBit is greater than 31, then ASSERT().
839 If EndBit is less than StartBit, then ASSERT().
841 @param Port The I/O port to write.
842 @param StartBit The ordinal of the least significant bit in the bit field.
844 @param EndBit The ordinal of the most significant bit in the bit field.
846 @param AndData The value to AND with the read value from the I/O port.
847 @param OrData The value to OR with the result of the AND operation.
849 @return The value written back to the I/O port.
854 IoBitFieldAndThenOr32 (
864 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
869 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
870 result back to the 64-bit I/O port.
872 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
873 between the read result and the value specified by OrData, and writes the
874 result to the 64-bit I/O port specified by Port. The value written to the I/O
875 port is returned. This function must guarantee that all I/O read and write
876 operations are serialized.
878 If 64-bit I/O port operations are not supported, then ASSERT().
880 @param Port The I/O port to write.
881 @param OrData The value to OR with the read value from the I/O port.
883 @return The value written back to the I/O port.
893 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
897 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
898 to the 64-bit I/O port.
900 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
901 the read result and the value specified by AndData, and writes the result to
902 the 64-bit I/O port specified by Port. The value written to the I/O port is
903 returned. This function must guarantee that all I/O read and write operations
906 If 64-bit I/O port operations are not supported, then ASSERT().
908 @param Port The I/O port to write.
909 @param AndData The value to AND with the read value from the I/O port.
911 @return The value written back to the I/O port.
921 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
925 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
926 OR, and writes the result back to the 64-bit I/O port.
928 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
929 the read result and the value specified by AndData, performs a bitwise OR
930 between the result of the AND operation and the value specified by OrData,
931 and writes the result to the 64-bit I/O port specified by Port. The value
932 written to the I/O port is returned. This function must guarantee that all
933 I/O read and write operations are serialized.
935 If 64-bit I/O port operations are not supported, then ASSERT().
937 @param Port The I/O port to write.
938 @param AndData The value to AND with the read value from the I/O port.
939 @param OrData The value to OR with the result of the AND operation.
941 @return The value written back to the I/O port.
952 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
956 Reads a bit field of an I/O register.
958 Reads the bit field in a 64-bit I/O register. The bit field is specified by
959 the StartBit and the EndBit. The value of the bit field is returned.
961 If 64-bit I/O port operations are not supported, then ASSERT().
962 If StartBit is greater than 63, then ASSERT().
963 If EndBit is greater than 63, then ASSERT().
964 If EndBit is less than StartBit, then ASSERT().
966 @param Port The I/O port to read.
967 @param StartBit The ordinal of the least significant bit in the bit field.
969 @param EndBit The ordinal of the most significant bit in the bit field.
972 @return The value read from I/O port specified by StartBit and
984 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
988 Writes a bit field to an I/O register.
990 Writes Value to the bit field of the I/O register. The bit field is specified
991 by the StartBit and the EndBit. All other bits in the destination I/O
992 register are preserved. The value written to the I/O port is returned. Extra
993 left bits in Value are stripped.
995 If 64-bit I/O port operations are not supported, then ASSERT().
996 If StartBit is greater than 63, then ASSERT().
997 If EndBit is greater than 63, then ASSERT().
998 If EndBit is less than StartBit, then ASSERT().
1000 @param Port The I/O port to write.
1001 @param StartBit The ordinal of the least significant bit in the bit field.
1003 @param EndBit The ordinal of the most significant bit in the bit field.
1005 @param Value New value of the bit field.
1007 @return The value written back to the I/O port.
1021 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1026 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1027 result back to the bit field in the 64-bit port.
1029 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1030 between the read result and the value specified by OrData, and writes the
1031 result to the 64-bit I/O port specified by Port. The value written to the I/O
1032 port is returned. This function must guarantee that all I/O read and write
1033 operations are serialized. Extra left bits in OrData are stripped.
1035 If 64-bit I/O port operations are not supported, then ASSERT().
1036 If StartBit is greater than 63, then ASSERT().
1037 If EndBit is greater than 63, then ASSERT().
1038 If EndBit is less than StartBit, then ASSERT().
1040 @param Port The I/O port to write.
1041 @param StartBit The ordinal of the least significant bit in the bit field.
1043 @param EndBit The ordinal of the most significant bit in the bit field.
1045 @param OrData The value to OR with the read value from the I/O port.
1047 @return The value written back to the I/O port.
1061 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1066 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1067 result back to the bit field in the 64-bit port.
1069 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1070 the read result and the value specified by AndData, and writes the result to
1071 the 64-bit I/O port specified by Port. The value written to the I/O port is
1072 returned. This function must guarantee that all I/O read and write operations
1073 are serialized. Extra left bits in AndData are stripped.
1075 If 64-bit I/O port operations are not supported, then ASSERT().
1076 If StartBit is greater than 63, then ASSERT().
1077 If EndBit is greater than 63, then ASSERT().
1078 If EndBit is less than StartBit, then ASSERT().
1080 @param Port The I/O port to write.
1081 @param StartBit The ordinal of the least significant bit in the bit field.
1083 @param EndBit The ordinal of the most significant bit in the bit field.
1085 @param AndData The value to AND with the read value from the I/O port.
1087 @return The value written back to the I/O port.
1101 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1106 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1107 bitwise OR, and writes the result back to the bit field in the
1110 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1111 by a bitwise OR between the read result and the value specified by
1112 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1113 value written to the I/O port is returned. This function must guarantee that
1114 all I/O read and write operations are serialized. Extra left bits in both
1115 AndData and OrData are stripped.
1117 If 64-bit I/O port operations are not supported, then ASSERT().
1118 If StartBit is greater than 63, then ASSERT().
1119 If EndBit is greater than 63, then ASSERT().
1120 If EndBit is less than StartBit, then ASSERT().
1122 @param Port The I/O port to write.
1123 @param StartBit The ordinal of the least significant bit in the bit field.
1125 @param EndBit The ordinal of the most significant bit in the bit field.
1127 @param AndData The value to AND with the read value from the I/O port.
1128 @param OrData The value to OR with the result of the AND operation.
1130 @return The value written back to the I/O port.
1135 IoBitFieldAndThenOr64 (
1145 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1150 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1151 result back to the 8-bit MMIO register.
1153 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1154 OR between the read result and the value specified by OrData, and
1155 writes the result to the 8-bit MMIO register specified by Address. The value
1156 written to the MMIO register is returned. This function must guarantee that
1157 all MMIO read and write operations are serialized.
1159 If 8-bit MMIO register operations are not supported, then ASSERT().
1161 @param Address The MMIO register to write.
1162 @param OrData The value to OR with the read value from the MMIO register.
1164 @return The value written back to the MMIO register.
1174 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1178 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1179 back to the 8-bit MMIO register.
1181 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1182 between the read result and the value specified by AndData, and writes the
1183 result to the 8-bit MMIO register specified by Address. The value written to
1184 the MMIO register is returned. This function must guarantee that all MMIO
1185 read and write operations are serialized.
1187 If 8-bit MMIO register operations are not supported, then ASSERT().
1189 @param Address The MMIO register to write.
1190 @param AndData The value to AND with the read value from the MMIO register.
1192 @return The value written back to the MMIO register.
1202 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1206 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1207 OR, and writes the result back to the 8-bit MMIO register.
1209 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1210 between the read result and the value specified by AndData, performs a
1211 bitwise OR between the result of the AND operation and the value specified by
1212 OrData, and writes the result to the 8-bit MMIO register specified by
1213 Address. The value written to the MMIO register is returned. This function
1214 must guarantee that all MMIO read and write operations are serialized.
1216 If 8-bit MMIO register operations are not supported, then ASSERT().
1219 @param Address The MMIO register to write.
1220 @param AndData The value to AND with the read value from the MMIO register.
1221 @param OrData The value to OR with the result of the AND operation.
1223 @return The value written back to the MMIO register.
1234 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1238 Reads a bit field of a MMIO register.
1240 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1241 the StartBit and the EndBit. The value of the bit field is returned.
1243 If 8-bit MMIO register operations are not supported, then ASSERT().
1244 If StartBit is greater than 7, then ASSERT().
1245 If EndBit is greater than 7, then ASSERT().
1246 If EndBit is less than StartBit, then ASSERT().
1248 @param Address MMIO register to read.
1249 @param StartBit The ordinal of the least significant bit in the bit field.
1251 @param EndBit The ordinal of the most significant bit in the bit field.
1254 @return The value read from I/O port specified by StartBit and
1266 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1270 Writes a bit field to a MMIO register.
1272 Writes Value to the bit field of the MMIO register. The bit field is
1273 specified by the StartBit and the EndBit. All other bits in the destination
1274 MMIO register are preserved. The new value of the 8-bit register is returned.
1276 If 8-bit MMIO register operations are not supported, then ASSERT().
1277 If StartBit is greater than 7, then ASSERT().
1278 If EndBit is greater than 7, then ASSERT().
1279 If EndBit is less than StartBit, then ASSERT().
1281 @param Address MMIO register to write.
1282 @param StartBit The ordinal of the least significant bit in the bit field.
1284 @param EndBit The ordinal of the most significant bit in the bit field.
1286 @param Value New value of the bit field.
1288 @return The value written back to the MMIO register.
1293 MmioBitFieldWrite8 (
1302 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1307 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1308 writes the result back to the bit field in the 8-bit MMIO register.
1310 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1311 OR between the read result and the value specified by OrData, and
1312 writes the result to the 8-bit MMIO register specified by Address. The value
1313 written to the MMIO register is returned. This function must guarantee that
1314 all MMIO read and write operations are serialized. Extra left bits in OrData
1317 If 8-bit MMIO register operations are not supported, then ASSERT().
1318 If StartBit is greater than 7, then ASSERT().
1319 If EndBit is greater than 7, then ASSERT().
1320 If EndBit is less than StartBit, then ASSERT().
1322 @param Address MMIO register to write.
1323 @param StartBit The ordinal of the least significant bit in the bit field.
1325 @param EndBit The ordinal of the most significant bit in the bit field.
1327 @param OrData The value to OR with read value from the MMIO register.
1329 @return The value written back to the MMIO register.
1343 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1348 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1349 writes the result back to the bit field in the 8-bit MMIO register.
1351 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1352 between the read result and the value specified by AndData, and writes the
1353 result to the 8-bit MMIO register specified by Address. The value written to
1354 the MMIO register is returned. This function must guarantee that all MMIO
1355 read and write operations are serialized. Extra left bits in AndData are
1358 If 8-bit MMIO register operations are not supported, then ASSERT().
1359 If StartBit is greater than 7, then ASSERT().
1360 If EndBit is greater than 7, then ASSERT().
1361 If EndBit is less than StartBit, then ASSERT().
1363 @param Address MMIO register to write.
1364 @param StartBit The ordinal of the least significant bit in the bit field.
1366 @param EndBit The ordinal of the most significant bit in the bit field.
1368 @param AndData The value to AND with read value from the MMIO register.
1370 @return The value written back to the MMIO register.
1384 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1389 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1390 by a bitwise OR, and writes the result back to the bit field in the
1391 8-bit MMIO register.
1393 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1394 followed by a bitwise OR between the read result and the value
1395 specified by AndData, and writes the result to the 8-bit MMIO register
1396 specified by Address. The value written to the MMIO register is returned.
1397 This function must guarantee that all MMIO read and write operations are
1398 serialized. Extra left bits in both AndData and OrData are stripped.
1400 If 8-bit MMIO register operations are not supported, then ASSERT().
1401 If StartBit is greater than 7, then ASSERT().
1402 If EndBit is greater than 7, then ASSERT().
1403 If EndBit is less than StartBit, then ASSERT().
1405 @param Address MMIO register to write.
1406 @param StartBit The ordinal of the least significant bit in the bit field.
1408 @param EndBit The ordinal of the most significant bit in the bit field.
1410 @param AndData The value to AND with read value from the MMIO register.
1411 @param OrData The value to OR with the result of the AND operation.
1413 @return The value written back to the MMIO register.
1418 MmioBitFieldAndThenOr8 (
1428 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1433 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1434 result back to the 16-bit MMIO register.
1436 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1437 OR between the read result and the value specified by OrData, and
1438 writes the result to the 16-bit MMIO register specified by Address. The value
1439 written to the MMIO register is returned. This function must guarantee that
1440 all MMIO read and write operations are serialized.
1442 If 16-bit MMIO register operations are not supported, then ASSERT().
1444 @param Address The MMIO register to write.
1445 @param OrData The value to OR with the read value from the MMIO register.
1447 @return The value written back to the MMIO register.
1457 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1461 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1462 back to the 16-bit MMIO register.
1464 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1465 between the read result and the value specified by AndData, and writes the
1466 result to the 16-bit MMIO register specified by Address. The value written to
1467 the MMIO register is returned. This function must guarantee that all MMIO
1468 read and write operations are serialized.
1470 If 16-bit MMIO register operations are not supported, then ASSERT().
1472 @param Address The MMIO register to write.
1473 @param AndData The value to AND with the read value from the MMIO register.
1475 @return The value written back to the MMIO register.
1485 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1489 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1490 OR, and writes the result back to the 16-bit MMIO register.
1492 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1493 between the read result and the value specified by AndData, performs a
1494 bitwise OR between the result of the AND operation and the value specified by
1495 OrData, and writes the result to the 16-bit MMIO register specified by
1496 Address. The value written to the MMIO register is returned. This function
1497 must guarantee that all MMIO read and write operations are serialized.
1499 If 16-bit MMIO register operations are not supported, then ASSERT().
1502 @param Address The MMIO register to write.
1503 @param AndData The value to AND with the read value from the MMIO register.
1504 @param OrData The value to OR with the result of the AND operation.
1506 @return The value written back to the MMIO register.
1517 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1521 Reads a bit field of a MMIO register.
1523 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1524 the StartBit and the EndBit. The value of the bit field is returned.
1526 If 16-bit MMIO register operations are not supported, then ASSERT().
1527 If StartBit is greater than 15, then ASSERT().
1528 If EndBit is greater than 15, then ASSERT().
1529 If EndBit is less than StartBit, then ASSERT().
1531 @param Address MMIO register to read.
1532 @param StartBit The ordinal of the least significant bit in the bit field.
1534 @param EndBit The ordinal of the most significant bit in the bit field.
1537 @return The value read from I/O port specified by StartBit and
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 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 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 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 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 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 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 from I/O port specified by StartBit and
1826 MmioBitFieldRead32 (
1832 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1836 Writes a bit field to a MMIO register.
1838 Writes Value to the bit field of the MMIO register. The bit field is
1839 specified by the StartBit and the EndBit. All other bits in the destination
1840 MMIO register are preserved. The new value of the 32-bit register is returned.
1842 If 32-bit MMIO register operations are not supported, then ASSERT().
1843 If StartBit is greater than 31, then ASSERT().
1844 If EndBit is greater than 31, then ASSERT().
1845 If EndBit is less than StartBit, then ASSERT().
1847 @param Address MMIO register to write.
1848 @param StartBit The ordinal of the least significant bit in the bit field.
1850 @param EndBit The ordinal of the most significant bit in the bit field.
1852 @param Value New value of the bit field.
1854 @return The value written back to the MMIO register.
1859 MmioBitFieldWrite32 (
1866 return MmioWrite32 (
1868 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1873 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1874 writes the result back to the bit field in the 32-bit MMIO register.
1876 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1877 OR between the read result and the value specified by OrData, and
1878 writes the result to the 32-bit MMIO register specified by Address. The value
1879 written to the MMIO register is returned. This function must guarantee that
1880 all MMIO read and write operations are serialized. Extra left bits in OrData
1883 If 32-bit MMIO register operations are not supported, then ASSERT().
1884 If StartBit is greater than 31, then ASSERT().
1885 If EndBit is greater than 31, then ASSERT().
1886 If EndBit is less than StartBit, then ASSERT().
1888 @param Address MMIO register to write.
1889 @param StartBit The ordinal of the least significant bit in the bit field.
1891 @param EndBit The ordinal of the most significant bit in the bit field.
1893 @param OrData The value to OR with read value from the MMIO register.
1895 @return The value written back to the MMIO register.
1907 return MmioWrite32 (
1909 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1914 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1915 writes the result back to the bit field in the 32-bit MMIO register.
1917 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1918 between the read result and the value specified by AndData, and writes the
1919 result to the 32-bit MMIO register specified by Address. The value written to
1920 the MMIO register is returned. This function must guarantee that all MMIO
1921 read and write operations are serialized. Extra left bits in AndData are
1924 If 32-bit MMIO register operations are not supported, then ASSERT().
1925 If StartBit is greater than 31, then ASSERT().
1926 If EndBit is greater than 31, then ASSERT().
1927 If EndBit is less than StartBit, then ASSERT().
1929 @param Address MMIO register to write.
1930 @param StartBit The ordinal of the least significant bit in the bit field.
1932 @param EndBit The ordinal of the most significant bit in the bit field.
1934 @param AndData The value to AND with read value from the MMIO register.
1936 @return The value written back to the MMIO register.
1948 return MmioWrite32 (
1950 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1955 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1956 by a bitwise OR, and writes the result back to the bit field in the
1957 32-bit MMIO register.
1959 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1960 followed by a bitwise OR between the read result and the value
1961 specified by AndData, and writes the result to the 32-bit MMIO register
1962 specified by Address. The value written to the MMIO register is returned.
1963 This function must guarantee that all MMIO read and write operations are
1964 serialized. Extra left bits in both AndData and OrData are stripped.
1966 If 32-bit MMIO register operations are not supported, then ASSERT().
1967 If StartBit is greater than 31, then ASSERT().
1968 If EndBit is greater than 31, then ASSERT().
1969 If EndBit is less than StartBit, then ASSERT().
1971 @param Address MMIO register to write.
1972 @param StartBit The ordinal of the least significant bit in the bit field.
1974 @param EndBit The ordinal of the most significant bit in the bit field.
1976 @param AndData The value to AND with read value from the MMIO register.
1977 @param OrData The value to OR with the result of the AND operation.
1979 @return The value written back to the MMIO register.
1984 MmioBitFieldAndThenOr32 (
1992 return MmioWrite32 (
1994 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1999 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2000 result back to the 64-bit MMIO register.
2002 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2003 OR between the read result and the value specified by OrData, and
2004 writes the result to the 64-bit MMIO register specified by Address. The value
2005 written to the MMIO register is returned. This function must guarantee that
2006 all MMIO read and write operations are serialized.
2008 If 64-bit MMIO register operations are not supported, then ASSERT().
2010 @param Address The MMIO register to write.
2011 @param OrData The value to OR with the read value from the MMIO register.
2013 @return The value written back to the MMIO register.
2023 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2027 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2028 back to the 64-bit MMIO register.
2030 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2031 between the read result and the value specified by AndData, and writes the
2032 result to the 64-bit MMIO register specified by Address. The value written to
2033 the MMIO register is returned. This function must guarantee that all MMIO
2034 read and write operations are serialized.
2036 If 64-bit MMIO register operations are not supported, then ASSERT().
2038 @param Address The MMIO register to write.
2039 @param AndData The value to AND with the read value from the MMIO register.
2041 @return The value written back to the MMIO register.
2051 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2055 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2056 OR, and writes the result back to the 64-bit MMIO register.
2058 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2059 between the read result and the value specified by AndData, performs a
2060 bitwise OR between the result of the AND operation and the value specified by
2061 OrData, and writes the result to the 64-bit MMIO register specified by
2062 Address. The value written to the MMIO register is returned. This function
2063 must guarantee that all MMIO read and write operations are serialized.
2065 If 64-bit MMIO register operations are not supported, then ASSERT().
2068 @param Address The MMIO register to write.
2069 @param AndData The value to AND with the read value from the MMIO register.
2070 @param OrData The value to OR with the result of the AND operation.
2072 @return The value written back to the MMIO register.
2083 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2087 Reads a bit field of a MMIO register.
2089 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2090 the StartBit and the EndBit. The value of the bit field is returned.
2092 If 64-bit MMIO register operations are not supported, then ASSERT().
2093 If StartBit is greater than 63, then ASSERT().
2094 If EndBit is greater than 63, then ASSERT().
2095 If EndBit is less than StartBit, then ASSERT().
2097 @param Address MMIO register to read.
2098 @param StartBit The ordinal of the least significant bit in the bit field.
2100 @param EndBit The ordinal of the most significant bit in the bit field.
2103 @return The value read from I/O port specified by StartBit and
2109 MmioBitFieldRead64 (
2115 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2119 Writes a bit field to a MMIO register.
2121 Writes Value to the bit field of the MMIO register. The bit field is
2122 specified by the StartBit and the EndBit. All other bits in the destination
2123 MMIO register are preserved. The new value of the 64-bit register is returned.
2125 If 64-bit MMIO register operations are not supported, then ASSERT().
2126 If StartBit is greater than 63, then ASSERT().
2127 If EndBit is greater than 63, then ASSERT().
2128 If EndBit is less than StartBit, then ASSERT().
2130 @param Address MMIO register to write.
2131 @param StartBit The ordinal of the least significant bit in the bit field.
2133 @param EndBit The ordinal of the most significant bit in the bit field.
2135 @param Value New value of the bit field.
2137 @return The value written back to the MMIO register.
2142 MmioBitFieldWrite64 (
2149 return MmioWrite64 (
2151 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2156 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2157 writes the result back to the bit field in the 64-bit MMIO register.
2159 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2160 OR between the read result and the value specified by OrData, and
2161 writes the result to the 64-bit MMIO register specified by Address. The value
2162 written to the MMIO register is returned. This function must guarantee that
2163 all MMIO read and write operations are serialized. Extra left bits in OrData
2166 If 64-bit MMIO register operations are not supported, then ASSERT().
2167 If StartBit is greater than 63, then ASSERT().
2168 If EndBit is greater than 63, then ASSERT().
2169 If EndBit is less than StartBit, then ASSERT().
2171 @param Address MMIO register to write.
2172 @param StartBit The ordinal of the least significant bit in the bit field.
2174 @param EndBit The ordinal of the most significant bit in the bit field.
2176 @param OrData The value to OR with read value from the MMIO register.
2178 @return The value written back to the MMIO register.
2190 return MmioWrite64 (
2192 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2197 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2198 writes the result back to the bit field in the 64-bit MMIO register.
2200 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2201 between the read result and the value specified by AndData, and writes the
2202 result to the 64-bit MMIO register specified by Address. The value written to
2203 the MMIO register is returned. This function must guarantee that all MMIO
2204 read and write operations are serialized. Extra left bits in AndData are
2207 If 64-bit MMIO register operations are not supported, then ASSERT().
2208 If StartBit is greater than 63, then ASSERT().
2209 If EndBit is greater than 63, then ASSERT().
2210 If EndBit is less than StartBit, then ASSERT().
2212 @param Address MMIO register to write.
2213 @param StartBit The ordinal of the least significant bit in the bit field.
2215 @param EndBit The ordinal of the most significant bit in the bit field.
2217 @param AndData The value to AND with read value from the MMIO register.
2219 @return The value written back to the MMIO register.
2231 return MmioWrite64 (
2233 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2238 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2239 by a bitwise OR, and writes the result back to the bit field in the
2240 64-bit MMIO register.
2242 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2243 followed by a bitwise OR between the read result and the value
2244 specified by AndData, and writes the result to the 64-bit MMIO register
2245 specified by Address. The value written to the MMIO register is returned.
2246 This function must guarantee that all MMIO read and write operations are
2247 serialized. Extra left bits in both AndData and OrData are stripped.
2249 If 64-bit MMIO register operations are not supported, then ASSERT().
2250 If StartBit is greater than 63, then ASSERT().
2251 If EndBit is greater than 63, then ASSERT().
2252 If EndBit is less than StartBit, then ASSERT().
2254 @param Address MMIO register to write.
2255 @param StartBit The ordinal of the least significant bit in the bit field.
2257 @param EndBit The ordinal of the most significant bit in the bit field.
2259 @param AndData The value to AND with read value from the MMIO register.
2260 @param OrData The value to OR with the result of the AND operation.
2262 @return The value written back to the MMIO register.
2267 MmioBitFieldAndThenOr64 (
2275 return MmioWrite64 (
2277 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)