]>
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
13 #include "DxeCpuIo2LibInternal.h"
16 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
17 result back to the 8-bit I/O port.
19 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
20 between the read result and the value specified by OrData, and writes the
21 result to the 8-bit I/O port specified by Port. The value written to the I/O
22 port is returned. This function must guarantee that all I/O read and write
23 operations are serialized.
25 If 8-bit I/O port operations are not supported, then ASSERT().
27 @param Port The I/O port to write.
28 @param OrData The value to OR with the read value from the I/O port.
30 @return The value written back to the I/O port.
40 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
44 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
45 to the 8-bit I/O port.
47 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
48 the read result and the value specified by AndData, and writes the result to
49 the 8-bit I/O port specified by Port. The value written to the I/O port is
50 returned. This function must guarantee that all I/O read and write operations
53 If 8-bit I/O port operations are not supported, then ASSERT().
55 @param Port The I/O port to write.
56 @param AndData The value to AND with the read value from the I/O port.
58 @return The value written back to the I/O port.
68 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
72 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
73 inclusive OR, and writes the result back to the 8-bit I/O port.
75 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
76 the read result and the value specified by AndData, performs a bitwise OR
77 between the result of the AND operation and the value specified by OrData,
78 and writes the result to the 8-bit I/O port specified by Port. The value
79 written to the I/O port is returned. This function must guarantee that all
80 I/O read and write operations are serialized.
82 If 8-bit I/O port operations are not supported, then ASSERT().
84 @param Port The I/O port to write.
85 @param AndData The value to AND with the read value from the I/O port.
86 @param OrData The value to OR with the result of the AND operation.
88 @return The value written back to the I/O port.
99 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
103 Reads a bit field of an I/O register.
105 Reads the bit field in an 8-bit I/O register. The bit field is specified by
106 the StartBit and the EndBit. The value of the bit field is returned.
108 If 8-bit I/O port operations are not supported, then ASSERT().
109 If StartBit is greater than 7, then ASSERT().
110 If EndBit is greater than 7, then ASSERT().
111 If EndBit is less than StartBit, then ASSERT().
113 @param Port The I/O port to read.
114 @param StartBit The ordinal of the least significant bit in the bit field.
116 @param EndBit The ordinal of the most significant bit in the bit field.
119 @return The value read.
130 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
134 Writes a bit field to an I/O register.
136 Writes Value to the bit field of the I/O register. The bit field is specified
137 by the StartBit and the EndBit. All other bits in the destination I/O
138 register are preserved. The value written to the I/O port is returned. Extra
139 left bits in Value are stripped.
141 If 8-bit I/O port operations are not supported, then ASSERT().
142 If StartBit is greater than 7, then ASSERT().
143 If EndBit is greater than 7, then ASSERT().
144 If EndBit is less than StartBit, then ASSERT().
145 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
147 @param Port The I/O port to write.
148 @param StartBit The ordinal of the least significant bit in the bit field.
150 @param EndBit The ordinal of the most significant bit in the bit field.
152 @param Value The new value of the bit field.
154 @return The value written back to the I/O port.
168 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
173 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
174 result back to the bit field in the 8-bit port.
176 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
177 between the read result and the value specified by OrData, and writes the
178 result to the 8-bit I/O port specified by Port. The value written to the I/O
179 port is returned. This function must guarantee that all I/O read and write
180 operations are serialized. Extra left bits in OrData are stripped.
182 If 8-bit I/O port operations are not supported, then ASSERT().
183 If StartBit is greater than 7, then ASSERT().
184 If EndBit is greater than 7, then ASSERT().
185 If EndBit is less than StartBit, then ASSERT().
186 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
188 @param Port The I/O port to write.
189 @param StartBit The ordinal of the least significant bit in the bit field.
191 @param EndBit The ordinal of the most significant bit in the bit field.
193 @param OrData The value to OR with the read value from the I/O port.
195 @return The value written back to the I/O port.
209 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
214 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
215 result back to the bit field in the 8-bit port.
217 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
218 the read result and the value specified by AndData, and writes the result to
219 the 8-bit I/O port specified by Port. The value written to the I/O port is
220 returned. This function must guarantee that all I/O read and write operations
221 are serialized. Extra left bits in AndData are stripped.
223 If 8-bit I/O port operations are not supported, then ASSERT().
224 If StartBit is greater than 7, then ASSERT().
225 If EndBit is greater than 7, then ASSERT().
226 If EndBit is less than StartBit, then ASSERT().
227 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
229 @param Port The I/O port to write.
230 @param StartBit The ordinal of the least significant bit in the bit field.
232 @param EndBit The ordinal of the most significant bit in the bit field.
234 @param AndData The value to AND with the read value from the I/O port.
236 @return The value written back to the I/O port.
250 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
255 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
256 bitwise OR, and writes the result back to the bit field in the
259 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
260 by a bitwise OR between the read result and the value specified by
261 AndData, and writes the result to the 8-bit I/O port specified by Port. The
262 value written to the I/O port is returned. This function must guarantee that
263 all I/O read and write operations are serialized. Extra left bits in both
264 AndData and OrData are stripped.
266 If 8-bit I/O port operations are not supported, then ASSERT().
267 If StartBit is greater than 7, then ASSERT().
268 If EndBit is greater than 7, then ASSERT().
269 If EndBit is less than StartBit, then ASSERT().
270 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
271 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
273 @param Port The I/O port to write.
274 @param StartBit The ordinal of the least significant bit in the bit field.
276 @param EndBit The ordinal of the most significant bit in the bit field.
278 @param AndData The value to AND with the read value from the I/O port.
279 @param OrData The value to OR with the result of the AND operation.
281 @return The value written back to the I/O port.
286 IoBitFieldAndThenOr8 (
296 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
301 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
302 result back to the 16-bit I/O port.
304 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
305 between the read result and the value specified by OrData, and writes the
306 result to the 16-bit I/O port specified by Port. The value written to the I/O
307 port is returned. This function must guarantee that all I/O read and write
308 operations are serialized.
310 If 16-bit I/O port operations are not supported, then ASSERT().
312 @param Port The I/O port to write.
313 @param OrData The value to OR with the read value from the I/O port.
315 @return The value written back to the I/O port.
325 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
329 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
330 to the 16-bit I/O port.
332 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
333 the read result and the value specified by AndData, and writes the result to
334 the 16-bit I/O port specified by Port. The value written to the I/O port is
335 returned. This function must guarantee that all I/O read and write operations
338 If 16-bit I/O port operations are not supported, then ASSERT().
340 @param Port The I/O port to write.
341 @param AndData The value to AND with the read value from the I/O port.
343 @return The value written back to the I/O port.
353 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
357 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
358 inclusive OR, and writes the result back to the 16-bit I/O port.
360 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
361 the read result and the value specified by AndData, performs a bitwise OR
362 between the result of the AND operation and the value specified by OrData,
363 and writes the result to the 16-bit I/O port specified by Port. The value
364 written to the I/O port is returned. This function must guarantee that all
365 I/O read and write operations are serialized.
367 If 16-bit I/O port operations are not supported, then ASSERT().
369 @param Port The I/O port to write.
370 @param AndData The value to AND with the read value from the I/O port.
371 @param OrData The value to OR with the result of the AND operation.
373 @return The value written back to the I/O port.
384 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
388 Reads a bit field of an I/O register.
390 Reads the bit field in a 16-bit I/O register. The bit field is specified by
391 the StartBit and the EndBit. The value of the bit field is returned.
393 If 16-bit I/O port operations are not supported, then ASSERT().
394 If StartBit is greater than 15, then ASSERT().
395 If EndBit is greater than 15, then ASSERT().
396 If EndBit is less than StartBit, then ASSERT().
398 @param Port The I/O port to read.
399 @param StartBit The ordinal of the least significant bit in the bit field.
401 @param EndBit The ordinal of the most significant bit in the bit field.
404 @return The value read.
415 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
419 Writes a bit field to an I/O register.
421 Writes Value to the bit field of the I/O register. The bit field is specified
422 by the StartBit and the EndBit. All other bits in the destination I/O
423 register are preserved. The value written to the I/O port is returned. Extra
424 left bits in Value are stripped.
426 If 16-bit I/O port operations are not supported, then ASSERT().
427 If StartBit is greater than 15, then ASSERT().
428 If EndBit is greater than 15, then ASSERT().
429 If EndBit is less than StartBit, then ASSERT().
430 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
432 @param Port The I/O port to write.
433 @param StartBit The ordinal of the least significant bit in the bit field.
435 @param EndBit The ordinal of the most significant bit in the bit field.
437 @param Value The new value of the bit field.
439 @return The value written back to the I/O port.
453 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
458 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
459 result back to the bit field in the 16-bit port.
461 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
462 between the read result and the value specified by OrData, and writes the
463 result to the 16-bit I/O port specified by Port. The value written to the I/O
464 port is returned. This function must guarantee that all I/O read and write
465 operations are serialized. Extra left bits in OrData are stripped.
467 If 16-bit I/O port operations are not supported, then ASSERT().
468 If StartBit is greater than 15, then ASSERT().
469 If EndBit is greater than 15, then ASSERT().
470 If EndBit is less than StartBit, then ASSERT().
471 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
473 @param Port The I/O port to write.
474 @param StartBit The ordinal of the least significant bit in the bit field.
476 @param EndBit The ordinal of the most significant bit in the bit field.
478 @param OrData The value to OR with the read value from the I/O port.
480 @return The value written back to the I/O port.
494 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
499 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
500 result back to the bit field in the 16-bit port.
502 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
503 the read result and the value specified by AndData, and writes the result to
504 the 16-bit I/O port specified by Port. The value written to the I/O port is
505 returned. This function must guarantee that all I/O read and write operations
506 are serialized. Extra left bits in AndData are stripped.
508 If 16-bit I/O port operations are not supported, then ASSERT().
509 If StartBit is greater than 15, then ASSERT().
510 If EndBit is greater than 15, then ASSERT().
511 If EndBit is less than StartBit, then ASSERT().
512 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
514 @param Port The I/O port to write.
515 @param StartBit The ordinal of the least significant bit in the bit field.
517 @param EndBit The ordinal of the most significant bit in the bit field.
519 @param AndData The value to AND with the read value from the I/O port.
521 @return The value written back to the I/O port.
535 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
540 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
541 bitwise OR, and writes the result back to the bit field in the
544 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
545 by a bitwise OR between the read result and the value specified by
546 AndData, and writes the result to the 16-bit I/O port specified by Port. The
547 value written to the I/O port is returned. This function must guarantee that
548 all I/O read and write operations are serialized. Extra left bits in both
549 AndData and OrData are stripped.
551 If 16-bit I/O port operations are not supported, then ASSERT().
552 If StartBit is greater than 15, then ASSERT().
553 If EndBit is greater than 15, then ASSERT().
554 If EndBit is less than StartBit, then ASSERT().
555 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
556 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
558 @param Port The I/O port to write.
559 @param StartBit The ordinal of the least significant bit in the bit field.
561 @param EndBit The ordinal of the most significant bit in the bit field.
563 @param AndData The value to AND with the read value from the I/O port.
564 @param OrData The value to OR with the result of the AND operation.
566 @return The value written back to the I/O port.
571 IoBitFieldAndThenOr16 (
581 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
586 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
587 result back to the 32-bit I/O port.
589 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
590 between the read result and the value specified by OrData, and writes the
591 result to the 32-bit I/O port specified by Port. The value written to the I/O
592 port is returned. This function must guarantee that all I/O read and write
593 operations are serialized.
595 If 32-bit I/O port operations are not supported, then ASSERT().
597 @param Port The I/O port to write.
598 @param OrData The value to OR with the read value from the I/O port.
600 @return The value written back to the I/O port.
610 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
614 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
615 to the 32-bit I/O port.
617 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
618 the read result and the value specified by AndData, and writes the result to
619 the 32-bit I/O port specified by Port. The value written to the I/O port is
620 returned. This function must guarantee that all I/O read and write operations
623 If 32-bit I/O port operations are not supported, then ASSERT().
625 @param Port The I/O port to write.
626 @param AndData The value to AND with the read value from the I/O port.
628 @return The value written back to the I/O port.
638 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
642 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
643 inclusive OR, and writes the result back to the 32-bit I/O port.
645 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
646 the read result and the value specified by AndData, performs a bitwise OR
647 between the result of the AND operation and the value specified by OrData,
648 and writes the result to the 32-bit I/O port specified by Port. The value
649 written to the I/O port is returned. This function must guarantee that all
650 I/O read and write operations are serialized.
652 If 32-bit I/O port operations are not supported, then ASSERT().
654 @param Port The I/O port to write.
655 @param AndData The value to AND with the read value from the I/O port.
656 @param OrData The value to OR with the result of the AND operation.
658 @return The value written back to the I/O port.
669 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
673 Reads a bit field of an I/O register.
675 Reads the bit field in a 32-bit I/O register. The bit field is specified by
676 the StartBit and the EndBit. The value of the bit field is returned.
678 If 32-bit I/O port operations are not supported, then ASSERT().
679 If StartBit is greater than 31, then ASSERT().
680 If EndBit is greater than 31, then ASSERT().
681 If EndBit is less than StartBit, then ASSERT().
683 @param Port The I/O port to read.
684 @param StartBit The ordinal of the least significant bit in the bit field.
686 @param EndBit The ordinal of the most significant bit in the bit field.
689 @return The value read.
700 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
704 Writes a bit field to an I/O register.
706 Writes Value to the bit field of the I/O register. The bit field is specified
707 by the StartBit and the EndBit. All other bits in the destination I/O
708 register are preserved. The value written to the I/O port is returned. Extra
709 left bits in Value are stripped.
711 If 32-bit I/O port operations are not supported, then ASSERT().
712 If StartBit is greater than 31, then ASSERT().
713 If EndBit is greater than 31, then ASSERT().
714 If EndBit is less than StartBit, then ASSERT().
715 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
717 @param Port The I/O port to write.
718 @param StartBit The ordinal of the least significant bit in the bit field.
720 @param EndBit The ordinal of the most significant bit in the bit field.
722 @param Value The new value of the bit field.
724 @return The value written back to the I/O port.
738 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
743 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
744 result back to the bit field in the 32-bit port.
746 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
747 between the read result and the value specified by OrData, and writes the
748 result to the 32-bit I/O port specified by Port. The value written to the I/O
749 port is returned. This function must guarantee that all I/O read and write
750 operations are serialized. Extra left bits in OrData are stripped.
752 If 32-bit I/O port operations are not supported, then ASSERT().
753 If StartBit is greater than 31, then ASSERT().
754 If EndBit is greater than 31, then ASSERT().
755 If EndBit is less than StartBit, then ASSERT().
756 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
758 @param Port The I/O port to write.
759 @param StartBit The ordinal of the least significant bit in the bit field.
761 @param EndBit The ordinal of the most significant bit in the bit field.
763 @param OrData The value to OR with the read value from the I/O port.
765 @return The value written back to the I/O port.
779 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
784 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
785 result back to the bit field in the 32-bit port.
787 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
788 the read result and the value specified by AndData, and writes the result to
789 the 32-bit I/O port specified by Port. The value written to the I/O port is
790 returned. This function must guarantee that all I/O read and write operations
791 are serialized. Extra left bits in AndData are stripped.
793 If 32-bit I/O port operations are not supported, then ASSERT().
794 If StartBit is greater than 31, then ASSERT().
795 If EndBit is greater than 31, then ASSERT().
796 If EndBit is less than StartBit, then ASSERT().
797 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
799 @param Port The I/O port to write.
800 @param StartBit The ordinal of the least significant bit in the bit field.
802 @param EndBit The ordinal of the most significant bit in the bit field.
804 @param AndData The value to AND with the read value from the I/O port.
806 @return The value written back to the I/O port.
820 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
825 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
826 bitwise OR, and writes the result back to the bit field in the
829 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
830 by a bitwise OR between the read result and the value specified by
831 AndData, and writes the result to the 32-bit I/O port specified by Port. The
832 value written to the I/O port is returned. This function must guarantee that
833 all I/O read and write operations are serialized. Extra left bits in both
834 AndData and OrData are stripped.
836 If 32-bit I/O port operations are not supported, then ASSERT().
837 If StartBit is greater than 31, then ASSERT().
838 If EndBit is greater than 31, then ASSERT().
839 If EndBit is less than StartBit, then ASSERT().
840 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
841 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
843 @param Port The I/O port to write.
844 @param StartBit The ordinal of the least significant bit in the bit field.
846 @param EndBit The ordinal of the most significant bit in the bit field.
848 @param AndData The value to AND with the read value from the I/O port.
849 @param OrData The value to OR with the result of the AND operation.
851 @return The value written back to the I/O port.
856 IoBitFieldAndThenOr32 (
866 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
871 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
872 result back to the 64-bit I/O port.
874 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
875 between the read result and the value specified by OrData, and writes the
876 result to the 64-bit I/O port specified by Port. The value written to the I/O
877 port is returned. This function must guarantee that all I/O read and write
878 operations are serialized.
880 If 64-bit I/O port operations are not supported, then ASSERT().
882 @param Port The I/O port to write.
883 @param OrData The value to OR with the read value from the I/O port.
885 @return The value written back to the I/O port.
895 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
899 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
900 to the 64-bit I/O port.
902 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
903 the read result and the value specified by AndData, and writes the result to
904 the 64-bit I/O port specified by Port. The value written to the I/O port is
905 returned. This function must guarantee that all I/O read and write operations
908 If 64-bit I/O port operations are not supported, then ASSERT().
910 @param Port The I/O port to write.
911 @param AndData The value to AND with the read value from the I/O port.
913 @return The value written back to the I/O port.
923 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
927 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
928 inclusive OR, and writes the result back to the 64-bit I/O port.
930 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
931 the read result and the value specified by AndData, performs a bitwise OR
932 between the result of the AND operation and the value specified by OrData,
933 and writes the result to the 64-bit I/O port specified by Port. The value
934 written to the I/O port is returned. This function must guarantee that all
935 I/O read and write operations are serialized.
937 If 64-bit I/O port operations are not supported, then ASSERT().
939 @param Port The I/O port to write.
940 @param AndData The value to AND with the read value from the I/O port.
941 @param OrData The value to OR with the result of the AND operation.
943 @return The value written back to the I/O port.
954 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
958 Reads a bit field of an I/O register.
960 Reads the bit field in a 64-bit I/O register. The bit field is specified by
961 the StartBit and the EndBit. The value of the bit field is returned.
963 If 64-bit I/O port operations are not supported, then ASSERT().
964 If StartBit is greater than 63, then ASSERT().
965 If EndBit is greater than 63, then ASSERT().
966 If EndBit is less than StartBit, then ASSERT().
968 @param Port The I/O port to read.
969 @param StartBit The ordinal of the least significant bit in the bit field.
971 @param EndBit The ordinal of the most significant bit in the bit field.
974 @return The value read.
985 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
989 Writes a bit field to an I/O register.
991 Writes Value to the bit field of the I/O register. The bit field is specified
992 by the StartBit and the EndBit. All other bits in the destination I/O
993 register are preserved. The value written to the I/O port is returned. Extra
994 left bits in Value are stripped.
996 If 64-bit I/O port operations are not supported, then ASSERT().
997 If StartBit is greater than 63, then ASSERT().
998 If EndBit is greater than 63, then ASSERT().
999 If EndBit is less than StartBit, then ASSERT().
1000 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1002 @param Port The I/O port to write.
1003 @param StartBit The ordinal of the least significant bit in the bit field.
1005 @param EndBit The ordinal of the most significant bit in the bit field.
1007 @param Value The new value of the bit field.
1009 @return The value written back to the I/O port.
1023 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1028 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1029 result back to the bit field in the 64-bit port.
1031 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1032 between the read result and the value specified by OrData, and writes the
1033 result to the 64-bit I/O port specified by Port. The value written to the I/O
1034 port is returned. This function must guarantee that all I/O read and write
1035 operations are serialized. Extra left bits in OrData are stripped.
1037 If 64-bit I/O port operations are not supported, then ASSERT().
1038 If StartBit is greater than 63, then ASSERT().
1039 If EndBit is greater than 63, then ASSERT().
1040 If EndBit is less than StartBit, then ASSERT().
1041 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1043 @param Port The I/O port to write.
1044 @param StartBit The ordinal of the least significant bit in the bit field.
1046 @param EndBit The ordinal of the most significant bit in the bit field.
1048 @param OrData The value to OR with the read value from the I/O port.
1050 @return The value written back to the I/O port.
1064 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1069 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1070 result back to the bit field in the 64-bit port.
1072 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1073 the read result and the value specified by AndData, and writes the result to
1074 the 64-bit I/O port specified by Port. The value written to the I/O port is
1075 returned. This function must guarantee that all I/O read and write operations
1076 are serialized. Extra left bits in AndData are stripped.
1078 If 64-bit I/O port operations are not supported, then ASSERT().
1079 If StartBit is greater than 63, then ASSERT().
1080 If EndBit is greater than 63, then ASSERT().
1081 If EndBit is less than StartBit, then ASSERT().
1082 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1084 @param Port The I/O port to write.
1085 @param StartBit The ordinal of the least significant bit in the bit field.
1087 @param EndBit The ordinal of the most significant bit in the bit field.
1089 @param AndData The value to AND with the read value from the I/O port.
1091 @return The value written back to the I/O port.
1105 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1110 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1111 bitwise OR, and writes the result back to the bit field in the
1114 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1115 by a bitwise OR between the read result and the value specified by
1116 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1117 value written to the I/O port is returned. This function must guarantee that
1118 all I/O read and write operations are serialized. Extra left bits in both
1119 AndData and OrData are stripped.
1121 If 64-bit I/O port operations are not supported, then ASSERT().
1122 If StartBit is greater than 63, then ASSERT().
1123 If EndBit is greater than 63, then ASSERT().
1124 If EndBit is less than StartBit, then ASSERT().
1125 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1126 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1128 @param Port The I/O port to write.
1129 @param StartBit The ordinal of the least significant bit in the bit field.
1131 @param EndBit The ordinal of the most significant bit in the bit field.
1133 @param AndData The value to AND with the read value from the I/O port.
1134 @param OrData The value to OR with the result of the AND operation.
1136 @return The value written back to the I/O port.
1141 IoBitFieldAndThenOr64 (
1151 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1156 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1157 result back to the 8-bit MMIO register.
1159 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1160 inclusive OR between the read result and the value specified by OrData, and
1161 writes the result to the 8-bit MMIO register specified by Address. The value
1162 written to the MMIO register is returned. This function must guarantee that
1163 all MMIO read and write operations are serialized.
1165 If 8-bit MMIO register operations are not supported, then ASSERT().
1167 @param Address The MMIO register to write.
1168 @param OrData The value to OR with the read value from the MMIO register.
1170 @return The value written back to the MMIO register.
1180 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1184 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1185 back to the 8-bit MMIO register.
1187 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1188 between the read result and the value specified by AndData, and writes the
1189 result to the 8-bit MMIO register specified by Address. The value written to
1190 the MMIO register is returned. This function must guarantee that all MMIO
1191 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 AndData The value to AND 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
) & AndData
));
1212 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1213 inclusive OR, and writes the result 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, performs a
1217 bitwise OR between the result of the AND operation and the value specified by
1218 OrData, and writes the result to the 8-bit MMIO register specified by
1219 Address. The value written to the MMIO register is returned. This function
1220 must guarantee that all MMIO read and write operations are serialized.
1222 If 8-bit MMIO register operations are not supported, then ASSERT().
1225 @param Address The MMIO register to write.
1226 @param AndData The value to AND with the read value from the MMIO register.
1227 @param OrData The value to OR with the result of the AND operation.
1229 @return The value written back to the MMIO register.
1240 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1244 Reads a bit field of a MMIO register.
1246 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1247 the StartBit and the EndBit. The value of the bit field is returned.
1249 If 8-bit MMIO register operations are not supported, then ASSERT().
1250 If StartBit is greater than 7, then ASSERT().
1251 If EndBit is greater than 7, then ASSERT().
1252 If EndBit is less than StartBit, then ASSERT().
1254 @param Address The MMIO register to read.
1255 @param StartBit The ordinal of the least significant bit in the bit field.
1257 @param EndBit The ordinal of the most significant bit in the bit field.
1260 @return The value read.
1271 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1275 Writes a bit field to a MMIO register.
1277 Writes Value to the bit field of the MMIO register. The bit field is
1278 specified by the StartBit and the EndBit. All other bits in the destination
1279 MMIO register are preserved. The new value of the 8-bit register is returned.
1281 If 8-bit MMIO register operations are not supported, then ASSERT().
1282 If StartBit is greater than 7, then ASSERT().
1283 If EndBit is greater than 7, then ASSERT().
1284 If EndBit is less than StartBit, then ASSERT().
1285 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1287 @param Address The MMIO register to write.
1288 @param StartBit The ordinal of the least significant bit in the bit field.
1290 @param EndBit The ordinal of the most significant bit in the bit field.
1292 @param Value The new value of the bit field.
1294 @return The value written back to the MMIO register.
1299 MmioBitFieldWrite8 (
1308 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1313 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1314 writes the result back to the bit field in the 8-bit MMIO register.
1316 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1317 inclusive OR between the read result and the value specified by OrData, and
1318 writes the result to the 8-bit MMIO register specified by Address. The value
1319 written to the MMIO register is returned. This function must guarantee that
1320 all MMIO read and write operations are serialized. Extra left bits in OrData
1323 If 8-bit MMIO register operations are not supported, then ASSERT().
1324 If StartBit is greater than 7, then ASSERT().
1325 If EndBit is greater than 7, then ASSERT().
1326 If EndBit is less than StartBit, then ASSERT().
1327 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1329 @param Address The MMIO register to write.
1330 @param StartBit The ordinal of the least significant bit in the bit field.
1332 @param EndBit The ordinal of the most significant bit in the bit field.
1334 @param OrData The value to OR with read value from the MMIO register.
1336 @return The value written back to the MMIO register.
1350 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1355 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1356 writes the result back to the bit field in the 8-bit MMIO register.
1358 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1359 between the read result and the value specified by AndData, and writes the
1360 result to the 8-bit MMIO register specified by Address. The value written to
1361 the MMIO register is returned. This function must guarantee that all MMIO
1362 read and write operations are serialized. Extra left bits in AndData are
1365 If 8-bit MMIO register operations are not supported, then ASSERT().
1366 If StartBit is greater than 7, then ASSERT().
1367 If EndBit is greater than 7, then ASSERT().
1368 If EndBit is less than StartBit, then ASSERT().
1369 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1371 @param Address The MMIO register to write.
1372 @param StartBit The ordinal of the least significant bit in the bit field.
1374 @param EndBit The ordinal of the most significant bit in the bit field.
1376 @param AndData The value to AND with read value from the MMIO register.
1378 @return The value written back to the MMIO register.
1392 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1397 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1398 by a bitwise OR, and writes the result back to the bit field in the
1399 8-bit MMIO register.
1401 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1402 followed by a bitwise OR between the read result and the value
1403 specified by AndData, and writes the result to the 8-bit MMIO register
1404 specified by Address. The value written to the MMIO register is returned.
1405 This function must guarantee that all MMIO read and write operations are
1406 serialized. Extra left bits in both AndData and OrData are stripped.
1408 If 8-bit MMIO register operations are not supported, then ASSERT().
1409 If StartBit is greater than 7, then ASSERT().
1410 If EndBit is greater than 7, then ASSERT().
1411 If EndBit is less than StartBit, then ASSERT().
1412 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1413 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1415 @param Address The MMIO register to write.
1416 @param StartBit The ordinal of the least significant bit in the bit field.
1418 @param EndBit The ordinal of the most significant bit in the bit field.
1420 @param AndData The value to AND with read value from the MMIO register.
1421 @param OrData The value to OR with the result of the AND operation.
1423 @return The value written back to the MMIO register.
1428 MmioBitFieldAndThenOr8 (
1438 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1443 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1444 result back to the 16-bit MMIO register.
1446 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1447 inclusive OR between the read result and the value specified by OrData, and
1448 writes the result to the 16-bit MMIO register specified by Address. The value
1449 written to the MMIO register is returned. This function must guarantee that
1450 all MMIO read and write operations are serialized.
1452 If 16-bit MMIO register operations are not supported, then ASSERT().
1454 @param Address The MMIO register to write.
1455 @param OrData The value to OR with the read value from the MMIO register.
1457 @return The value written back to the MMIO register.
1467 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1471 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1472 back to the 16-bit MMIO register.
1474 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1475 between the read result and the value specified by AndData, and writes the
1476 result to the 16-bit MMIO register specified by Address. The value written to
1477 the MMIO register is returned. This function must guarantee that all MMIO
1478 read and write operations are serialized.
1480 If 16-bit MMIO register operations are not supported, then ASSERT().
1482 @param Address The MMIO register to write.
1483 @param AndData The value to AND with the read value from the MMIO register.
1485 @return The value written back to the MMIO register.
1495 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1499 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1500 inclusive OR, and writes the result back to the 16-bit MMIO register.
1502 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1503 between the read result and the value specified by AndData, performs a
1504 bitwise OR between the result of the AND operation and the value specified by
1505 OrData, and writes the result to the 16-bit MMIO register specified by
1506 Address. The value written to the MMIO register is returned. This function
1507 must guarantee that all MMIO read and write operations are serialized.
1509 If 16-bit MMIO register operations are not supported, 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.
1514 @param OrData The value to OR with the result of the AND operation.
1516 @return The value written back to the MMIO register.
1527 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1531 Reads a bit field of a MMIO register.
1533 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1534 the StartBit and the EndBit. The value of the bit field is returned.
1536 If 16-bit MMIO register operations are not supported, then ASSERT().
1537 If StartBit is greater than 15, then ASSERT().
1538 If EndBit is greater than 15, then ASSERT().
1539 If EndBit is less than StartBit, then ASSERT().
1541 @param Address The MMIO register to read.
1542 @param StartBit The ordinal of the least significant bit in the bit field.
1544 @param EndBit The ordinal of the most significant bit in the bit field.
1547 @return The value read.
1552 MmioBitFieldRead16 (
1558 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1562 Writes a bit field to a MMIO register.
1564 Writes Value to the bit field of the MMIO register. The bit field is
1565 specified by the StartBit and the EndBit. All other bits in the destination
1566 MMIO register are preserved. The new value of the 16-bit register is returned.
1568 If 16-bit MMIO register operations are not supported, then ASSERT().
1569 If StartBit is greater than 15, then ASSERT().
1570 If EndBit is greater than 15, then ASSERT().
1571 If EndBit is less than StartBit, then ASSERT().
1572 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1574 @param Address The MMIO register to write.
1575 @param StartBit The ordinal of the least significant bit in the bit field.
1577 @param EndBit The ordinal of the most significant bit in the bit field.
1579 @param Value The new value of the bit field.
1581 @return The value written back to the MMIO register.
1586 MmioBitFieldWrite16 (
1593 return MmioWrite16 (
1595 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1600 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1601 writes the result back to the bit field in the 16-bit MMIO register.
1603 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1604 inclusive OR between the read result and the value specified by OrData, and
1605 writes the result to the 16-bit MMIO register specified by Address. The value
1606 written to the MMIO register is returned. This function must guarantee that
1607 all MMIO read and write operations are serialized. Extra left bits in OrData
1610 If 16-bit MMIO register operations are not supported, then ASSERT().
1611 If StartBit is greater than 15, then ASSERT().
1612 If EndBit is greater than 15, then ASSERT().
1613 If EndBit is less than StartBit, then ASSERT().
1614 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1616 @param Address The MMIO register to write.
1617 @param StartBit The ordinal of the least significant bit in the bit field.
1619 @param EndBit The ordinal of the most significant bit in the bit field.
1621 @param OrData The value to OR with read value from the MMIO register.
1623 @return The value written back to the MMIO register.
1635 return MmioWrite16 (
1637 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1642 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1643 writes the result back to the bit field in the 16-bit MMIO register.
1645 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1646 between the read result and the value specified by AndData, and writes the
1647 result to the 16-bit MMIO register specified by Address. The value written to
1648 the MMIO register is returned. This function must guarantee that all MMIO
1649 read and write operations are serialized. Extra left bits in AndData are
1652 If 16-bit MMIO register operations are not supported, then ASSERT().
1653 If StartBit is greater than 15, then ASSERT().
1654 If EndBit is greater than 15, then ASSERT().
1655 If EndBit is less than StartBit, then ASSERT().
1656 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1658 @param Address The MMIO register to write.
1659 @param StartBit The ordinal of the least significant bit in the bit field.
1661 @param EndBit The ordinal of the most significant bit in the bit field.
1663 @param AndData The value to AND with read value from the MMIO register.
1665 @return The value written back to the MMIO register.
1677 return MmioWrite16 (
1679 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1684 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1685 by a bitwise OR, and writes the result back to the bit field in the
1686 16-bit MMIO register.
1688 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1689 followed by a bitwise OR between the read result and the value
1690 specified by AndData, and writes the result to the 16-bit MMIO register
1691 specified by Address. The value written to the MMIO register is returned.
1692 This function must guarantee that all MMIO read and write operations are
1693 serialized. Extra left bits in both AndData and OrData are stripped.
1695 If 16-bit MMIO register operations are not supported, then ASSERT().
1696 If StartBit is greater than 15, then ASSERT().
1697 If EndBit is greater than 15, then ASSERT().
1698 If EndBit is less than StartBit, then ASSERT().
1699 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1700 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1702 @param Address The MMIO register to write.
1703 @param StartBit The ordinal of the least significant bit in the bit field.
1705 @param EndBit The ordinal of the most significant bit in the bit field.
1707 @param AndData The value to AND with read value from the MMIO register.
1708 @param OrData The value to OR with the result of the AND operation.
1710 @return The value written back to the MMIO register.
1715 MmioBitFieldAndThenOr16 (
1723 return MmioWrite16 (
1725 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1730 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1731 result back to the 32-bit MMIO register.
1733 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1734 inclusive OR between the read result and the value specified by OrData, and
1735 writes the result to the 32-bit MMIO register specified by Address. The value
1736 written to the MMIO register is returned. This function must guarantee that
1737 all MMIO read and write operations are serialized.
1739 If 32-bit MMIO register operations are not supported, then ASSERT().
1741 @param Address The MMIO register to write.
1742 @param OrData The value to OR with the read value from the MMIO register.
1744 @return The value written back to the MMIO register.
1754 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1758 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1759 back to the 32-bit MMIO register.
1761 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1762 between the read result and the value specified by AndData, and writes the
1763 result to the 32-bit MMIO register specified by Address. The value written to
1764 the MMIO register is returned. This function must guarantee that all MMIO
1765 read and write operations are serialized.
1767 If 32-bit MMIO register operations are not supported, then ASSERT().
1769 @param Address The MMIO register to write.
1770 @param AndData The value to AND with the read value from the MMIO register.
1772 @return The value written back to the MMIO register.
1782 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1786 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1787 inclusive OR, and writes the result back to the 32-bit MMIO register.
1789 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1790 between the read result and the value specified by AndData, performs a
1791 bitwise OR between the result of the AND operation and the value specified by
1792 OrData, and writes the result to the 32-bit MMIO register specified by
1793 Address. The value written to the MMIO register is returned. This function
1794 must guarantee that all MMIO read and write operations are serialized.
1796 If 32-bit MMIO register operations are not supported, then ASSERT().
1799 @param Address The MMIO register to write.
1800 @param AndData The value to AND with the read value from the MMIO register.
1801 @param OrData The value to OR with the result of the AND operation.
1803 @return The value written back to the MMIO register.
1814 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1818 Reads a bit field of a MMIO register.
1820 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1821 the StartBit and the EndBit. The value of the bit field is returned.
1823 If 32-bit MMIO register operations are not supported, then ASSERT().
1824 If StartBit is greater than 31, then ASSERT().
1825 If EndBit is greater than 31, then ASSERT().
1826 If EndBit is less than StartBit, then ASSERT().
1828 @param Address The MMIO register to read.
1829 @param StartBit The ordinal of the least significant bit in the bit field.
1831 @param EndBit The ordinal of the most significant bit in the bit field.
1834 @return The value read.
1839 MmioBitFieldRead32 (
1845 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1849 Writes a bit field to a MMIO register.
1851 Writes Value to the bit field of the MMIO register. The bit field is
1852 specified by the StartBit and the EndBit. All other bits in the destination
1853 MMIO register are preserved. The new value of the 32-bit register is returned.
1855 If 32-bit MMIO register operations are not supported, then ASSERT().
1856 If StartBit is greater than 31, then ASSERT().
1857 If EndBit is greater than 31, then ASSERT().
1858 If EndBit is less than StartBit, then ASSERT().
1859 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1861 @param Address The MMIO register to write.
1862 @param StartBit The ordinal of the least significant bit in the bit field.
1864 @param EndBit The ordinal of the most significant bit in the bit field.
1866 @param Value The new value of the bit field.
1868 @return The value written back to the MMIO register.
1873 MmioBitFieldWrite32 (
1880 return MmioWrite32 (
1882 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1887 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1888 writes the result back to the bit field in the 32-bit MMIO register.
1890 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1891 inclusive OR between the read result and the value specified by OrData, and
1892 writes the result to the 32-bit MMIO register specified by Address. The value
1893 written to the MMIO register is returned. This function must guarantee that
1894 all MMIO read and write operations are serialized. Extra left bits in OrData
1897 If 32-bit MMIO register operations are not supported, then ASSERT().
1898 If StartBit is greater than 31, then ASSERT().
1899 If EndBit is greater than 31, then ASSERT().
1900 If EndBit is less than StartBit, then ASSERT().
1901 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1903 @param Address The MMIO register to write.
1904 @param StartBit The ordinal of the least significant bit in the bit field.
1906 @param EndBit The ordinal of the most significant bit in the bit field.
1908 @param OrData The value to OR with read value from the MMIO register.
1910 @return The value written back to the MMIO register.
1922 return MmioWrite32 (
1924 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1929 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1930 writes the result back to the bit field in the 32-bit MMIO register.
1932 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1933 between the read result and the value specified by AndData, and writes the
1934 result to the 32-bit MMIO register specified by Address. The value written to
1935 the MMIO register is returned. This function must guarantee that all MMIO
1936 read and write operations are serialized. Extra left bits in AndData are
1939 If 32-bit MMIO register operations are not supported, then ASSERT().
1940 If StartBit is greater than 31, then ASSERT().
1941 If EndBit is greater than 31, then ASSERT().
1942 If EndBit is less than StartBit, then ASSERT().
1943 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1945 @param Address The MMIO register to write.
1946 @param StartBit The ordinal of the least significant bit in the bit field.
1948 @param EndBit The ordinal of the most significant bit in the bit field.
1950 @param AndData The value to AND with read value from the MMIO register.
1952 @return The value written back to the MMIO register.
1964 return MmioWrite32 (
1966 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1971 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1972 by a bitwise OR, and writes the result back to the bit field in the
1973 32-bit MMIO register.
1975 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1976 followed by a bitwise OR between the read result and the value
1977 specified by AndData, and writes the result to the 32-bit MMIO register
1978 specified by Address. The value written to the MMIO register is returned.
1979 This function must guarantee that all MMIO read and write operations are
1980 serialized. Extra left bits in both AndData and OrData are stripped.
1982 If 32-bit MMIO register operations are not supported, then ASSERT().
1983 If StartBit is greater than 31, then ASSERT().
1984 If EndBit is greater than 31, then ASSERT().
1985 If EndBit is less than StartBit, then ASSERT().
1986 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1987 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1989 @param Address The MMIO register to write.
1990 @param StartBit The ordinal of the least significant bit in the bit field.
1992 @param EndBit The ordinal of the most significant bit in the bit field.
1994 @param AndData The value to AND with read value from the MMIO register.
1995 @param OrData The value to OR with the result of the AND operation.
1997 @return The value written back to the MMIO register.
2002 MmioBitFieldAndThenOr32 (
2010 return MmioWrite32 (
2012 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2017 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2018 result back to the 64-bit MMIO register.
2020 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2021 inclusive OR between the read result and the value specified by OrData, and
2022 writes the result to the 64-bit MMIO register specified by Address. The value
2023 written to the MMIO register is returned. This function must guarantee that
2024 all MMIO read and write operations are serialized.
2026 If 64-bit MMIO register operations are not supported, then ASSERT().
2028 @param Address The MMIO register to write.
2029 @param OrData The value to OR with the read value from the MMIO register.
2031 @return The value written back to the MMIO register.
2041 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2045 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2046 back to the 64-bit MMIO register.
2048 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2049 between the read result and the value specified by AndData, and writes the
2050 result to the 64-bit MMIO register specified by Address. The value written to
2051 the MMIO register is returned. This function must guarantee that all MMIO
2052 read and write operations are serialized.
2054 If 64-bit MMIO register operations are not supported, then ASSERT().
2056 @param Address The MMIO register to write.
2057 @param AndData The value to AND with the read value from the MMIO register.
2059 @return The value written back to the MMIO register.
2069 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2073 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2074 inclusive OR, and writes the result back to the 64-bit MMIO register.
2076 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2077 between the read result and the value specified by AndData, performs a
2078 bitwise OR between the result of the AND operation and the value specified by
2079 OrData, and writes the result to the 64-bit MMIO register specified by
2080 Address. The value written to the MMIO register is returned. This function
2081 must guarantee that all MMIO read and write operations are serialized.
2083 If 64-bit MMIO register operations are not supported, then ASSERT().
2086 @param Address The MMIO register to write.
2087 @param AndData The value to AND with the read value from the MMIO register.
2088 @param OrData The value to OR with the result of the AND operation.
2090 @return The value written back to the MMIO register.
2101 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2105 Reads a bit field of a MMIO register.
2107 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2108 the StartBit and the EndBit. The value of the bit field is returned.
2110 If 64-bit MMIO register operations are not supported, then ASSERT().
2111 If StartBit is greater than 63, then ASSERT().
2112 If EndBit is greater than 63, then ASSERT().
2113 If EndBit is less than StartBit, then ASSERT().
2115 @param Address The MMIO register to read.
2116 @param StartBit The ordinal of the least significant bit in the bit field.
2118 @param EndBit The ordinal of the most significant bit in the bit field.
2121 @return The value read.
2126 MmioBitFieldRead64 (
2132 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2136 Writes a bit field to a MMIO register.
2138 Writes Value to the bit field of the MMIO register. The bit field is
2139 specified by the StartBit and the EndBit. All other bits in the destination
2140 MMIO register are preserved. The new value of the 64-bit register is returned.
2142 If 64-bit MMIO register operations are not supported, then ASSERT().
2143 If StartBit is greater than 63, then ASSERT().
2144 If EndBit is greater than 63, then ASSERT().
2145 If EndBit is less than StartBit, then ASSERT().
2146 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2148 @param Address The MMIO register to write.
2149 @param StartBit The ordinal of the least significant bit in the bit field.
2151 @param EndBit The ordinal of the most significant bit in the bit field.
2153 @param Value The new value of the bit field.
2155 @return The value written back to the MMIO register.
2160 MmioBitFieldWrite64 (
2167 return MmioWrite64 (
2169 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2174 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2175 writes the result back to the bit field in the 64-bit MMIO register.
2177 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2178 inclusive OR between the read result and the value specified by OrData, and
2179 writes the result to the 64-bit MMIO register specified by Address. The value
2180 written to the MMIO register is returned. This function must guarantee that
2181 all MMIO read and write operations are serialized. Extra left bits in OrData
2184 If 64-bit MMIO register operations are not supported, then ASSERT().
2185 If StartBit is greater than 63, then ASSERT().
2186 If EndBit is greater than 63, then ASSERT().
2187 If EndBit is less than StartBit, then ASSERT().
2188 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2190 @param Address The MMIO register to write.
2191 @param StartBit The ordinal of the least significant bit in the bit field.
2193 @param EndBit The ordinal of the most significant bit in the bit field.
2195 @param OrData The value to OR with read value from the MMIO register.
2197 @return The value written back to the MMIO register.
2209 return MmioWrite64 (
2211 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2216 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2217 writes the result back to the bit field in the 64-bit MMIO register.
2219 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2220 between the read result and the value specified by AndData, and writes the
2221 result to the 64-bit MMIO register specified by Address. The value written to
2222 the MMIO register is returned. This function must guarantee that all MMIO
2223 read and write operations are serialized. Extra left bits in AndData are
2226 If 64-bit MMIO register operations are not supported, then ASSERT().
2227 If StartBit is greater than 63, then ASSERT().
2228 If EndBit is greater than 63, then ASSERT().
2229 If EndBit is less than StartBit, then ASSERT().
2230 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2232 @param Address The MMIO register to write.
2233 @param StartBit The ordinal of the least significant bit in the bit field.
2235 @param EndBit The ordinal of the most significant bit in the bit field.
2237 @param AndData The value to AND with read value from the MMIO register.
2239 @return The value written back to the MMIO register.
2251 return MmioWrite64 (
2253 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2258 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2259 by a bitwise OR, and writes the result back to the bit field in the
2260 64-bit MMIO register.
2262 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2263 followed by a bitwise OR between the read result and the value
2264 specified by AndData, and writes the result to the 64-bit MMIO register
2265 specified by Address. The value written to the MMIO register is returned.
2266 This function must guarantee that all MMIO read and write operations are
2267 serialized. Extra left bits in both AndData and OrData are stripped.
2269 If 64-bit MMIO register operations are not supported, then ASSERT().
2270 If StartBit is greater than 63, then ASSERT().
2271 If EndBit is greater than 63, then ASSERT().
2272 If EndBit is less than StartBit, then ASSERT().
2273 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2274 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2276 @param Address The MMIO register to write.
2277 @param StartBit The ordinal of the least significant bit in the bit field.
2279 @param EndBit The ordinal of the most significant bit in the bit field.
2281 @param AndData The value to AND with read value from the MMIO register.
2282 @param OrData The value to OR with the result of the AND operation.
2284 @return The value written back to the MMIO register.
2289 MmioBitFieldAndThenOr64 (
2297 return MmioWrite64 (
2299 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)