]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/DxeIoLibCpuIo2/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) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include "DxeCpuIo2LibInternal.h"
15 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
16 result back to the 8-bit I/O port.
18 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
19 between the read result and the value specified by OrData, and writes the
20 result to the 8-bit I/O port specified by Port. The value written to the I/O
21 port is returned. This function must guarantee that all I/O read and write
22 operations are serialized.
24 If 8-bit I/O port operations are not supported, then ASSERT().
26 @param Port The I/O port to write.
27 @param OrData The value to OR with the read value from the I/O port.
29 @return The value written back to the I/O port.
39 return IoWrite8 (Port
, (UINT8
)(IoRead8 (Port
) | OrData
));
43 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
44 to the 8-bit I/O port.
46 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
47 the read result and the value specified by AndData, and writes the result to
48 the 8-bit I/O port specified by Port. The value written to the I/O port is
49 returned. This function must guarantee that all I/O read and write operations
52 If 8-bit I/O port operations are not supported, then ASSERT().
54 @param Port The I/O port to write.
55 @param AndData The value to AND with the read value from the I/O port.
57 @return The value written back to the I/O port.
67 return IoWrite8 (Port
, (UINT8
)(IoRead8 (Port
) & AndData
));
71 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
72 inclusive OR, and writes the result back to the 8-bit I/O port.
74 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
75 the read result and the value specified by AndData, performs a bitwise OR
76 between the result of the AND operation and the value specified by OrData,
77 and writes the result to the 8-bit I/O port specified by Port. The value
78 written to the I/O port is returned. This function must guarantee that all
79 I/O read and write operations are serialized.
81 If 8-bit I/O port operations are not supported, then ASSERT().
83 @param Port The I/O port to write.
84 @param AndData The value to AND with the read value from the I/O port.
85 @param OrData The value to OR with the result of the AND operation.
87 @return The value written back to the I/O port.
98 return IoWrite8 (Port
, (UINT8
)((IoRead8 (Port
) & AndData
) | OrData
));
102 Reads a bit field of an I/O register.
104 Reads the bit field in an 8-bit I/O register. The bit field is specified by
105 the StartBit and the EndBit. The value of the bit field is returned.
107 If 8-bit I/O port operations are not supported, then ASSERT().
108 If StartBit is greater than 7, then ASSERT().
109 If EndBit is greater than 7, then ASSERT().
110 If EndBit is less than StartBit, then ASSERT().
112 @param Port The I/O port to read.
113 @param StartBit The ordinal of the least significant bit in the bit field.
115 @param EndBit The ordinal of the most significant bit in the bit field.
118 @return The value read.
129 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
133 Writes a bit field to an I/O register.
135 Writes Value to the bit field of the I/O register. The bit field is specified
136 by the StartBit and the EndBit. All other bits in the destination I/O
137 register are preserved. The value written to the I/O port is returned. Extra
138 left bits in Value are stripped.
140 If 8-bit I/O port operations are not supported, then ASSERT().
141 If StartBit is greater than 7, then ASSERT().
142 If EndBit is greater than 7, then ASSERT().
143 If EndBit is less than StartBit, then ASSERT().
144 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
146 @param Port The I/O port to write.
147 @param StartBit The ordinal of the least significant bit in the bit field.
149 @param EndBit The ordinal of the most significant bit in the bit field.
151 @param Value The new value of the bit field.
153 @return The value written back to the I/O port.
167 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
172 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
173 result back to the bit field in the 8-bit port.
175 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
176 between the read result and the value specified by OrData, and writes the
177 result to the 8-bit I/O port specified by Port. The value written to the I/O
178 port is returned. This function must guarantee that all I/O read and write
179 operations are serialized. Extra left bits in OrData are stripped.
181 If 8-bit I/O port operations are not supported, then ASSERT().
182 If StartBit is greater than 7, then ASSERT().
183 If EndBit is greater than 7, then ASSERT().
184 If EndBit is less than StartBit, then ASSERT().
185 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
187 @param Port The I/O port to write.
188 @param StartBit The ordinal of the least significant bit in the bit field.
190 @param EndBit The ordinal of the most significant bit in the bit field.
192 @param OrData The value to OR with the read value from the I/O port.
194 @return The value written back to the I/O port.
208 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
213 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
214 result back to the bit field in the 8-bit port.
216 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
217 the read result and the value specified by AndData, and writes the result to
218 the 8-bit I/O port specified by Port. The value written to the I/O port is
219 returned. This function must guarantee that all I/O read and write operations
220 are serialized. Extra left bits in AndData are stripped.
222 If 8-bit I/O port operations are not supported, then ASSERT().
223 If StartBit is greater than 7, then ASSERT().
224 If EndBit is greater than 7, then ASSERT().
225 If EndBit is less than StartBit, then ASSERT().
226 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
228 @param Port The I/O port to write.
229 @param StartBit The ordinal of the least significant bit in the bit field.
231 @param EndBit The ordinal of the most significant bit in the bit field.
233 @param AndData The value to AND with the read value from the I/O port.
235 @return The value written back to the I/O port.
249 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
254 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
255 bitwise OR, and writes the result back to the bit field in the
258 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
259 by a bitwise OR between the read result and the value specified by
260 AndData, and writes the result to the 8-bit I/O port specified by Port. The
261 value written to the I/O port is returned. This function must guarantee that
262 all I/O read and write operations are serialized. Extra left bits in both
263 AndData and OrData are stripped.
265 If 8-bit I/O port operations are not supported, then ASSERT().
266 If StartBit is greater than 7, then ASSERT().
267 If EndBit is greater than 7, then ASSERT().
268 If EndBit is less than StartBit, then ASSERT().
269 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
270 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
272 @param Port The I/O port to write.
273 @param StartBit The ordinal of the least significant bit in the bit field.
275 @param EndBit The ordinal of the most significant bit in the bit field.
277 @param AndData The value to AND with the read value from the I/O port.
278 @param OrData The value to OR with the result of the AND operation.
280 @return The value written back to the I/O port.
285 IoBitFieldAndThenOr8 (
295 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
300 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
301 result back to the 16-bit I/O port.
303 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
304 between the read result and the value specified by OrData, and writes the
305 result to the 16-bit I/O port specified by Port. The value written to the I/O
306 port is returned. This function must guarantee that all I/O read and write
307 operations are serialized.
309 If 16-bit I/O port operations are not supported, then ASSERT().
311 @param Port The I/O port to write.
312 @param OrData The value to OR with the read value from the I/O port.
314 @return The value written back to the I/O port.
324 return IoWrite16 (Port
, (UINT16
)(IoRead16 (Port
) | OrData
));
328 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
329 to the 16-bit I/O port.
331 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
332 the read result and the value specified by AndData, and writes the result to
333 the 16-bit I/O port specified by Port. The value written to the I/O port is
334 returned. This function must guarantee that all I/O read and write operations
337 If 16-bit I/O port operations are not supported, then ASSERT().
339 @param Port The I/O port to write.
340 @param AndData The value to AND with the read value from the I/O port.
342 @return The value written back to the I/O port.
352 return IoWrite16 (Port
, (UINT16
)(IoRead16 (Port
) & AndData
));
356 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
357 inclusive OR, and writes the result back to the 16-bit I/O port.
359 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
360 the read result and the value specified by AndData, performs a bitwise OR
361 between the result of the AND operation and the value specified by OrData,
362 and writes the result to the 16-bit I/O port specified by Port. The value
363 written to the I/O port is returned. This function must guarantee that all
364 I/O read and write operations are serialized.
366 If 16-bit I/O port operations are not supported, then ASSERT().
368 @param Port The I/O port to write.
369 @param AndData The value to AND with the read value from the I/O port.
370 @param OrData The value to OR with the result of the AND operation.
372 @return The value written back to the I/O port.
383 return IoWrite16 (Port
, (UINT16
)((IoRead16 (Port
) & AndData
) | OrData
));
387 Reads a bit field of an I/O register.
389 Reads the bit field in a 16-bit I/O register. The bit field is specified by
390 the StartBit and the EndBit. The value of the bit field is returned.
392 If 16-bit I/O port operations are not supported, then ASSERT().
393 If StartBit is greater than 15, then ASSERT().
394 If EndBit is greater than 15, then ASSERT().
395 If EndBit is less than StartBit, then ASSERT().
397 @param Port The I/O port to read.
398 @param StartBit The ordinal of the least significant bit in the bit field.
400 @param EndBit The ordinal of the most significant bit in the bit field.
403 @return The value read.
414 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
418 Writes a bit field to an I/O register.
420 Writes Value to the bit field of the I/O register. The bit field is specified
421 by the StartBit and the EndBit. All other bits in the destination I/O
422 register are preserved. The value written to the I/O port is returned. Extra
423 left bits in Value are stripped.
425 If 16-bit I/O port operations are not supported, then ASSERT().
426 If StartBit is greater than 15, then ASSERT().
427 If EndBit is greater than 15, then ASSERT().
428 If EndBit is less than StartBit, then ASSERT().
429 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
431 @param Port The I/O port to write.
432 @param StartBit The ordinal of the least significant bit in the bit field.
434 @param EndBit The ordinal of the most significant bit in the bit field.
436 @param Value The new value of the bit field.
438 @return The value written back to the I/O port.
452 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
457 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
458 result back to the bit field in the 16-bit port.
460 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
461 between the read result and the value specified by OrData, and writes the
462 result to the 16-bit I/O port specified by Port. The value written to the I/O
463 port is returned. This function must guarantee that all I/O read and write
464 operations are serialized. Extra left bits in OrData are stripped.
466 If 16-bit I/O port operations are not supported, then ASSERT().
467 If StartBit is greater than 15, then ASSERT().
468 If EndBit is greater than 15, then ASSERT().
469 If EndBit is less than StartBit, then ASSERT().
470 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
472 @param Port The I/O port to write.
473 @param StartBit The ordinal of the least significant bit in the bit field.
475 @param EndBit The ordinal of the most significant bit in the bit field.
477 @param OrData The value to OR with the read value from the I/O port.
479 @return The value written back to the I/O port.
493 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
498 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
499 result back to the bit field in the 16-bit port.
501 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
502 the read result and the value specified by AndData, and writes the result to
503 the 16-bit I/O port specified by Port. The value written to the I/O port is
504 returned. This function must guarantee that all I/O read and write operations
505 are serialized. Extra left bits in AndData are stripped.
507 If 16-bit I/O port operations are not supported, then ASSERT().
508 If StartBit is greater than 15, then ASSERT().
509 If EndBit is greater than 15, then ASSERT().
510 If EndBit is less than StartBit, then ASSERT().
511 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
513 @param Port The I/O port to write.
514 @param StartBit The ordinal of the least significant bit in the bit field.
516 @param EndBit The ordinal of the most significant bit in the bit field.
518 @param AndData The value to AND with the read value from the I/O port.
520 @return The value written back to the I/O port.
534 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
539 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
540 bitwise OR, and writes the result back to the bit field in the
543 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
544 by a bitwise OR between the read result and the value specified by
545 AndData, and writes the result to the 16-bit I/O port specified by Port. The
546 value written to the I/O port is returned. This function must guarantee that
547 all I/O read and write operations are serialized. Extra left bits in both
548 AndData and OrData are stripped.
550 If 16-bit I/O port operations are not supported, then ASSERT().
551 If StartBit is greater than 15, then ASSERT().
552 If EndBit is greater than 15, then ASSERT().
553 If EndBit is less than StartBit, then ASSERT().
554 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
555 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
557 @param Port The I/O port to write.
558 @param StartBit The ordinal of the least significant bit in the bit field.
560 @param EndBit The ordinal of the most significant bit in the bit field.
562 @param AndData The value to AND with the read value from the I/O port.
563 @param OrData The value to OR with the result of the AND operation.
565 @return The value written back to the I/O port.
570 IoBitFieldAndThenOr16 (
580 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
585 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
586 result back to the 32-bit I/O port.
588 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
589 between the read result and the value specified by OrData, and writes the
590 result to the 32-bit I/O port specified by Port. The value written to the I/O
591 port is returned. This function must guarantee that all I/O read and write
592 operations are serialized.
594 If 32-bit I/O port operations are not supported, then ASSERT().
596 @param Port The I/O port to write.
597 @param OrData The value to OR with the read value from the I/O port.
599 @return The value written back to the I/O port.
609 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
613 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
614 to the 32-bit I/O port.
616 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
617 the read result and the value specified by AndData, and writes the result to
618 the 32-bit I/O port specified by Port. The value written to the I/O port is
619 returned. This function must guarantee that all I/O read and write operations
622 If 32-bit I/O port operations are not supported, then ASSERT().
624 @param Port The I/O port to write.
625 @param AndData The value to AND with the read value from the I/O port.
627 @return The value written back to the I/O port.
637 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
641 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
642 inclusive OR, and writes the result back to the 32-bit I/O port.
644 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
645 the read result and the value specified by AndData, performs a bitwise OR
646 between the result of the AND operation and the value specified by OrData,
647 and writes the result to the 32-bit I/O port specified by Port. The value
648 written to the I/O port is returned. This function must guarantee that all
649 I/O read and write operations are serialized.
651 If 32-bit I/O port operations are not supported, then ASSERT().
653 @param Port The I/O port to write.
654 @param AndData The value to AND with the read value from the I/O port.
655 @param OrData The value to OR with the result of the AND operation.
657 @return The value written back to the I/O port.
668 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
672 Reads a bit field of an I/O register.
674 Reads the bit field in a 32-bit I/O register. The bit field is specified by
675 the StartBit and the EndBit. The value of the bit field is returned.
677 If 32-bit I/O port operations are not supported, then ASSERT().
678 If StartBit is greater than 31, then ASSERT().
679 If EndBit is greater than 31, then ASSERT().
680 If EndBit is less than StartBit, then ASSERT().
682 @param Port The I/O port to read.
683 @param StartBit The ordinal of the least significant bit in the bit field.
685 @param EndBit The ordinal of the most significant bit in the bit field.
688 @return The value read.
699 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
703 Writes a bit field to an I/O register.
705 Writes Value to the bit field of the I/O register. The bit field is specified
706 by the StartBit and the EndBit. All other bits in the destination I/O
707 register are preserved. The value written to the I/O port is returned. Extra
708 left bits in Value are stripped.
710 If 32-bit I/O port operations are not supported, then ASSERT().
711 If StartBit is greater than 31, then ASSERT().
712 If EndBit is greater than 31, then ASSERT().
713 If EndBit is less than StartBit, then ASSERT().
714 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
716 @param Port The I/O port to write.
717 @param StartBit The ordinal of the least significant bit in the bit field.
719 @param EndBit The ordinal of the most significant bit in the bit field.
721 @param Value The new value of the bit field.
723 @return The value written back to the I/O port.
737 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
742 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
743 result back to the bit field in the 32-bit port.
745 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
746 between the read result and the value specified by OrData, and writes the
747 result to the 32-bit I/O port specified by Port. The value written to the I/O
748 port is returned. This function must guarantee that all I/O read and write
749 operations are serialized. Extra left bits in OrData are stripped.
751 If 32-bit I/O port operations are not supported, then ASSERT().
752 If StartBit is greater than 31, then ASSERT().
753 If EndBit is greater than 31, then ASSERT().
754 If EndBit is less than StartBit, then ASSERT().
755 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
757 @param Port The I/O port to write.
758 @param StartBit The ordinal of the least significant bit in the bit field.
760 @param EndBit The ordinal of the most significant bit in the bit field.
762 @param OrData The value to OR with the read value from the I/O port.
764 @return The value written back to the I/O port.
778 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
783 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
784 result back to the bit field in the 32-bit port.
786 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
787 the read result and the value specified by AndData, and writes the result to
788 the 32-bit I/O port specified by Port. The value written to the I/O port is
789 returned. This function must guarantee that all I/O read and write operations
790 are serialized. Extra left bits in AndData are stripped.
792 If 32-bit I/O port operations are not supported, then ASSERT().
793 If StartBit is greater than 31, then ASSERT().
794 If EndBit is greater than 31, then ASSERT().
795 If EndBit is less than StartBit, then ASSERT().
796 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
798 @param Port The I/O port to write.
799 @param StartBit The ordinal of the least significant bit in the bit field.
801 @param EndBit The ordinal of the most significant bit in the bit field.
803 @param AndData The value to AND with the read value from the I/O port.
805 @return The value written back to the I/O port.
819 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
824 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
825 bitwise OR, and writes the result back to the bit field in the
828 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
829 by a bitwise OR between the read result and the value specified by
830 AndData, and writes the result to the 32-bit I/O port specified by Port. The
831 value written to the I/O port is returned. This function must guarantee that
832 all I/O read and write operations are serialized. Extra left bits in both
833 AndData and OrData are stripped.
835 If 32-bit I/O port operations are not supported, then ASSERT().
836 If StartBit is greater than 31, then ASSERT().
837 If EndBit is greater than 31, then ASSERT().
838 If EndBit is less than StartBit, then ASSERT().
839 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
840 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
842 @param Port The I/O port to write.
843 @param StartBit The ordinal of the least significant bit in the bit field.
845 @param EndBit The ordinal of the most significant bit in the bit field.
847 @param AndData The value to AND with the read value from the I/O port.
848 @param OrData The value to OR with the result of the AND operation.
850 @return The value written back to the I/O port.
855 IoBitFieldAndThenOr32 (
865 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
870 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
871 result back to the 64-bit I/O port.
873 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
874 between the read result and the value specified by OrData, and writes the
875 result to the 64-bit I/O port specified by Port. The value written to the I/O
876 port is returned. This function must guarantee that all I/O read and write
877 operations are serialized.
879 If 64-bit I/O port operations are not supported, then ASSERT().
881 @param Port The I/O port to write.
882 @param OrData The value to OR with the read value from the I/O port.
884 @return The value written back to the I/O port.
894 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
898 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
899 to the 64-bit I/O port.
901 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
902 the read result and the value specified by AndData, and writes the result to
903 the 64-bit I/O port specified by Port. The value written to the I/O port is
904 returned. This function must guarantee that all I/O read and write operations
907 If 64-bit I/O port operations are not supported, then ASSERT().
909 @param Port The I/O port to write.
910 @param AndData The value to AND with the read value from the I/O port.
912 @return The value written back to the I/O port.
922 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
926 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
927 inclusive OR, and writes the result back to the 64-bit I/O port.
929 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
930 the read result and the value specified by AndData, performs a bitwise OR
931 between the result of the AND operation and the value specified by OrData,
932 and writes the result to the 64-bit I/O port specified by Port. The value
933 written to the I/O port is returned. This function must guarantee that all
934 I/O read and write operations are serialized.
936 If 64-bit I/O port operations are not supported, then ASSERT().
938 @param Port The I/O port to write.
939 @param AndData The value to AND with the read value from the I/O port.
940 @param OrData The value to OR with the result of the AND operation.
942 @return The value written back to the I/O port.
953 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
957 Reads a bit field of an I/O register.
959 Reads the bit field in a 64-bit I/O register. The bit field is specified by
960 the StartBit and the EndBit. The value of the bit field is returned.
962 If 64-bit I/O port operations are not supported, then ASSERT().
963 If StartBit is greater than 63, then ASSERT().
964 If EndBit is greater than 63, then ASSERT().
965 If EndBit is less than StartBit, then ASSERT().
967 @param Port The I/O port to read.
968 @param StartBit The ordinal of the least significant bit in the bit field.
970 @param EndBit The ordinal of the most significant bit in the bit field.
973 @return The value read.
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().
999 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1001 @param Port The I/O port to write.
1002 @param StartBit The ordinal of the least significant bit in the bit field.
1004 @param EndBit The ordinal of the most significant bit in the bit field.
1006 @param Value The new value of the bit field.
1008 @return The value written back to the I/O port.
1022 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1027 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1028 result back to the bit field in the 64-bit port.
1030 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1031 between the read result and the value specified by OrData, and writes the
1032 result to the 64-bit I/O port specified by Port. The value written to the I/O
1033 port is returned. This function must guarantee that all I/O read and write
1034 operations are serialized. Extra left bits in OrData are stripped.
1036 If 64-bit I/O port operations are not supported, then ASSERT().
1037 If StartBit is greater than 63, then ASSERT().
1038 If EndBit is greater than 63, then ASSERT().
1039 If EndBit is less than StartBit, then ASSERT().
1040 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1042 @param Port The I/O port to write.
1043 @param StartBit The ordinal of the least significant bit in the bit field.
1045 @param EndBit The ordinal of the most significant bit in the bit field.
1047 @param OrData The value to OR with the read value from the I/O port.
1049 @return The value written back to the I/O port.
1063 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1068 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1069 result back to the bit field in the 64-bit port.
1071 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1072 the read result and the value specified by AndData, and writes the result to
1073 the 64-bit I/O port specified by Port. The value written to the I/O port is
1074 returned. This function must guarantee that all I/O read and write operations
1075 are serialized. Extra left bits in AndData are stripped.
1077 If 64-bit I/O port operations are not supported, then ASSERT().
1078 If StartBit is greater than 63, then ASSERT().
1079 If EndBit is greater than 63, then ASSERT().
1080 If EndBit is less than StartBit, then ASSERT().
1081 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1083 @param Port The I/O port to write.
1084 @param StartBit The ordinal of the least significant bit in the bit field.
1086 @param EndBit The ordinal of the most significant bit in the bit field.
1088 @param AndData The value to AND with the read value from the I/O port.
1090 @return The value written back to the I/O port.
1104 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1109 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1110 bitwise OR, and writes the result back to the bit field in the
1113 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1114 by a bitwise OR between the read result and the value specified by
1115 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1116 value written to the I/O port is returned. This function must guarantee that
1117 all I/O read and write operations are serialized. Extra left bits in both
1118 AndData and OrData are stripped.
1120 If 64-bit I/O port operations are not supported, then ASSERT().
1121 If StartBit is greater than 63, then ASSERT().
1122 If EndBit is greater than 63, then ASSERT().
1123 If EndBit is less than StartBit, then ASSERT().
1124 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1125 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1127 @param Port The I/O port to write.
1128 @param StartBit The ordinal of the least significant bit in the bit field.
1130 @param EndBit The ordinal of the most significant bit in the bit field.
1132 @param AndData The value to AND with the read value from the I/O port.
1133 @param OrData The value to OR with the result of the AND operation.
1135 @return The value written back to the I/O port.
1140 IoBitFieldAndThenOr64 (
1150 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1155 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1156 result back to the 8-bit MMIO register.
1158 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1159 inclusive OR between the read result and the value specified by OrData, and
1160 writes the result to the 8-bit MMIO register specified by Address. The value
1161 written to the MMIO register is returned. This function must guarantee that
1162 all MMIO read and write operations are serialized.
1164 If 8-bit MMIO register operations are not supported, then ASSERT().
1166 @param Address The MMIO register to write.
1167 @param OrData The value to OR with the read value from the MMIO register.
1169 @return The value written back to the MMIO register.
1179 return MmioWrite8 (Address
, (UINT8
)(MmioRead8 (Address
) | OrData
));
1183 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1184 back to the 8-bit MMIO register.
1186 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1187 between the read result and the value specified by AndData, and writes the
1188 result to the 8-bit MMIO register specified by Address. The value written to
1189 the MMIO register is returned. This function must guarantee that all MMIO
1190 read and write operations are serialized.
1192 If 8-bit MMIO register operations are not supported, then ASSERT().
1194 @param Address The MMIO register to write.
1195 @param AndData The value to AND with the read value from the MMIO register.
1197 @return The value written back to the MMIO register.
1207 return MmioWrite8 (Address
, (UINT8
)(MmioRead8 (Address
) & AndData
));
1211 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1212 inclusive OR, and writes the result back to the 8-bit MMIO register.
1214 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1215 between the read result and the value specified by AndData, performs a
1216 bitwise OR between the result of the AND operation and the value specified by
1217 OrData, and writes the result to the 8-bit MMIO register specified by
1218 Address. The value written to the MMIO register is returned. This function
1219 must guarantee that all MMIO read and write operations are serialized.
1221 If 8-bit MMIO register operations are not supported, then ASSERT().
1224 @param Address The MMIO register to write.
1225 @param AndData The value to AND with the read value from the MMIO register.
1226 @param OrData The value to OR with the result of the AND operation.
1228 @return The value written back to the MMIO register.
1239 return MmioWrite8 (Address
, (UINT8
)((MmioRead8 (Address
) & AndData
) | OrData
));
1243 Reads a bit field of a MMIO register.
1245 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1246 the StartBit and the EndBit. The value of the bit field is returned.
1248 If 8-bit MMIO register operations are not supported, then ASSERT().
1249 If StartBit is greater than 7, then ASSERT().
1250 If EndBit is greater than 7, then ASSERT().
1251 If EndBit is less than StartBit, then ASSERT().
1253 @param Address The MMIO register to read.
1254 @param StartBit The ordinal of the least significant bit in the bit field.
1256 @param EndBit The ordinal of the most significant bit in the bit field.
1259 @return The value read.
1270 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1274 Writes a bit field to a MMIO register.
1276 Writes Value to the bit field of the MMIO register. The bit field is
1277 specified by the StartBit and the EndBit. All other bits in the destination
1278 MMIO register are preserved. The new value of the 8-bit register is returned.
1280 If 8-bit MMIO register operations are not supported, then ASSERT().
1281 If StartBit is greater than 7, then ASSERT().
1282 If EndBit is greater than 7, then ASSERT().
1283 If EndBit is less than StartBit, then ASSERT().
1284 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1286 @param Address The MMIO register to write.
1287 @param StartBit The ordinal of the least significant bit in the bit field.
1289 @param EndBit The ordinal of the most significant bit in the bit field.
1291 @param Value The new value of the bit field.
1293 @return The value written back to the MMIO register.
1298 MmioBitFieldWrite8 (
1307 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1312 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1313 writes the result back to the bit field in the 8-bit MMIO register.
1315 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1316 inclusive OR between the read result and the value specified by OrData, and
1317 writes the result to the 8-bit MMIO register specified by Address. The value
1318 written to the MMIO register is returned. This function must guarantee that
1319 all MMIO read and write operations are serialized. Extra left bits in OrData
1322 If 8-bit MMIO register operations are not supported, then ASSERT().
1323 If StartBit is greater than 7, then ASSERT().
1324 If EndBit is greater than 7, then ASSERT().
1325 If EndBit is less than StartBit, then ASSERT().
1326 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1328 @param Address The MMIO register to write.
1329 @param StartBit The ordinal of the least significant bit in the bit field.
1331 @param EndBit The ordinal of the most significant bit in the bit field.
1333 @param OrData The value to OR with read value from the MMIO register.
1335 @return The value written back to the MMIO register.
1349 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1354 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1355 writes the result back to the bit field in the 8-bit MMIO register.
1357 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1358 between the read result and the value specified by AndData, and writes the
1359 result to the 8-bit MMIO register specified by Address. The value written to
1360 the MMIO register is returned. This function must guarantee that all MMIO
1361 read and write operations are serialized. Extra left bits in AndData are
1364 If 8-bit MMIO register operations are not supported, then ASSERT().
1365 If StartBit is greater than 7, then ASSERT().
1366 If EndBit is greater than 7, then ASSERT().
1367 If EndBit is less than StartBit, then ASSERT().
1368 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1370 @param Address The MMIO register to write.
1371 @param StartBit The ordinal of the least significant bit in the bit field.
1373 @param EndBit The ordinal of the most significant bit in the bit field.
1375 @param AndData The value to AND with read value from the MMIO register.
1377 @return The value written back to the MMIO register.
1391 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1396 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1397 by a bitwise OR, and writes the result back to the bit field in the
1398 8-bit MMIO register.
1400 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1401 followed by a bitwise OR between the read result and the value
1402 specified by AndData, and writes the result to the 8-bit MMIO register
1403 specified by Address. The value written to the MMIO register is returned.
1404 This function must guarantee that all MMIO read and write operations are
1405 serialized. Extra left bits in both AndData and OrData are stripped.
1407 If 8-bit MMIO register operations are not supported, then ASSERT().
1408 If StartBit is greater than 7, then ASSERT().
1409 If EndBit is greater than 7, then ASSERT().
1410 If EndBit is less than StartBit, then ASSERT().
1411 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1412 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1414 @param Address The MMIO register to write.
1415 @param StartBit The ordinal of the least significant bit in the bit field.
1417 @param EndBit The ordinal of the most significant bit in the bit field.
1419 @param AndData The value to AND with read value from the MMIO register.
1420 @param OrData The value to OR with the result of the AND operation.
1422 @return The value written back to the MMIO register.
1427 MmioBitFieldAndThenOr8 (
1437 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1442 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1443 result back to the 16-bit MMIO register.
1445 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1446 inclusive OR between the read result and the value specified by OrData, and
1447 writes the result to the 16-bit MMIO register specified by Address. The value
1448 written to the MMIO register is returned. This function must guarantee that
1449 all MMIO read and write operations are serialized.
1451 If 16-bit MMIO register operations are not supported, then ASSERT().
1453 @param Address The MMIO register to write.
1454 @param OrData The value to OR with the read value from the MMIO register.
1456 @return The value written back to the MMIO register.
1466 return MmioWrite16 (Address
, (UINT16
)(MmioRead16 (Address
) | OrData
));
1470 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1471 back to the 16-bit MMIO register.
1473 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1474 between the read result and the value specified by AndData, and writes the
1475 result to the 16-bit MMIO register specified by Address. The value written to
1476 the MMIO register is returned. This function must guarantee that all MMIO
1477 read and write operations are serialized.
1479 If 16-bit MMIO register operations are not supported, then ASSERT().
1481 @param Address The MMIO register to write.
1482 @param AndData The value to AND with the read value from the MMIO register.
1484 @return The value written back to the MMIO register.
1494 return MmioWrite16 (Address
, (UINT16
)(MmioRead16 (Address
) & AndData
));
1498 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1499 inclusive OR, and writes the result back to the 16-bit MMIO register.
1501 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1502 between the read result and the value specified by AndData, performs a
1503 bitwise OR between the result of the AND operation and the value specified by
1504 OrData, and writes the result to the 16-bit MMIO register specified by
1505 Address. The value written to the MMIO register is returned. This function
1506 must guarantee that all MMIO read and write operations are serialized.
1508 If 16-bit MMIO register operations are not supported, then ASSERT().
1511 @param Address The MMIO register to write.
1512 @param AndData The value to AND with the read value from the MMIO register.
1513 @param OrData The value to OR with the result of the AND operation.
1515 @return The value written back to the MMIO register.
1526 return MmioWrite16 (Address
, (UINT16
)((MmioRead16 (Address
) & AndData
) | OrData
));
1530 Reads a bit field of a MMIO register.
1532 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1533 the StartBit and the EndBit. The value of the bit field is returned.
1535 If 16-bit MMIO register operations are not supported, then ASSERT().
1536 If StartBit is greater than 15, then ASSERT().
1537 If EndBit is greater than 15, then ASSERT().
1538 If EndBit is less than StartBit, then ASSERT().
1540 @param Address The MMIO register to read.
1541 @param StartBit The ordinal of the least significant bit in the bit field.
1543 @param EndBit The ordinal of the most significant bit in the bit field.
1546 @return The value read.
1551 MmioBitFieldRead16 (
1557 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1561 Writes a bit field to a MMIO register.
1563 Writes Value to the bit field of the MMIO register. The bit field is
1564 specified by the StartBit and the EndBit. All other bits in the destination
1565 MMIO register are preserved. The new value of the 16-bit register is returned.
1567 If 16-bit MMIO register operations are not supported, 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().
1571 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1573 @param Address The MMIO register to write.
1574 @param StartBit The ordinal of the least significant bit in the bit field.
1576 @param EndBit The ordinal of the most significant bit in the bit field.
1578 @param Value The new value of the bit field.
1580 @return The value written back to the MMIO register.
1585 MmioBitFieldWrite16 (
1592 return MmioWrite16 (
1594 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1599 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1600 writes the result back to the bit field in the 16-bit MMIO register.
1602 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1603 inclusive OR between the read result and the value specified by OrData, and
1604 writes the result to the 16-bit MMIO register specified by Address. The value
1605 written to the MMIO register is returned. This function must guarantee that
1606 all MMIO read and write operations are serialized. Extra left bits in OrData
1609 If 16-bit MMIO register operations are not supported, then ASSERT().
1610 If StartBit is greater than 15, then ASSERT().
1611 If EndBit is greater than 15, then ASSERT().
1612 If EndBit is less than StartBit, then ASSERT().
1613 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1615 @param Address The MMIO register to write.
1616 @param StartBit The ordinal of the least significant bit in the bit field.
1618 @param EndBit The ordinal of the most significant bit in the bit field.
1620 @param OrData The value to OR with read value from the MMIO register.
1622 @return The value written back to the MMIO register.
1634 return MmioWrite16 (
1636 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1641 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1642 writes the result back to the bit field in the 16-bit MMIO register.
1644 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1645 between the read result and the value specified by AndData, and writes the
1646 result to the 16-bit MMIO register specified by Address. The value written to
1647 the MMIO register is returned. This function must guarantee that all MMIO
1648 read and write operations are serialized. Extra left bits in AndData are
1651 If 16-bit MMIO register operations are not supported, then ASSERT().
1652 If StartBit is greater than 15, then ASSERT().
1653 If EndBit is greater than 15, then ASSERT().
1654 If EndBit is less than StartBit, then ASSERT().
1655 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1657 @param Address The MMIO register to write.
1658 @param StartBit The ordinal of the least significant bit in the bit field.
1660 @param EndBit The ordinal of the most significant bit in the bit field.
1662 @param AndData The value to AND with read value from the MMIO register.
1664 @return The value written back to the MMIO register.
1676 return MmioWrite16 (
1678 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1683 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1684 by a bitwise OR, and writes the result back to the bit field in the
1685 16-bit MMIO register.
1687 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1688 followed by a bitwise OR between the read result and the value
1689 specified by AndData, and writes the result to the 16-bit MMIO register
1690 specified by Address. The value written to the MMIO register is returned.
1691 This function must guarantee that all MMIO read and write operations are
1692 serialized. Extra left bits in both AndData and OrData are stripped.
1694 If 16-bit MMIO register operations are not supported, then ASSERT().
1695 If StartBit is greater than 15, then ASSERT().
1696 If EndBit is greater than 15, then ASSERT().
1697 If EndBit is less than StartBit, then ASSERT().
1698 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1699 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1701 @param Address The MMIO register to write.
1702 @param StartBit The ordinal of the least significant bit in the bit field.
1704 @param EndBit The ordinal of the most significant bit in the bit field.
1706 @param AndData The value to AND with read value from the MMIO register.
1707 @param OrData The value to OR with the result of the AND operation.
1709 @return The value written back to the MMIO register.
1714 MmioBitFieldAndThenOr16 (
1722 return MmioWrite16 (
1724 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1729 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1730 result back to the 32-bit MMIO register.
1732 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1733 inclusive OR between the read result and the value specified by OrData, and
1734 writes the result to the 32-bit MMIO register specified by Address. The value
1735 written to the MMIO register is returned. This function must guarantee that
1736 all MMIO read and write operations are serialized.
1738 If 32-bit MMIO register operations are not supported, then ASSERT().
1740 @param Address The MMIO register to write.
1741 @param OrData The value to OR with the read value from the MMIO register.
1743 @return The value written back to the MMIO register.
1753 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1757 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1758 back to the 32-bit MMIO register.
1760 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1761 between the read result and the value specified by AndData, and writes the
1762 result to the 32-bit MMIO register specified by Address. The value written to
1763 the MMIO register is returned. This function must guarantee that all MMIO
1764 read and write operations are serialized.
1766 If 32-bit MMIO register operations are not supported, then ASSERT().
1768 @param Address The MMIO register to write.
1769 @param AndData The value to AND with the read value from the MMIO register.
1771 @return The value written back to the MMIO register.
1781 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1785 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1786 inclusive OR, and writes the result back to the 32-bit MMIO register.
1788 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1789 between the read result and the value specified by AndData, performs a
1790 bitwise OR between the result of the AND operation and the value specified by
1791 OrData, and writes the result to the 32-bit MMIO register specified by
1792 Address. The value written to the MMIO register is returned. This function
1793 must guarantee that all MMIO read and write operations are serialized.
1795 If 32-bit MMIO register operations are not supported, then ASSERT().
1798 @param Address The MMIO register to write.
1799 @param AndData The value to AND with the read value from the MMIO register.
1800 @param OrData The value to OR with the result of the AND operation.
1802 @return The value written back to the MMIO register.
1813 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1817 Reads a bit field of a MMIO register.
1819 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1820 the StartBit and the EndBit. The value of the bit field is returned.
1822 If 32-bit MMIO register operations are not supported, then ASSERT().
1823 If StartBit is greater than 31, then ASSERT().
1824 If EndBit is greater than 31, then ASSERT().
1825 If EndBit is less than StartBit, then ASSERT().
1827 @param Address The MMIO register to read.
1828 @param StartBit The ordinal of the least significant bit in the bit field.
1830 @param EndBit The ordinal of the most significant bit in the bit field.
1833 @return The value read.
1838 MmioBitFieldRead32 (
1844 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1848 Writes a bit field to a MMIO register.
1850 Writes Value to the bit field of the MMIO register. The bit field is
1851 specified by the StartBit and the EndBit. All other bits in the destination
1852 MMIO register are preserved. The new value of the 32-bit register is returned.
1854 If 32-bit MMIO register operations are not supported, then ASSERT().
1855 If StartBit is greater than 31, then ASSERT().
1856 If EndBit is greater than 31, then ASSERT().
1857 If EndBit is less than StartBit, then ASSERT().
1858 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1860 @param Address The MMIO register to write.
1861 @param StartBit The ordinal of the least significant bit in the bit field.
1863 @param EndBit The ordinal of the most significant bit in the bit field.
1865 @param Value The new value of the bit field.
1867 @return The value written back to the MMIO register.
1872 MmioBitFieldWrite32 (
1879 return MmioWrite32 (
1881 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1886 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1887 writes the result back to the bit field in the 32-bit MMIO register.
1889 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1890 inclusive OR between the read result and the value specified by OrData, and
1891 writes the result to the 32-bit MMIO register specified by Address. The value
1892 written to the MMIO register is returned. This function must guarantee that
1893 all MMIO read and write operations are serialized. Extra left bits in OrData
1896 If 32-bit MMIO register operations are not supported, then ASSERT().
1897 If StartBit is greater than 31, then ASSERT().
1898 If EndBit is greater than 31, then ASSERT().
1899 If EndBit is less than StartBit, then ASSERT().
1900 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1902 @param Address The MMIO register to write.
1903 @param StartBit The ordinal of the least significant bit in the bit field.
1905 @param EndBit The ordinal of the most significant bit in the bit field.
1907 @param OrData The value to OR with read value from the MMIO register.
1909 @return The value written back to the MMIO register.
1921 return MmioWrite32 (
1923 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1928 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1929 writes the result back to the bit field in the 32-bit MMIO register.
1931 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1932 between the read result and the value specified by AndData, and writes the
1933 result to the 32-bit MMIO register specified by Address. The value written to
1934 the MMIO register is returned. This function must guarantee that all MMIO
1935 read and write operations are serialized. Extra left bits in AndData are
1938 If 32-bit MMIO register operations are not supported, then ASSERT().
1939 If StartBit is greater than 31, then ASSERT().
1940 If EndBit is greater than 31, then ASSERT().
1941 If EndBit is less than StartBit, then ASSERT().
1942 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1944 @param Address The MMIO register to write.
1945 @param StartBit The ordinal of the least significant bit in the bit field.
1947 @param EndBit The ordinal of the most significant bit in the bit field.
1949 @param AndData The value to AND with read value from the MMIO register.
1951 @return The value written back to the MMIO register.
1963 return MmioWrite32 (
1965 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1970 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1971 by a bitwise OR, and writes the result back to the bit field in the
1972 32-bit MMIO register.
1974 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1975 followed by a bitwise OR between the read result and the value
1976 specified by AndData, and writes the result to the 32-bit MMIO register
1977 specified by Address. The value written to the MMIO register is returned.
1978 This function must guarantee that all MMIO read and write operations are
1979 serialized. Extra left bits in both AndData and OrData are stripped.
1981 If 32-bit MMIO register operations are not supported, then ASSERT().
1982 If StartBit is greater than 31, then ASSERT().
1983 If EndBit is greater than 31, then ASSERT().
1984 If EndBit is less than StartBit, then ASSERT().
1985 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1986 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1988 @param Address The MMIO register to write.
1989 @param StartBit The ordinal of the least significant bit in the bit field.
1991 @param EndBit The ordinal of the most significant bit in the bit field.
1993 @param AndData The value to AND with read value from the MMIO register.
1994 @param OrData The value to OR with the result of the AND operation.
1996 @return The value written back to the MMIO register.
2001 MmioBitFieldAndThenOr32 (
2009 return MmioWrite32 (
2011 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2016 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2017 result back to the 64-bit MMIO register.
2019 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2020 inclusive OR between the read result and the value specified by OrData, and
2021 writes the result to the 64-bit MMIO register specified by Address. The value
2022 written to the MMIO register is returned. This function must guarantee that
2023 all MMIO read and write operations are serialized.
2025 If 64-bit MMIO register operations are not supported, then ASSERT().
2027 @param Address The MMIO register to write.
2028 @param OrData The value to OR with the read value from the MMIO register.
2030 @return The value written back to the MMIO register.
2040 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2044 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2045 back to the 64-bit MMIO register.
2047 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2048 between the read result and the value specified by AndData, and writes the
2049 result to the 64-bit MMIO register specified by Address. The value written to
2050 the MMIO register is returned. This function must guarantee that all MMIO
2051 read and write operations are serialized.
2053 If 64-bit MMIO register operations are not supported, then ASSERT().
2055 @param Address The MMIO register to write.
2056 @param AndData The value to AND with the read value from the MMIO register.
2058 @return The value written back to the MMIO register.
2068 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2072 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2073 inclusive OR, and writes the result back to the 64-bit MMIO register.
2075 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2076 between the read result and the value specified by AndData, performs a
2077 bitwise OR between the result of the AND operation and the value specified by
2078 OrData, and writes the result to the 64-bit MMIO register specified by
2079 Address. The value written to the MMIO register is returned. This function
2080 must guarantee that all MMIO read and write operations are serialized.
2082 If 64-bit MMIO register operations are not supported, then ASSERT().
2085 @param Address The MMIO register to write.
2086 @param AndData The value to AND with the read value from the MMIO register.
2087 @param OrData The value to OR with the result of the AND operation.
2089 @return The value written back to the MMIO register.
2100 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2104 Reads a bit field of a MMIO register.
2106 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2107 the StartBit and the EndBit. The value of the bit field is returned.
2109 If 64-bit MMIO register operations are not supported, then ASSERT().
2110 If StartBit is greater than 63, then ASSERT().
2111 If EndBit is greater than 63, then ASSERT().
2112 If EndBit is less than StartBit, then ASSERT().
2114 @param Address The MMIO register to read.
2115 @param StartBit The ordinal of the least significant bit in the bit field.
2117 @param EndBit The ordinal of the most significant bit in the bit field.
2120 @return The value read.
2125 MmioBitFieldRead64 (
2131 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2135 Writes a bit field to a MMIO register.
2137 Writes Value to the bit field of the MMIO register. The bit field is
2138 specified by the StartBit and the EndBit. All other bits in the destination
2139 MMIO register are preserved. The new value of the 64-bit register is returned.
2141 If 64-bit MMIO register operations are not supported, then ASSERT().
2142 If StartBit is greater than 63, then ASSERT().
2143 If EndBit is greater than 63, then ASSERT().
2144 If EndBit is less than StartBit, then ASSERT().
2145 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2147 @param Address The MMIO register to write.
2148 @param StartBit The ordinal of the least significant bit in the bit field.
2150 @param EndBit The ordinal of the most significant bit in the bit field.
2152 @param Value The new value of the bit field.
2154 @return The value written back to the MMIO register.
2159 MmioBitFieldWrite64 (
2166 return MmioWrite64 (
2168 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2173 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2174 writes the result back to the bit field in the 64-bit MMIO register.
2176 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2177 inclusive OR between the read result and the value specified by OrData, and
2178 writes the result to the 64-bit MMIO register specified by Address. The value
2179 written to the MMIO register is returned. This function must guarantee that
2180 all MMIO read and write operations are serialized. Extra left bits in OrData
2183 If 64-bit MMIO register operations are not supported, then ASSERT().
2184 If StartBit is greater than 63, then ASSERT().
2185 If EndBit is greater than 63, then ASSERT().
2186 If EndBit is less than StartBit, then ASSERT().
2187 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2189 @param Address The MMIO register to write.
2190 @param StartBit The ordinal of the least significant bit in the bit field.
2192 @param EndBit The ordinal of the most significant bit in the bit field.
2194 @param OrData The value to OR with read value from the MMIO register.
2196 @return The value written back to the MMIO register.
2208 return MmioWrite64 (
2210 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2215 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2216 writes the result back to the bit field in the 64-bit MMIO register.
2218 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2219 between the read result and the value specified by AndData, and writes the
2220 result to the 64-bit MMIO register specified by Address. The value written to
2221 the MMIO register is returned. This function must guarantee that all MMIO
2222 read and write operations are serialized. Extra left bits in AndData are
2225 If 64-bit MMIO register operations are not supported, then ASSERT().
2226 If StartBit is greater than 63, then ASSERT().
2227 If EndBit is greater than 63, then ASSERT().
2228 If EndBit is less than StartBit, then ASSERT().
2229 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2231 @param Address The MMIO register to write.
2232 @param StartBit The ordinal of the least significant bit in the bit field.
2234 @param EndBit The ordinal of the most significant bit in the bit field.
2236 @param AndData The value to AND with read value from the MMIO register.
2238 @return The value written back to the MMIO register.
2250 return MmioWrite64 (
2252 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2257 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2258 by a bitwise OR, and writes the result back to the bit field in the
2259 64-bit MMIO register.
2261 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2262 followed by a bitwise OR between the read result and the value
2263 specified by AndData, and writes the result to the 64-bit MMIO register
2264 specified by Address. The value written to the MMIO register is returned.
2265 This function must guarantee that all MMIO read and write operations are
2266 serialized. Extra left bits in both AndData and OrData are stripped.
2268 If 64-bit MMIO register operations are not supported, then ASSERT().
2269 If StartBit is greater than 63, then ASSERT().
2270 If EndBit is greater than 63, then ASSERT().
2271 If EndBit is less than StartBit, then ASSERT().
2272 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2273 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2275 @param Address The MMIO register to write.
2276 @param StartBit The ordinal of the least significant bit in the bit field.
2278 @param EndBit The ordinal of the most significant bit in the bit field.
2280 @param AndData The value to AND with read value from the MMIO register.
2281 @param OrData The value to OR with the result of the AND operation.
2283 @return The value written back to the MMIO register.
2288 MmioBitFieldAndThenOr64 (
2296 return MmioWrite64 (
2298 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)