]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
10 The following IoLib instances contain the same copy of this file:
18 #include "BaseIoLibIntrinsicInternal.h"
21 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
22 result back to the 8-bit I/O port.
24 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
25 between the read result and the value specified by OrData, and writes the
26 result to the 8-bit I/O port specified by Port. The value written to the I/O
27 port is returned. This function must guarantee that all I/O read and write
28 operations are serialized.
30 If 8-bit I/O port operations are not supported, then ASSERT().
32 @param Port The I/O port to write.
33 @param OrData The value to OR with the read value from the I/O port.
35 @return The value written back to the I/O port.
45 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
49 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
50 to the 8-bit I/O port.
52 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
53 the read result and the value specified by AndData, and writes the result to
54 the 8-bit I/O port specified by Port. The value written to the I/O port is
55 returned. This function must guarantee that all I/O read and write operations
58 If 8-bit I/O port operations are not supported, then ASSERT().
60 @param Port The I/O port to write.
61 @param AndData The value to AND with the read value from the I/O port.
63 @return The value written back to the I/O port.
73 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
77 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
78 OR, and writes the result back to the 8-bit I/O port.
80 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
81 the read result and the value specified by AndData, performs a bitwise OR
82 between the result of the AND operation and the value specified by OrData,
83 and writes the result to the 8-bit I/O port specified by Port. The value
84 written to the I/O port is returned. This function must guarantee that all
85 I/O read and write operations are serialized.
87 If 8-bit I/O port operations are not supported, then ASSERT().
89 @param Port The I/O port to write.
90 @param AndData The value to AND with the read value from the I/O port.
91 @param OrData The value to OR with the result of the AND operation.
93 @return The value written back to the I/O port.
104 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
108 Reads a bit field of an I/O register.
110 Reads the bit field in an 8-bit I/O register. The bit field is specified by
111 the StartBit and the EndBit. The value of the bit field is returned.
113 If 8-bit I/O port operations are not supported, then ASSERT().
114 If StartBit is greater than 7, then ASSERT().
115 If EndBit is greater than 7, then ASSERT().
116 If EndBit is less than StartBit, then ASSERT().
118 @param Port The I/O port to read.
119 @param StartBit The ordinal of the least significant bit in the bit field.
121 @param EndBit The ordinal of the most significant bit in the bit field.
124 @return The value read.
135 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
139 Writes a bit field to an I/O register.
141 Writes Value to the bit field of the I/O register. The bit field is specified
142 by the StartBit and the EndBit. All other bits in the destination I/O
143 register are preserved. The value written to the I/O port is returned.
145 If 8-bit I/O port operations are not supported, then ASSERT().
146 If StartBit is greater than 7, then ASSERT().
147 If EndBit is greater than 7, then ASSERT().
148 If EndBit is less than StartBit, then ASSERT().
149 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
151 @param Port The I/O port to write.
152 @param StartBit The ordinal of the least significant bit in the bit field.
154 @param EndBit The ordinal of the most significant bit in the bit field.
156 @param Value The new value of the bit field.
158 @return The value written back to the I/O port.
172 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
177 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
178 result back to the bit field in the 8-bit port.
180 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
181 between the read result and the value specified by OrData, and writes the
182 result to the 8-bit I/O port specified by Port. The value written to the I/O
183 port is returned. This function must guarantee that all I/O read and write
184 operations are serialized. Extra bits left in OrData are stripped.
186 If 8-bit I/O port operations are not supported, then ASSERT().
187 If StartBit is greater than 7, then ASSERT().
188 If EndBit is greater than 7, then ASSERT().
189 If EndBit is less than StartBit, then ASSERT().
190 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
192 @param Port The I/O port to write.
193 @param StartBit The ordinal of the least significant bit in the bit field.
195 @param EndBit The ordinal of the most significant bit in the bit field.
197 @param OrData The value to OR with the read value from the I/O port.
199 @return The value written back to the I/O port.
213 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
218 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
219 result back to the bit field in the 8-bit port.
221 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
222 the read result and the value specified by AndData, and writes the result to
223 the 8-bit I/O port specified by Port. The value written to the I/O port is
224 returned. This function must guarantee that all I/O read and write operations
225 are serialized. Extra bits left in AndData are stripped.
227 If 8-bit I/O port operations are not supported, then ASSERT().
228 If StartBit is greater than 7, then ASSERT().
229 If EndBit is greater than 7, then ASSERT().
230 If EndBit is less than StartBit, then ASSERT().
231 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
233 @param Port The I/O port to write.
234 @param StartBit The ordinal of the least significant bit in the bit field.
236 @param EndBit The ordinal of the most significant bit in the bit field.
238 @param AndData The value to AND with the read value from the I/O port.
240 @return The value written back to the I/O port.
254 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
259 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
260 bitwise OR, and writes the result back to the bit field in the
263 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
264 by a bitwise OR between the read result and the value specified by
265 AndData, and writes the result to the 8-bit I/O port specified by Port. The
266 value written to the I/O port is returned. This function must guarantee that
267 all I/O read and write operations are serialized. Extra bits left in both
268 AndData and OrData are stripped.
270 If 8-bit I/O port operations are not supported, then ASSERT().
271 If StartBit is greater than 7, then ASSERT().
272 If EndBit is greater than 7, then ASSERT().
273 If EndBit is less than StartBit, then ASSERT().
274 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
275 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
277 @param Port The I/O port to write.
278 @param StartBit The ordinal of the least significant bit in the bit field.
280 @param EndBit The ordinal of the most significant bit in the bit field.
282 @param AndData The value to AND with the read value from the I/O port.
283 @param OrData The value to OR with the result of the AND operation.
285 @return The value written back to the I/O port.
290 IoBitFieldAndThenOr8 (
300 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
305 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
306 result back to the 16-bit I/O port.
308 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
309 between the read result and the value specified by OrData, and writes the
310 result to the 16-bit I/O port specified by Port. The value written to the I/O
311 port is returned. This function must guarantee that all I/O read and write
312 operations are serialized.
314 If 16-bit I/O port operations are not supported, then ASSERT().
315 If Port is not aligned on a 16-bit boundary, then ASSERT().
317 @param Port The I/O port to write.
318 @param OrData The value to OR with the read value from the I/O port.
320 @return The value written back to the I/O port.
330 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
334 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
335 to the 16-bit I/O port.
337 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
338 the read result and the value specified by AndData, and writes the result to
339 the 16-bit I/O port specified by Port. The value written to the I/O port is
340 returned. This function must guarantee that all I/O read and write operations
343 If 16-bit I/O port operations are not supported, then ASSERT().
344 If Port is not aligned on a 16-bit boundary, 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().
374 If Port is not aligned on a 16-bit boundary, then ASSERT().
376 @param Port The I/O port to write.
377 @param AndData The value to AND with the read value from the I/O port.
378 @param OrData The value to OR with the result of the AND operation.
380 @return The value written back to the I/O port.
391 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
395 Reads a bit field of an I/O register.
397 Reads the bit field in a 16-bit I/O register. The bit field is specified by
398 the StartBit and the EndBit. The value of the bit field is returned.
400 If 16-bit I/O port operations are not supported, then ASSERT().
401 If Port is not aligned on a 16-bit boundary, then ASSERT().
402 If StartBit is greater than 15, then ASSERT().
403 If EndBit is greater than 15, then ASSERT().
404 If EndBit is less than StartBit, then ASSERT().
406 @param Port The I/O port to read.
407 @param StartBit The ordinal of the least significant bit in the bit field.
409 @param EndBit The ordinal of the most significant bit in the bit field.
412 @return The value read.
423 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
427 Writes a bit field to an I/O register.
429 Writes Value to the bit field of the I/O register. The bit field is specified
430 by the StartBit and the EndBit. All other bits in the destination I/O
431 register are preserved. The value written to the I/O port is returned. Extra
432 bits left in Value are stripped.
434 If 16-bit I/O port operations are not supported, then ASSERT().
435 If Port is not aligned on a 16-bit boundary, then ASSERT().
436 If StartBit is greater than 15, then ASSERT().
437 If EndBit is greater than 15, then ASSERT().
438 If EndBit is less than StartBit, then ASSERT().
439 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
441 @param Port The I/O port to write.
442 @param StartBit The ordinal of the least significant bit in the bit field.
444 @param EndBit The ordinal of the most significant bit in the bit field.
446 @param Value The new value of the bit field.
448 @return The value written back to the I/O port.
462 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
467 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
468 result back to the bit field in the 16-bit port.
470 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
471 between the read result and the value specified by OrData, and writes the
472 result to the 16-bit I/O port specified by Port. The value written to the I/O
473 port is returned. This function must guarantee that all I/O read and write
474 operations are serialized. Extra bits left in OrData are stripped.
476 If 16-bit I/O port operations are not supported, then ASSERT().
477 If Port is not aligned on a 16-bit boundary, 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().
481 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
483 @param Port The I/O port to write.
484 @param StartBit The ordinal of the least significant bit in the bit field.
486 @param EndBit The ordinal of the most significant bit in the bit field.
488 @param OrData The value to OR with the read value from the I/O port.
490 @return The value written back to the I/O port.
504 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
509 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
510 result back to the bit field in the 16-bit port.
512 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
513 the read result and the value specified by AndData, and writes the result to
514 the 16-bit I/O port specified by Port. The value written to the I/O port is
515 returned. This function must guarantee that all I/O read and write operations
516 are serialized. Extra bits left in AndData are stripped.
518 If 16-bit I/O port operations are not supported, then ASSERT().
519 If Port is not aligned on a 16-bit boundary, then ASSERT().
520 If StartBit is greater than 15, then ASSERT().
521 If EndBit is greater than 15, then ASSERT().
522 If EndBit is less than StartBit, then ASSERT().
523 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
525 @param Port The I/O port to write.
526 @param StartBit The ordinal of the least significant bit in the bit field.
528 @param EndBit The ordinal of the most significant bit in the bit field.
530 @param AndData The value to AND with the read value from the I/O port.
532 @return The value written back to the I/O port.
546 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
551 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
552 bitwise OR, and writes the result back to the bit field in the
555 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
556 by a bitwise OR between the read result and the value specified by
557 AndData, and writes the result to the 16-bit I/O port specified by Port. The
558 value written to the I/O port is returned. This function must guarantee that
559 all I/O read and write operations are serialized. Extra bits left in both
560 AndData and OrData are stripped.
562 If 16-bit I/O port operations are not supported, then ASSERT().
563 If Port is not aligned on a 16-bit boundary, then ASSERT().
564 If StartBit is greater than 15, then ASSERT().
565 If EndBit is greater than 15, then ASSERT().
566 If EndBit is less than StartBit, then ASSERT().
567 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
568 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
570 @param Port The I/O port to write.
571 @param StartBit The ordinal of the least significant bit in the bit field.
573 @param EndBit The ordinal of the most significant bit in the bit field.
575 @param AndData The value to AND with the read value from the I/O port.
576 @param OrData The value to OR with the result of the AND operation.
578 @return The value written back to the I/O port.
583 IoBitFieldAndThenOr16 (
593 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
598 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
599 result back to the 32-bit I/O port.
601 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
602 between the read result and the value specified by OrData, and writes the
603 result to the 32-bit I/O port specified by Port. The value written to the I/O
604 port is returned. This function must guarantee that all I/O read and write
605 operations are serialized.
607 If 32-bit I/O port operations are not supported, then ASSERT().
608 If Port is not aligned on a 32-bit boundary, then ASSERT().
610 @param Port The I/O port to write.
611 @param OrData The value to OR with the read value from the I/O port.
613 @return The value written back to the I/O port.
623 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
627 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
628 to the 32-bit I/O port.
630 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
631 the read result and the value specified by AndData, and writes the result to
632 the 32-bit I/O port specified by Port. The value written to the I/O port is
633 returned. This function must guarantee that all I/O read and write operations
636 If 32-bit I/O port operations are not supported, then ASSERT().
637 If Port is not aligned on a 32-bit boundary, then ASSERT().
639 @param Port The I/O port to write.
640 @param AndData The value to AND with the read value from the I/O port.
642 @return The value written back to the I/O port.
652 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
656 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
657 OR, and writes the result back to the 32-bit I/O port.
659 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
660 the read result and the value specified by AndData, performs a bitwise OR
661 between the result of the AND operation and the value specified by OrData,
662 and writes the result to the 32-bit I/O port specified by Port. The value
663 written to the I/O port is returned. This function must guarantee that all
664 I/O read and write operations are serialized.
666 If 32-bit I/O port operations are not supported, then ASSERT().
667 If Port is not aligned on a 32-bit boundary, then ASSERT().
669 @param Port The I/O port to write.
670 @param AndData The value to AND with the read value from the I/O port.
671 @param OrData The value to OR with the result of the AND operation.
673 @return The value written back to the I/O port.
684 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
688 Reads a bit field of an I/O register.
690 Reads the bit field in a 32-bit I/O register. The bit field is specified by
691 the StartBit and the EndBit. The value of the bit field is returned.
693 If 32-bit I/O port operations are not supported, then ASSERT().
694 If Port is not aligned on a 32-bit boundary, then ASSERT().
695 If StartBit is greater than 31, then ASSERT().
696 If EndBit is greater than 31, then ASSERT().
697 If EndBit is less than StartBit, then ASSERT().
699 @param Port The I/O port to read.
700 @param StartBit The ordinal of the least significant bit in the bit field.
702 @param EndBit The ordinal of the most significant bit in the bit field.
705 @return The value read.
716 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
720 Writes a bit field to an I/O register.
722 Writes Value to the bit field of the I/O register. The bit field is specified
723 by the StartBit and the EndBit. All other bits in the destination I/O
724 register are preserved. The value written to the I/O port is returned. Extra
725 bits left in Value are stripped.
727 If 32-bit I/O port operations are not supported, then ASSERT().
728 If Port is not aligned on a 32-bit boundary, then ASSERT().
729 If StartBit is greater than 31, then ASSERT().
730 If EndBit is greater than 31, then ASSERT().
731 If EndBit is less than StartBit, then ASSERT().
732 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
734 @param Port The I/O port to write.
735 @param StartBit The ordinal of the least significant bit in the bit field.
737 @param EndBit The ordinal of the most significant bit in the bit field.
739 @param Value The new value of the bit field.
741 @return The value written back to the I/O port.
755 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
760 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
761 result back to the bit field in the 32-bit port.
763 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
764 between the read result and the value specified by OrData, and writes the
765 result to the 32-bit I/O port specified by Port. The value written to the I/O
766 port is returned. This function must guarantee that all I/O read and write
767 operations are serialized. Extra bits left in OrData are stripped.
769 If 32-bit I/O port operations are not supported, then ASSERT().
770 If Port is not aligned on a 32-bit boundary, then ASSERT().
771 If StartBit is greater than 31, then ASSERT().
772 If EndBit is greater than 31, then ASSERT().
773 If EndBit is less than StartBit, then ASSERT().
774 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
776 @param Port The I/O port to write.
777 @param StartBit The ordinal of the least significant bit in the bit field.
779 @param EndBit The ordinal of the most significant bit in the bit field.
781 @param OrData The value to OR with the read value from the I/O port.
783 @return The value written back to the I/O port.
797 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
802 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
803 result back to the bit field in the 32-bit port.
805 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
806 the read result and the value specified by AndData, and writes the result to
807 the 32-bit I/O port specified by Port. The value written to the I/O port is
808 returned. This function must guarantee that all I/O read and write operations
809 are serialized. Extra bits left in AndData are stripped.
811 If 32-bit I/O port operations are not supported, then ASSERT().
812 If Port is not aligned on a 32-bit boundary, then ASSERT().
813 If StartBit is greater than 31, then ASSERT().
814 If EndBit is greater than 31, then ASSERT().
815 If EndBit is less than StartBit, then ASSERT().
816 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
818 @param Port The I/O port to write.
819 @param StartBit The ordinal of the least significant bit in the bit field.
821 @param EndBit The ordinal of the most significant bit in the bit field.
823 @param AndData The value to AND with the read value from the I/O port.
825 @return The value written back to the I/O port.
839 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
844 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
845 bitwise OR, and writes the result back to the bit field in the
848 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
849 by a bitwise OR between the read result and the value specified by
850 AndData, and writes the result to the 32-bit I/O port specified by Port. The
851 value written to the I/O port is returned. This function must guarantee that
852 all I/O read and write operations are serialized. Extra bits left in both
853 AndData and OrData are stripped.
855 If 32-bit I/O port operations are not supported, then ASSERT().
856 If Port is not aligned on a 32-bit boundary, then ASSERT().
857 If StartBit is greater than 31, then ASSERT().
858 If EndBit is greater than 31, then ASSERT().
859 If EndBit is less than StartBit, then ASSERT().
860 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
861 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
863 @param Port The I/O port to write.
864 @param StartBit The ordinal of the least significant bit in the bit field.
866 @param EndBit The ordinal of the most significant bit in the bit field.
868 @param AndData The value to AND with the read value from the I/O port.
869 @param OrData The value to OR with the result of the AND operation.
871 @return The value written back to the I/O port.
876 IoBitFieldAndThenOr32 (
886 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
891 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
892 result back to the 64-bit I/O port.
894 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
895 between the read result and the value specified by OrData, and writes the
896 result to the 64-bit I/O port specified by Port. The value written to the I/O
897 port is returned. This function must guarantee that all I/O read and write
898 operations are serialized.
900 If 64-bit I/O port operations are not supported, then ASSERT().
901 If Port is not aligned on a 64-bit boundary, then ASSERT().
903 @param Port The I/O port to write.
904 @param OrData The value to OR with the read value from the I/O port.
906 @return The value written back to the I/O port.
916 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
920 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
921 to the 64-bit I/O port.
923 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
924 the read result and the value specified by AndData, and writes the result to
925 the 64-bit I/O port specified by Port. The value written to the I/O port is
926 returned. This function must guarantee that all I/O read and write operations
929 If 64-bit I/O port operations are not supported, then ASSERT().
930 If Port is not aligned on a 64-bit boundary, then ASSERT().
932 @param Port The I/O port to write.
933 @param AndData The value to AND with the read value from the I/O port.
935 @return The value written back to the I/O port.
945 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
949 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
950 OR, and writes the result back to the 64-bit I/O port.
952 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
953 the read result and the value specified by AndData, performs a bitwise OR
954 between the result of the AND operation and the value specified by OrData,
955 and writes the result to the 64-bit I/O port specified by Port. The value
956 written to the I/O port is returned. This function must guarantee that all
957 I/O read and write operations are serialized.
959 If 64-bit I/O port operations are not supported, then ASSERT().
960 If Port is not aligned on a 64-bit boundary, then ASSERT().
962 @param Port The I/O port to write.
963 @param AndData The value to AND with the read value from the I/O port.
964 @param OrData The value to OR with the result of the AND operation.
966 @return The value written back to the I/O port.
977 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
981 Reads a bit field of an I/O register.
983 Reads the bit field in a 64-bit I/O register. The bit field is specified by
984 the StartBit and the EndBit. The value of the bit field is returned.
986 If 64-bit I/O port operations are not supported, then ASSERT().
987 If Port is not aligned on a 64-bit boundary, then ASSERT().
988 If StartBit is greater than 63, then ASSERT().
989 If EndBit is greater than 63, then ASSERT().
990 If EndBit is less than StartBit, then ASSERT().
992 @param Port The I/O port to read.
993 @param StartBit The ordinal of the least significant bit in the bit field.
995 @param EndBit The ordinal of the most significant bit in the bit field.
998 @return The value read.
1009 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
1013 Writes a bit field to an I/O register.
1015 Writes Value to the bit field of the I/O register. The bit field is specified
1016 by the StartBit and the EndBit. All other bits in the destination I/O
1017 register are preserved. The value written to the I/O port is returned. Extra
1018 bits left in Value are stripped.
1020 If 64-bit I/O port operations are not supported, then ASSERT().
1021 If Port is not aligned on a 64-bit boundary, then ASSERT().
1022 If StartBit is greater than 63, then ASSERT().
1023 If EndBit is greater than 63, then ASSERT().
1024 If EndBit is less than StartBit, then ASSERT().
1025 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1027 @param Port The I/O port to write.
1028 @param StartBit The ordinal of the least significant bit in the bit field.
1030 @param EndBit The ordinal of the most significant bit in the bit field.
1032 @param Value The new value of the bit field.
1034 @return The value written back to the I/O port.
1048 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1053 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1054 result back to the bit field in the 64-bit port.
1056 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1057 between the read result and the value specified by OrData, and writes the
1058 result to the 64-bit I/O port specified by Port. The value written to the I/O
1059 port is returned. This function must guarantee that all I/O read and write
1060 operations are serialized. Extra bits left in OrData are stripped.
1062 If 64-bit I/O port operations are not supported, then ASSERT().
1063 If Port is not aligned on a 64-bit boundary, then ASSERT().
1064 If StartBit is greater than 63, then ASSERT().
1065 If EndBit is greater than 63, then ASSERT().
1066 If EndBit is less than StartBit, then ASSERT().
1067 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1069 @param Port The I/O port to write.
1070 @param StartBit The ordinal of the least significant bit in the bit field.
1072 @param EndBit The ordinal of the most significant bit in the bit field.
1074 @param OrData The value to OR with the read value from the I/O port.
1076 @return The value written back to the I/O port.
1090 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1095 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1096 result back to the bit field in the 64-bit port.
1098 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1099 the read result and the value specified by AndData, and writes the result to
1100 the 64-bit I/O port specified by Port. The value written to the I/O port is
1101 returned. This function must guarantee that all I/O read and write operations
1102 are serialized. Extra bits left in AndData are stripped.
1104 If 64-bit I/O port operations are not supported, then ASSERT().
1105 If Port is not aligned on a 64-bit boundary, then ASSERT().
1106 If StartBit is greater than 63, then ASSERT().
1107 If EndBit is greater than 63, then ASSERT().
1108 If EndBit is less than StartBit, then ASSERT().
1109 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1111 @param Port The I/O port to write.
1112 @param StartBit The ordinal of the least significant bit in the bit field.
1114 @param EndBit The ordinal of the most significant bit in the bit field.
1116 @param AndData The value to AND with the read value from the I/O port.
1118 @return The value written back to the I/O port.
1132 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1137 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1138 bitwise OR, and writes the result back to the bit field in the
1141 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1142 by a bitwise OR between the read result and the value specified by
1143 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1144 value written to the I/O port is returned. This function must guarantee that
1145 all I/O read and write operations are serialized. Extra bits left in both
1146 AndData and OrData are stripped.
1148 If 64-bit I/O port operations are not supported, then ASSERT().
1149 If Port is not aligned on a 64-bit boundary, then ASSERT().
1150 If StartBit is greater than 63, then ASSERT().
1151 If EndBit is greater than 63, then ASSERT().
1152 If EndBit is less than StartBit, then ASSERT().
1153 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1154 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1156 @param Port The I/O port to write.
1157 @param StartBit The ordinal of the least significant bit in the bit field.
1159 @param EndBit The ordinal of the most significant bit in the bit field.
1161 @param AndData The value to AND with the read value from the I/O port.
1162 @param OrData The value to OR with the result of the AND operation.
1164 @return The value written back to the I/O port.
1169 IoBitFieldAndThenOr64 (
1179 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1184 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1185 result back to the 8-bit MMIO register.
1187 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1188 OR between the read result and the value specified by OrData, and
1189 writes the result to the 8-bit MMIO register specified by Address. The value
1190 written to the MMIO register is returned. This function must guarantee that
1191 all MMIO read and write operations are serialized.
1193 If 8-bit MMIO register operations are not supported, then ASSERT().
1195 @param Address The MMIO register to write.
1196 @param OrData The value to OR with the read value from the MMIO register.
1198 @return The value written back to the MMIO register.
1208 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1212 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1213 back to the 8-bit MMIO register.
1215 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1216 between the read result and the value specified by AndData, and writes the
1217 result to the 8-bit MMIO register specified by Address. The value written to
1218 the MMIO register is returned. This function must guarantee that all MMIO
1219 read and write operations are serialized.
1221 If 8-bit MMIO register operations are not supported, then ASSERT().
1223 @param Address The MMIO register to write.
1224 @param AndData The value to AND with the read value from the MMIO register.
1226 @return The value written back to the MMIO register.
1236 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1240 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1241 OR, and writes the result back to the 8-bit MMIO register.
1243 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1244 between the read result and the value specified by AndData, performs a
1245 bitwise OR between the result of the AND operation and the value specified by
1246 OrData, and writes the result to the 8-bit MMIO register specified by
1247 Address. The value written to the MMIO register is returned. This function
1248 must guarantee that all MMIO read and write operations are serialized.
1250 If 8-bit MMIO register operations are not supported, then ASSERT().
1253 @param Address The MMIO register to write.
1254 @param AndData The value to AND with the read value from the MMIO register.
1255 @param OrData The value to OR with the result of the AND operation.
1257 @return The value written back to the MMIO register.
1268 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1272 Reads a bit field of a MMIO register.
1274 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1275 the StartBit and the EndBit. The value of the bit field 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 The MMIO register to read.
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.
1288 @return The value read.
1299 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1303 Writes a bit field to a MMIO register.
1305 Writes Value to the bit field of the MMIO register. The bit field is
1306 specified by the StartBit and the EndBit. All other bits in the destination
1307 MMIO register are preserved. The new value of the 8-bit register is returned.
1309 If 8-bit MMIO register operations are not supported, then ASSERT().
1310 If StartBit is greater than 7, then ASSERT().
1311 If EndBit is greater than 7, then ASSERT().
1312 If EndBit is less than StartBit, then ASSERT().
1313 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1315 @param Address The MMIO register to write.
1316 @param StartBit The ordinal of the least significant bit in the bit field.
1318 @param EndBit The ordinal of the most significant bit in the bit field.
1320 @param Value The new value of the bit field.
1322 @return The value written back to the MMIO register.
1327 MmioBitFieldWrite8 (
1336 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1341 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1342 writes the result back to the bit field in the 8-bit MMIO register.
1344 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1345 OR between the read result and the value specified by OrData, and
1346 writes the result to the 8-bit MMIO register specified by Address. The value
1347 written to the MMIO register is returned. This function must guarantee that
1348 all MMIO read and write operations are serialized. Extra bits left in OrData
1351 If 8-bit MMIO register operations are not supported, then ASSERT().
1352 If StartBit is greater than 7, then ASSERT().
1353 If EndBit is greater than 7, then ASSERT().
1354 If EndBit is less than StartBit, then ASSERT().
1355 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1357 @param Address The MMIO register to write.
1358 @param StartBit The ordinal of the least significant bit in the bit field.
1360 @param EndBit The ordinal of the most significant bit in the bit field.
1362 @param OrData The value to OR with read value from the MMIO register.
1364 @return The value written back to the MMIO register.
1378 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1383 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1384 writes the result back to the bit field in the 8-bit MMIO register.
1386 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1387 between the read result and the value specified by AndData, and writes the
1388 result to the 8-bit MMIO register specified by Address. The value written to
1389 the MMIO register is returned. This function must guarantee that all MMIO
1390 read and write operations are serialized. Extra bits left in AndData are
1393 If 8-bit MMIO register operations are not supported, then ASSERT().
1394 If StartBit is greater than 7, then ASSERT().
1395 If EndBit is greater than 7, then ASSERT().
1396 If EndBit is less than StartBit, then ASSERT().
1397 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1399 @param Address The MMIO register to write.
1400 @param StartBit The ordinal of the least significant bit in the bit field.
1402 @param EndBit The ordinal of the most significant bit in the bit field.
1404 @param AndData The value to AND with read value from the MMIO register.
1406 @return The value written back to the MMIO register.
1420 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1425 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1426 by a bitwise OR, and writes the result back to the bit field in the
1427 8-bit MMIO register.
1429 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1430 followed by a bitwise OR between the read result and the value
1431 specified by AndData, and writes the result to the 8-bit MMIO register
1432 specified by Address. The value written to the MMIO register is returned.
1433 This function must guarantee that all MMIO read and write operations are
1434 serialized. Extra bits left in both AndData and OrData are stripped.
1436 If 8-bit MMIO register operations are not supported, then ASSERT().
1437 If StartBit is greater than 7, then ASSERT().
1438 If EndBit is greater than 7, then ASSERT().
1439 If EndBit is less than StartBit, then ASSERT().
1440 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1441 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1443 @param Address The MMIO register to write.
1444 @param StartBit The ordinal of the least significant bit in the bit field.
1446 @param EndBit The ordinal of the most significant bit in the bit field.
1448 @param AndData The value to AND with read value from the MMIO register.
1449 @param OrData The value to OR with the result of the AND operation.
1451 @return The value written back to the MMIO register.
1456 MmioBitFieldAndThenOr8 (
1466 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1471 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1472 result back to the 16-bit MMIO register.
1474 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1475 OR between the read result and the value specified by OrData, and
1476 writes the result to the 16-bit MMIO register specified by Address. The value
1477 written to the MMIO register is returned. This function must guarantee that
1478 all MMIO read and write operations are serialized.
1480 If 16-bit MMIO register operations are not supported, then ASSERT().
1481 If Address is not aligned on a 16-bit boundary, then ASSERT().
1483 @param Address The MMIO register to write.
1484 @param OrData The value to OR with the read value from the MMIO register.
1486 @return The value written back to the MMIO register.
1496 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1500 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1501 back to the 16-bit MMIO register.
1503 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1504 between the read result and the value specified by AndData, and writes the
1505 result to the 16-bit MMIO register specified by Address. The value written to
1506 the MMIO register is returned. This function must guarantee that all MMIO
1507 read and write operations are serialized.
1509 If 16-bit MMIO register operations are not supported, then ASSERT().
1510 If Address is not aligned on a 16-bit boundary, then ASSERT().
1512 @param Address The MMIO register to write.
1513 @param AndData The value to AND with the read value from the MMIO register.
1515 @return The value written back to the MMIO register.
1525 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1529 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1530 OR, and writes the result back to the 16-bit MMIO register.
1532 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1533 between the read result and the value specified by AndData, performs a
1534 bitwise OR between the result of the AND operation and the value specified by
1535 OrData, and writes the result to the 16-bit MMIO register specified by
1536 Address. The value written to the MMIO register is returned. This function
1537 must guarantee that all MMIO read and write operations are serialized.
1539 If 16-bit MMIO register operations are not supported, then ASSERT().
1540 If Address is not aligned on a 16-bit boundary, then ASSERT().
1542 @param Address The MMIO register to write.
1543 @param AndData The value to AND with the read value from the MMIO register.
1544 @param OrData The value to OR with the result of the AND operation.
1546 @return The value written back to the MMIO register.
1557 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1561 Reads a bit field of a MMIO register.
1563 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1564 the StartBit and the EndBit. The value of the bit field is returned.
1566 If 16-bit MMIO register operations are not supported, then ASSERT().
1567 If Address is not aligned on a 16-bit boundary, then ASSERT().
1568 If StartBit is greater than 15, then ASSERT().
1569 If EndBit is greater than 15, then ASSERT().
1570 If EndBit is less than StartBit, then ASSERT().
1572 @param Address The MMIO register to read.
1573 @param StartBit The ordinal of the least significant bit in the bit field.
1575 @param EndBit The ordinal of the most significant bit in the bit field.
1578 @return The value read.
1583 MmioBitFieldRead16 (
1589 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1593 Writes a bit field to a MMIO register.
1595 Writes Value to the bit field of the MMIO register. The bit field is
1596 specified by the StartBit and the EndBit. All other bits in the destination
1597 MMIO register are preserved. The new value of the 16-bit register is returned.
1599 If 16-bit MMIO register operations are not supported, then ASSERT().
1600 If Address is not aligned on a 16-bit boundary, 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().
1604 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1606 @param Address The MMIO register to write.
1607 @param StartBit The ordinal of the least significant bit in the bit field.
1609 @param EndBit The ordinal of the most significant bit in the bit field.
1611 @param Value The new value of the bit field.
1613 @return The value written back to the MMIO register.
1618 MmioBitFieldWrite16 (
1625 return MmioWrite16 (
1627 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1632 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1633 writes the result back to the bit field in the 16-bit MMIO register.
1635 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1636 OR between the read result and the value specified by OrData, and
1637 writes the result to the 16-bit MMIO register specified by Address. The value
1638 written to the MMIO register is returned. This function must guarantee that
1639 all MMIO read and write operations are serialized. Extra bits left in OrData
1642 If 16-bit MMIO register operations are not supported, then ASSERT().
1643 If Address is not aligned on a 16-bit boundary, then ASSERT().
1644 If StartBit is greater than 15, then ASSERT().
1645 If EndBit is greater than 15, then ASSERT().
1646 If EndBit is less than StartBit, then ASSERT().
1647 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1649 @param Address The MMIO register to write.
1650 @param StartBit The ordinal of the least significant bit in the bit field.
1652 @param EndBit The ordinal of the most significant bit in the bit field.
1654 @param OrData The value to OR with read value from the MMIO register.
1656 @return The value written back to the MMIO register.
1668 return MmioWrite16 (
1670 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1675 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1676 writes the result back to the bit field in the 16-bit MMIO register.
1678 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1679 between the read result and the value specified by AndData, and writes the
1680 result to the 16-bit MMIO register specified by Address. The value written to
1681 the MMIO register is returned. This function must guarantee that all MMIO
1682 read and write operations are serialized. Extra bits left in AndData are
1685 If 16-bit MMIO register operations are not supported, then ASSERT().
1686 If Address is not aligned on a 16-bit boundary, then ASSERT().
1687 If StartBit is greater than 15, then ASSERT().
1688 If EndBit is greater than 15, then ASSERT().
1689 If EndBit is less than StartBit, then ASSERT().
1690 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1692 @param Address The MMIO register to write.
1693 @param StartBit The ordinal of the least significant bit in the bit field.
1695 @param EndBit The ordinal of the most significant bit in the bit field.
1697 @param AndData The value to AND with read value from the MMIO register.
1699 @return The value written back to the MMIO register.
1711 return MmioWrite16 (
1713 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1718 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1719 by a bitwise OR, and writes the result back to the bit field in the
1720 16-bit MMIO register.
1722 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1723 followed by a bitwise OR between the read result and the value
1724 specified by AndData, and writes the result to the 16-bit MMIO register
1725 specified by Address. The value written to the MMIO register is returned.
1726 This function must guarantee that all MMIO read and write operations are
1727 serialized. Extra bits left in both AndData and OrData are stripped.
1729 If 16-bit MMIO register operations are not supported, then ASSERT().
1730 If Address is not aligned on a 16-bit boundary, then ASSERT().
1731 If StartBit is greater than 15, then ASSERT().
1732 If EndBit is greater than 15, then ASSERT().
1733 If EndBit is less than StartBit, then ASSERT().
1734 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1735 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1737 @param Address The MMIO register to write.
1738 @param StartBit The ordinal of the least significant bit in the bit field.
1740 @param EndBit The ordinal of the most significant bit in the bit field.
1742 @param AndData The value to AND with read value from the MMIO register.
1743 @param OrData The value to OR with the result of the AND operation.
1745 @return The value written back to the MMIO register.
1750 MmioBitFieldAndThenOr16 (
1758 return MmioWrite16 (
1760 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1765 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1766 result back to the 32-bit MMIO register.
1768 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1769 OR between the read result and the value specified by OrData, and
1770 writes the result to the 32-bit MMIO register specified by Address. The value
1771 written to the MMIO register is returned. This function must guarantee that
1772 all MMIO read and write operations are serialized.
1774 If 32-bit MMIO register operations are not supported, then ASSERT().
1775 If Address is not aligned on a 32-bit boundary, then ASSERT().
1777 @param Address The MMIO register to write.
1778 @param OrData The value to OR with the read value from the MMIO register.
1780 @return The value written back to the MMIO register.
1790 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1794 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1795 back to the 32-bit MMIO register.
1797 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1798 between the read result and the value specified by AndData, and writes the
1799 result to the 32-bit MMIO register specified by Address. The value written to
1800 the MMIO register is returned. This function must guarantee that all MMIO
1801 read and write operations are serialized.
1803 If 32-bit MMIO register operations are not supported, then ASSERT().
1804 If Address is not aligned on a 32-bit boundary, then ASSERT().
1806 @param Address The MMIO register to write.
1807 @param AndData The value to AND with the read value from the MMIO register.
1809 @return The value written back to the MMIO register.
1819 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1823 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1824 OR, and writes the result back to the 32-bit MMIO register.
1826 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1827 between the read result and the value specified by AndData, performs a
1828 bitwise OR between the result of the AND operation and the value specified by
1829 OrData, and writes the result to the 32-bit MMIO register specified by
1830 Address. The value written to the MMIO register is returned. This function
1831 must guarantee that all MMIO read and write operations are serialized.
1833 If 32-bit MMIO register operations are not supported, then ASSERT().
1834 If Address is not aligned on a 32-bit boundary, then ASSERT().
1836 @param Address The MMIO register to write.
1837 @param AndData The value to AND with the read value from the MMIO register.
1838 @param OrData The value to OR with the result of the AND operation.
1840 @return The value written back to the MMIO register.
1851 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1855 Reads a bit field of a MMIO register.
1857 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1858 the StartBit and the EndBit. The value of the bit field is returned.
1860 If 32-bit MMIO register operations are not supported, then ASSERT().
1861 If Address is not aligned on a 32-bit boundary, then ASSERT().
1862 If StartBit is greater than 31, then ASSERT().
1863 If EndBit is greater than 31, then ASSERT().
1864 If EndBit is less than StartBit, then ASSERT().
1866 @param Address The MMIO register to read.
1867 @param StartBit The ordinal of the least significant bit in the bit field.
1869 @param EndBit The ordinal of the most significant bit in the bit field.
1872 @return The value read.
1877 MmioBitFieldRead32 (
1883 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1887 Writes a bit field to a MMIO register.
1889 Writes Value to the bit field of the MMIO register. The bit field is
1890 specified by the StartBit and the EndBit. All other bits in the destination
1891 MMIO register are preserved. The new value of the 32-bit register is returned.
1893 If 32-bit MMIO register operations are not supported, then ASSERT().
1894 If Address is not aligned on a 32-bit boundary, then ASSERT().
1895 If StartBit is greater than 31, then ASSERT().
1896 If EndBit is greater than 31, then ASSERT().
1897 If EndBit is less than StartBit, then ASSERT().
1898 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1900 @param Address The MMIO register to write.
1901 @param StartBit The ordinal of the least significant bit in the bit field.
1903 @param EndBit The ordinal of the most significant bit in the bit field.
1905 @param Value The new value of the bit field.
1907 @return The value written back to the MMIO register.
1912 MmioBitFieldWrite32 (
1919 return MmioWrite32 (
1921 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1926 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1927 writes the result back to the bit field in the 32-bit MMIO register.
1929 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1930 OR between the read result and the value specified by OrData, and
1931 writes the result to the 32-bit MMIO register specified by Address. The value
1932 written to the MMIO register is returned. This function must guarantee that
1933 all MMIO read and write operations are serialized. Extra bits left in OrData
1936 If 32-bit MMIO register operations are not supported, then ASSERT().
1937 If Address is not aligned on a 32-bit boundary, then ASSERT().
1938 If StartBit is greater than 31, then ASSERT().
1939 If EndBit is greater than 31, then ASSERT().
1940 If EndBit is less than StartBit, then ASSERT().
1941 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1943 @param Address The MMIO register to write.
1944 @param StartBit The ordinal of the least significant bit in the bit field.
1946 @param EndBit The ordinal of the most significant bit in the bit field.
1948 @param OrData The value to OR with read value from the MMIO register.
1950 @return The value written back to the MMIO register.
1962 return MmioWrite32 (
1964 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1969 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1970 writes the result back to the bit field in the 32-bit MMIO register.
1972 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1973 between the read result and the value specified by AndData, and writes the
1974 result to the 32-bit MMIO register specified by Address. The value written to
1975 the MMIO register is returned. This function must guarantee that all MMIO
1976 read and write operations are serialized. Extra bits left in AndData are
1979 If 32-bit MMIO register operations are not supported, then ASSERT().
1980 If Address is not aligned on a 32-bit boundary, then ASSERT().
1981 If StartBit is greater than 31, then ASSERT().
1982 If EndBit is greater than 31, then ASSERT().
1983 If EndBit is less than StartBit, then ASSERT().
1984 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1986 @param Address The MMIO register to write.
1987 @param StartBit The ordinal of the least significant bit in the bit field.
1989 @param EndBit The ordinal of the most significant bit in the bit field.
1991 @param AndData The value to AND with read value from the MMIO register.
1993 @return The value written back to the MMIO register.
2005 return MmioWrite32 (
2007 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
2012 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2013 by a bitwise OR, and writes the result back to the bit field in the
2014 32-bit MMIO register.
2016 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2017 followed by a bitwise OR between the read result and the value
2018 specified by AndData, and writes the result to the 32-bit MMIO register
2019 specified by Address. The value written to the MMIO register is returned.
2020 This function must guarantee that all MMIO read and write operations are
2021 serialized. Extra bits left in both AndData and OrData are stripped.
2023 If 32-bit MMIO register operations are not supported, then ASSERT().
2024 If Address is not aligned on a 32-bit boundary, then ASSERT().
2025 If StartBit is greater than 31, then ASSERT().
2026 If EndBit is greater than 31, then ASSERT().
2027 If EndBit is less than StartBit, then ASSERT().
2028 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2029 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2031 @param Address The MMIO register to write.
2032 @param StartBit The ordinal of the least significant bit in the bit field.
2034 @param EndBit The ordinal of the most significant bit in the bit field.
2036 @param AndData The value to AND with read value from the MMIO register.
2037 @param OrData The value to OR with the result of the AND operation.
2039 @return The value written back to the MMIO register.
2044 MmioBitFieldAndThenOr32 (
2052 return MmioWrite32 (
2054 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2059 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2060 result back to the 64-bit MMIO register.
2062 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2063 OR between the read result and the value specified by OrData, and
2064 writes the result to the 64-bit MMIO register specified by Address. The value
2065 written to the MMIO register is returned. This function must guarantee that
2066 all MMIO read and write operations are serialized.
2068 If 64-bit MMIO register operations are not supported, then ASSERT().
2069 If Address is not aligned on a 64-bit boundary, then ASSERT().
2071 @param Address The MMIO register to write.
2072 @param OrData The value to OR with the read value from the MMIO register.
2074 @return The value written back to the MMIO register.
2084 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2088 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2089 back to the 64-bit MMIO register.
2091 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2092 between the read result and the value specified by AndData, and writes the
2093 result to the 64-bit MMIO register specified by Address. The value written to
2094 the MMIO register is returned. This function must guarantee that all MMIO
2095 read and write operations are serialized.
2097 If 64-bit MMIO register operations are not supported, then ASSERT().
2098 If Address is not aligned on a 64-bit boundary, then ASSERT().
2100 @param Address The MMIO register to write.
2101 @param AndData The value to AND with the read value from the MMIO register.
2103 @return The value written back to the MMIO register.
2113 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2117 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2118 OR, and writes the result back to the 64-bit MMIO register.
2120 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2121 between the read result and the value specified by AndData, performs a
2122 bitwise OR between the result of the AND operation and the value specified by
2123 OrData, and writes the result to the 64-bit MMIO register specified by
2124 Address. The value written to the MMIO register is returned. This function
2125 must guarantee that all MMIO read and write operations are serialized.
2127 If 64-bit MMIO register operations are not supported, then ASSERT().
2128 If Address is not aligned on a 64-bit boundary, then ASSERT().
2130 @param Address The MMIO register to write.
2131 @param AndData The value to AND with the read value from the MMIO register.
2132 @param OrData The value to OR with the result of the AND operation.
2134 @return The value written back to the MMIO register.
2145 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2149 Reads a bit field of a MMIO register.
2151 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2152 the StartBit and the EndBit. The value of the bit field is returned.
2154 If 64-bit MMIO register operations are not supported, then ASSERT().
2155 If Address is not aligned on a 64-bit boundary, then ASSERT().
2156 If StartBit is greater than 63, then ASSERT().
2157 If EndBit is greater than 63, then ASSERT().
2158 If EndBit is less than StartBit, then ASSERT().
2160 @param Address The MMIO register to read.
2161 @param StartBit The ordinal of the least significant bit in the bit field.
2163 @param EndBit The ordinal of the most significant bit in the bit field.
2166 @return The value read.
2171 MmioBitFieldRead64 (
2177 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2181 Writes a bit field to a MMIO register.
2183 Writes Value to the bit field of the MMIO register. The bit field is
2184 specified by the StartBit and the EndBit. All other bits in the destination
2185 MMIO register are preserved. The new value of the 64-bit register is returned.
2187 If 64-bit MMIO register operations are not supported, then ASSERT().
2188 If Address is not aligned on a 64-bit boundary, then ASSERT().
2189 If StartBit is greater than 63, then ASSERT().
2190 If EndBit is greater than 63, then ASSERT().
2191 If EndBit is less than StartBit, then ASSERT().
2192 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2194 @param Address The MMIO register to write.
2195 @param StartBit The ordinal of the least significant bit in the bit field.
2197 @param EndBit The ordinal of the most significant bit in the bit field.
2199 @param Value The new value of the bit field.
2201 @return The value written back to the MMIO register.
2206 MmioBitFieldWrite64 (
2213 return MmioWrite64 (
2215 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2220 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2221 writes the result back to the bit field in the 64-bit MMIO register.
2223 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2224 OR between the read result and the value specified by OrData, and
2225 writes the result to the 64-bit MMIO register specified by Address. The value
2226 written to the MMIO register is returned. This function must guarantee that
2227 all MMIO read and write operations are serialized. Extra bits left in OrData
2230 If 64-bit MMIO register operations are not supported, then ASSERT().
2231 If Address is not aligned on a 64-bit boundary, then ASSERT().
2232 If StartBit is greater than 63, then ASSERT().
2233 If EndBit is greater than 63, then ASSERT().
2234 If EndBit is less than StartBit, then ASSERT().
2235 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2237 @param Address The MMIO register to write.
2238 @param StartBit The ordinal of the least significant bit in the bit field.
2240 @param EndBit The ordinal of the most significant bit in the bit field.
2242 @param OrData The value to OR with read value from the MMIO register.
2244 @return The value written back to the MMIO register.
2256 return MmioWrite64 (
2258 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2263 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2264 writes the result back to the bit field in the 64-bit MMIO register.
2266 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2267 between the read result and the value specified by AndData, and writes the
2268 result to the 64-bit MMIO register specified by Address. The value written to
2269 the MMIO register is returned. This function must guarantee that all MMIO
2270 read and write operations are serialized. Extra bits left in AndData are
2273 If 64-bit MMIO register operations are not supported, then ASSERT().
2274 If Address is not aligned on a 64-bit boundary, then ASSERT().
2275 If StartBit is greater than 63, then ASSERT().
2276 If EndBit is greater than 63, then ASSERT().
2277 If EndBit is less than StartBit, then ASSERT().
2278 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2280 @param Address The MMIO register to write.
2281 @param StartBit The ordinal of the least significant bit in the bit field.
2283 @param EndBit The ordinal of the most significant bit in the bit field.
2285 @param AndData The value to AND with read value from the MMIO register.
2287 @return The value written back to the MMIO register.
2299 return MmioWrite64 (
2301 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2306 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2307 by a bitwise OR, and writes the result back to the bit field in the
2308 64-bit MMIO register.
2310 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2311 followed by a bitwise OR between the read result and the value
2312 specified by AndData, and writes the result to the 64-bit MMIO register
2313 specified by Address. The value written to the MMIO register is returned.
2314 This function must guarantee that all MMIO read and write operations are
2315 serialized. Extra bits left in both AndData and OrData are stripped.
2317 If 64-bit MMIO register operations are not supported, then ASSERT().
2318 If Address is not aligned on a 64-bit boundary, then ASSERT().
2319 If StartBit is greater than 63, then ASSERT().
2320 If EndBit is greater than 63, then ASSERT().
2321 If EndBit is less than StartBit, then ASSERT().
2322 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2323 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2325 @param Address The MMIO register to write.
2326 @param StartBit The ordinal of the least significant bit in the bit field.
2328 @param EndBit The ordinal of the most significant bit in the bit field.
2330 @param AndData The value to AND with read value from the MMIO register.
2331 @param OrData The value to OR with the result of the AND operation.
2333 @return The value written back to the MMIO register.
2338 MmioBitFieldAndThenOr64 (
2346 return MmioWrite64 (
2348 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)