]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2006 - 2008, Intel Corporation<BR>
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 The following IoLib instances share the same version of this file:
24 #include "BaseIoLibIntrinsicInternal.h"
27 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
28 result back to the 8-bit I/O port.
30 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
31 between the read result and the value specified by OrData, and writes the
32 result to the 8-bit I/O port specified by Port. The value written to the I/O
33 port is returned. This function must guarantee that all I/O read and write
34 operations are serialized.
36 If 8-bit I/O port operations are not supported, then ASSERT().
38 @param Port The I/O port to write.
39 @param OrData The value to OR with the read value from the I/O port.
41 @return The value written back to the I/O port.
51 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
55 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
56 to the 8-bit I/O port.
58 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
59 the read result and the value specified by AndData, and writes the result to
60 the 8-bit I/O port specified by Port. The value written to the I/O port is
61 returned. This function must guarantee that all I/O read and write operations
64 If 8-bit I/O port operations are not supported, then ASSERT().
66 @param Port The I/O port to write.
67 @param AndData The value to AND with the read value from the I/O port.
69 @return The value written back to the I/O port.
79 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
83 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
84 inclusive OR, and writes the result back to the 8-bit I/O port.
86 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
87 the read result and the value specified by AndData, performs a bitwise OR
88 between the result of the AND operation and the value specified by OrData,
89 and writes the result to the 8-bit I/O port specified by Port. The value
90 written to the I/O port is returned. This function must guarantee that all
91 I/O read and write operations are serialized.
93 If 8-bit I/O port operations are not supported, then ASSERT().
95 @param Port The I/O port to write.
96 @param AndData The value to AND with the read value from the I/O port.
97 @param OrData The value to OR with the result of the AND operation.
99 @return The value written back to the I/O port.
110 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
114 Reads a bit field of an I/O register.
116 Reads the bit field in an 8-bit I/O register. The bit field is specified by
117 the StartBit and the EndBit. The value of the bit field is returned.
119 If 8-bit I/O port operations are not supported, then ASSERT().
120 If StartBit is greater than 7, then ASSERT().
121 If EndBit is greater than 7, then ASSERT().
122 If EndBit is less than StartBit, then ASSERT().
124 @param Port The I/O port to read.
125 @param StartBit The ordinal of the least significant bit in the bit field.
127 @param EndBit The ordinal of the most significant bit in the bit field.
130 @return The value read from I/O port specified by StartBit and
142 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
146 Writes a bit field to an I/O register.
148 Writes Value to the bit field of the I/O register. The bit field is specified
149 by the StartBit and the EndBit. All other bits in the destination I/O
150 register are preserved. The value written to the I/O port is returned. Extra
151 left bits in Value are stripped.
153 If 8-bit I/O port operations are not supported, then ASSERT().
154 If StartBit is greater than 7, then ASSERT().
155 If EndBit is greater than 7, then ASSERT().
156 If EndBit is less than StartBit, then ASSERT().
158 @param Port The I/O port to write.
159 @param StartBit The ordinal of the least significant bit in the bit field.
161 @param EndBit The ordinal of the most significant bit in the bit field.
163 @param Value New value of the bit field.
165 @return The value written back to the I/O port.
179 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
184 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
185 result back to the bit field in the 8-bit port.
187 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
188 between the read result and the value specified by OrData, and writes the
189 result to the 8-bit I/O port specified by Port. The value written to the I/O
190 port is returned. This function must guarantee that all I/O read and write
191 operations are serialized. Extra left bits in OrData are stripped.
193 If 8-bit I/O port operations are not supported, then ASSERT().
194 If StartBit is greater than 7, then ASSERT().
195 If EndBit is greater than 7, then ASSERT().
196 If EndBit is less than StartBit, then ASSERT().
198 @param Port The I/O port to write.
199 @param StartBit The ordinal of the least significant bit in the bit field.
201 @param EndBit The ordinal of the most significant bit in the bit field.
203 @param OrData The value to OR with the read value from the I/O port.
205 @return The value written back to the I/O port.
219 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
224 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
225 result back to the bit field in the 8-bit port.
227 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
228 the read result and the value specified by AndData, and writes the result to
229 the 8-bit I/O port specified by Port. The value written to the I/O port is
230 returned. This function must guarantee that all I/O read and write operations
231 are serialized. Extra left bits in AndData are stripped.
233 If 8-bit I/O port operations are not supported, then ASSERT().
234 If StartBit is greater than 7, then ASSERT().
235 If EndBit is greater than 7, then ASSERT().
236 If EndBit is less than StartBit, then ASSERT().
238 @param Port The I/O port to write.
239 @param StartBit The ordinal of the least significant bit in the bit field.
241 @param EndBit The ordinal of the most significant bit in the bit field.
243 @param AndData The value to AND with the read value from the I/O port.
245 @return The value written back to the I/O port.
259 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
264 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
265 bitwise inclusive OR, and writes the result back to the bit field in the
268 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
269 by a bitwise inclusive OR between the read result and the value specified by
270 AndData, and writes the result to the 8-bit I/O port specified by Port. The
271 value written to the I/O port is returned. This function must guarantee that
272 all I/O read and write operations are serialized. Extra left bits in both
273 AndData and OrData are stripped.
275 If 8-bit I/O port operations are not supported, then ASSERT().
276 If StartBit is greater than 7, then ASSERT().
277 If EndBit is greater than 7, then ASSERT().
278 If EndBit is less than StartBit, then ASSERT().
280 @param Port The I/O port to write.
281 @param StartBit The ordinal of the least significant bit in the bit field.
283 @param EndBit The ordinal of the most significant bit in the bit field.
285 @param AndData The value to AND with the read value from the I/O port.
286 @param OrData The value to OR with the result of the AND operation.
288 @return The value written back to the I/O port.
293 IoBitFieldAndThenOr8 (
303 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
308 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
309 result back to the 16-bit I/O port.
311 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
312 between the read result and the value specified by OrData, and writes the
313 result to the 16-bit I/O port specified by Port. The value written to the I/O
314 port is returned. This function must guarantee that all I/O read and write
315 operations are serialized.
317 If 16-bit I/O port operations are not supported, then ASSERT().
319 @param Port The I/O port to write.
320 @param OrData The value to OR with the read value from the I/O port.
322 @return The value written back to the I/O port.
332 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
336 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
337 to the 16-bit I/O port.
339 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
340 the read result and the value specified by AndData, and writes the result to
341 the 16-bit I/O port specified by Port. The value written to the I/O port is
342 returned. This function must guarantee that all I/O read and write operations
345 If 16-bit I/O port operations are not supported, then ASSERT().
347 @param Port The I/O port to write.
348 @param AndData The value to AND with the read value from the I/O port.
350 @return The value written back to the I/O port.
360 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
364 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
365 inclusive OR, and writes the result back to the 16-bit I/O port.
367 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
368 the read result and the value specified by AndData, performs a bitwise OR
369 between the result of the AND operation and the value specified by OrData,
370 and writes the result to the 16-bit I/O port specified by Port. The value
371 written to the I/O port is returned. This function must guarantee that all
372 I/O read and write operations are serialized.
374 If 16-bit I/O port operations are not supported, then ASSERT().
376 @param Port The I/O port to write.
377 @param AndData The value to AND with the read value from the I/O port.
378 @param OrData The value to OR with the result of the AND operation.
380 @return The value written back to the I/O port.
391 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
395 Reads a bit field of an I/O register.
397 Reads the bit field in a 16-bit I/O register. The bit field is specified by
398 the StartBit and the EndBit. The value of the bit field is returned.
400 If 16-bit I/O port operations are not supported, then ASSERT().
401 If StartBit is greater than 15, then ASSERT().
402 If EndBit is greater than 15, then ASSERT().
403 If EndBit is less than StartBit, then ASSERT().
405 @param Port The I/O port to read.
406 @param StartBit The ordinal of the least significant bit in the bit field.
408 @param EndBit The ordinal of the most significant bit in the bit field.
411 @return The value read from I/O port specified by StartBit and
423 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
427 Writes a bit field to an I/O register.
429 Writes Value to the bit field of the I/O register. The bit field is specified
430 by the StartBit and the EndBit. All other bits in the destination I/O
431 register are preserved. The value written to the I/O port is returned. Extra
432 left bits in Value are stripped.
434 If 16-bit I/O port operations are not supported, then ASSERT().
435 If StartBit is greater than 15, then ASSERT().
436 If EndBit is greater than 15, then ASSERT().
437 If EndBit is less than StartBit, then ASSERT().
439 @param Port The I/O port to write.
440 @param StartBit The ordinal of the least significant bit in the bit field.
442 @param EndBit The ordinal of the most significant bit in the bit field.
444 @param Value New value of the bit field.
446 @return The value written back to the I/O port.
460 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
465 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
466 result back to the bit field in the 16-bit port.
468 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
469 between the read result and the value specified by OrData, and writes the
470 result to the 16-bit I/O port specified by Port. The value written to the I/O
471 port is returned. This function must guarantee that all I/O read and write
472 operations are serialized. Extra left bits in OrData are stripped.
474 If 16-bit I/O port operations are not supported, then ASSERT().
475 If StartBit is greater than 15, then ASSERT().
476 If EndBit is greater than 15, then ASSERT().
477 If EndBit is less than StartBit, then ASSERT().
479 @param Port The I/O port to write.
480 @param StartBit The ordinal of the least significant bit in the bit field.
482 @param EndBit The ordinal of the most significant bit in the bit field.
484 @param OrData The value to OR with the read value from the I/O port.
486 @return The value written back to the I/O port.
500 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
505 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
506 result back to the bit field in the 16-bit port.
508 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
509 the read result and the value specified by AndData, and writes the result to
510 the 16-bit I/O port specified by Port. The value written to the I/O port is
511 returned. This function must guarantee that all I/O read and write operations
512 are serialized. Extra left bits in AndData are stripped.
514 If 16-bit I/O port operations are not supported, then ASSERT().
515 If StartBit is greater than 15, then ASSERT().
516 If EndBit is greater than 15, then ASSERT().
517 If EndBit is less than StartBit, then ASSERT().
519 @param Port The I/O port to write.
520 @param StartBit The ordinal of the least significant bit in the bit field.
522 @param EndBit The ordinal of the most significant bit in the bit field.
524 @param AndData The value to AND with the read value from the I/O port.
526 @return The value written back to the I/O port.
540 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
545 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
546 bitwise inclusive OR, and writes the result back to the bit field in the
549 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
550 by a bitwise inclusive OR between the read result and the value specified by
551 AndData, and writes the result to the 16-bit I/O port specified by Port. The
552 value written to the I/O port is returned. This function must guarantee that
553 all I/O read and write operations are serialized. Extra left bits in both
554 AndData and OrData are stripped.
556 If 16-bit I/O port operations are not supported, then ASSERT().
557 If StartBit is greater than 15, then ASSERT().
558 If EndBit is greater than 15, then ASSERT().
559 If EndBit is less than StartBit, then ASSERT().
561 @param Port The I/O port to write.
562 @param StartBit The ordinal of the least significant bit in the bit field.
564 @param EndBit The ordinal of the most significant bit in the bit field.
566 @param AndData The value to AND with the read value from the I/O port.
567 @param OrData The value to OR with the result of the AND operation.
569 @return The value written back to the I/O port.
574 IoBitFieldAndThenOr16 (
584 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
589 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
590 result back to the 32-bit I/O port.
592 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
593 between the read result and the value specified by OrData, and writes the
594 result to the 32-bit I/O port specified by Port. The value written to the I/O
595 port is returned. This function must guarantee that all I/O read and write
596 operations are serialized.
598 If 32-bit I/O port operations are not supported, then ASSERT().
600 @param Port The I/O port to write.
601 @param OrData The value to OR with the read value from the I/O port.
603 @return The value written back to the I/O port.
613 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
617 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
618 to the 32-bit I/O port.
620 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
621 the read result and the value specified by AndData, and writes the result to
622 the 32-bit I/O port specified by Port. The value written to the I/O port is
623 returned. This function must guarantee that all I/O read and write operations
626 If 32-bit I/O port operations are not supported, then ASSERT().
628 @param Port The I/O port to write.
629 @param AndData The value to AND with the read value from the I/O port.
631 @return The value written back to the I/O port.
641 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
645 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
646 inclusive OR, and writes the result back to the 32-bit I/O port.
648 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
649 the read result and the value specified by AndData, performs a bitwise OR
650 between the result of the AND operation and the value specified by OrData,
651 and writes the result to the 32-bit I/O port specified by Port. The value
652 written to the I/O port is returned. This function must guarantee that all
653 I/O read and write operations are serialized.
655 If 32-bit I/O port operations are not supported, then ASSERT().
657 @param Port The I/O port to write.
658 @param AndData The value to AND with the read value from the I/O port.
659 @param OrData The value to OR with the result of the AND operation.
661 @return The value written back to the I/O port.
672 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
676 Reads a bit field of an I/O register.
678 Reads the bit field in a 32-bit I/O register. The bit field is specified by
679 the StartBit and the EndBit. The value of the bit field is returned.
681 If 32-bit I/O port operations are not supported, then ASSERT().
682 If StartBit is greater than 31, then ASSERT().
683 If EndBit is greater than 31, then ASSERT().
684 If EndBit is less than StartBit, then ASSERT().
686 @param Port The I/O port to read.
687 @param StartBit The ordinal of the least significant bit in the bit field.
689 @param EndBit The ordinal of the most significant bit in the bit field.
692 @return The value read from I/O port specified by StartBit and
704 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
708 Writes a bit field to an I/O register.
710 Writes Value to the bit field of the I/O register. The bit field is specified
711 by the StartBit and the EndBit. All other bits in the destination I/O
712 register are preserved. The value written to the I/O port is returned. Extra
713 left bits in Value are stripped.
715 If 32-bit I/O port operations are not supported, then ASSERT().
716 If StartBit is greater than 31, then ASSERT().
717 If EndBit is greater than 31, then ASSERT().
718 If EndBit is less than StartBit, then ASSERT().
720 @param Port The I/O port to write.
721 @param StartBit The ordinal of the least significant bit in the bit field.
723 @param EndBit The ordinal of the most significant bit in the bit field.
725 @param Value New value of the bit field.
727 @return The value written back to the I/O port.
741 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
746 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
747 result back to the bit field in the 32-bit port.
749 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
750 between the read result and the value specified by OrData, and writes the
751 result to the 32-bit I/O port specified by Port. The value written to the I/O
752 port is returned. This function must guarantee that all I/O read and write
753 operations are serialized. Extra left bits in OrData are stripped.
755 If 32-bit I/O port operations are not supported, then ASSERT().
756 If StartBit is greater than 31, then ASSERT().
757 If EndBit is greater than 31, then ASSERT().
758 If EndBit is less than StartBit, then ASSERT().
760 @param Port The I/O port to write.
761 @param StartBit The ordinal of the least significant bit in the bit field.
763 @param EndBit The ordinal of the most significant bit in the bit field.
765 @param OrData The value to OR with the read value from the I/O port.
767 @return The value written back to the I/O port.
781 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
786 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
787 result back to the bit field in the 32-bit port.
789 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
790 the read result and the value specified by AndData, and writes the result to
791 the 32-bit I/O port specified by Port. The value written to the I/O port is
792 returned. This function must guarantee that all I/O read and write operations
793 are serialized. Extra left bits in AndData are stripped.
795 If 32-bit I/O port operations are not supported, then ASSERT().
796 If StartBit is greater than 31, then ASSERT().
797 If EndBit is greater than 31, then ASSERT().
798 If EndBit is less than StartBit, then ASSERT().
800 @param Port The I/O port to write.
801 @param StartBit The ordinal of the least significant bit in the bit field.
803 @param EndBit The ordinal of the most significant bit in the bit field.
805 @param AndData The value to AND with the read value from the I/O port.
807 @return The value written back to the I/O port.
821 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
826 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
827 bitwise inclusive OR, and writes the result back to the bit field in the
830 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
831 by a bitwise inclusive OR between the read result and the value specified by
832 AndData, and writes the result to the 32-bit I/O port specified by Port. The
833 value written to the I/O port is returned. This function must guarantee that
834 all I/O read and write operations are serialized. Extra left bits in both
835 AndData and OrData are stripped.
837 If 32-bit I/O port operations are not supported, then ASSERT().
838 If StartBit is greater than 31, then ASSERT().
839 If EndBit is greater than 31, then ASSERT().
840 If EndBit is less than StartBit, 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 inclusive 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 inclusive 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 from I/O port specified by StartBit and
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().
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 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 inclusive 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().
1041 @param Port The I/O port to write.
1042 @param StartBit The ordinal of the least significant bit in the bit field.
1044 @param EndBit The ordinal of the most significant bit in the bit field.
1046 @param OrData The value to OR with the read value from the I/O port.
1048 @return The value written back to the I/O port.
1062 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1067 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1068 result back to the bit field in the 64-bit port.
1070 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1071 the read result and the value specified by AndData, and writes the result to
1072 the 64-bit I/O port specified by Port. The value written to the I/O port is
1073 returned. This function must guarantee that all I/O read and write operations
1074 are serialized. Extra left bits in AndData are stripped.
1076 If 64-bit I/O port operations are not supported, then ASSERT().
1077 If StartBit is greater than 63, then ASSERT().
1078 If EndBit is greater than 63, then ASSERT().
1079 If EndBit is less than StartBit, then ASSERT().
1081 @param Port The I/O port to write.
1082 @param StartBit The ordinal of the least significant bit in the bit field.
1084 @param EndBit The ordinal of the most significant bit in the bit field.
1086 @param AndData The value to AND with the read value from the I/O port.
1088 @return The value written back to the I/O port.
1102 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1107 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1108 bitwise inclusive OR, and writes the result back to the bit field in the
1111 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1112 by a bitwise inclusive OR between the read result and the value specified by
1113 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1114 value written to the I/O port is returned. This function must guarantee that
1115 all I/O read and write operations are serialized. Extra left bits in both
1116 AndData and OrData are stripped.
1118 If 64-bit I/O port operations are not supported, then ASSERT().
1119 If StartBit is greater than 63, then ASSERT().
1120 If EndBit is greater than 63, then ASSERT().
1121 If EndBit is less than StartBit, then ASSERT().
1123 @param Port The I/O port to write.
1124 @param StartBit The ordinal of the least significant bit in the bit field.
1126 @param EndBit The ordinal of the most significant bit in the bit field.
1128 @param AndData The value to AND with the read value from the I/O port.
1129 @param OrData The value to OR with the result of the AND operation.
1131 @return The value written back to the I/O port.
1136 IoBitFieldAndThenOr64 (
1146 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1151 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1152 result back to the 8-bit MMIO register.
1154 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1155 inclusive OR between the read result and the value specified by OrData, and
1156 writes the result to the 8-bit MMIO register specified by Address. The value
1157 written to the MMIO register is returned. This function must guarantee that
1158 all MMIO read and write operations are serialized.
1160 If 8-bit MMIO register operations are not supported, then ASSERT().
1162 @param Address The MMIO register to write.
1163 @param OrData The value to OR with the read value from the MMIO register.
1165 @return The value written back to the MMIO register.
1175 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1179 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1180 back to the 8-bit MMIO register.
1182 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1183 between the read result and the value specified by AndData, and writes the
1184 result to the 8-bit MMIO register specified by Address. The value written to
1185 the MMIO register is returned. This function must guarantee that all MMIO
1186 read and write operations are serialized.
1188 If 8-bit MMIO register operations are not supported, then ASSERT().
1190 @param Address The MMIO register to write.
1191 @param AndData The value to AND with the read value from the MMIO register.
1193 @return The value written back to the MMIO register.
1203 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1207 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1208 inclusive OR, and writes the result back to the 8-bit MMIO register.
1210 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1211 between the read result and the value specified by AndData, performs a
1212 bitwise OR between the result of the AND operation and the value specified by
1213 OrData, and writes the result to the 8-bit MMIO register specified by
1214 Address. The value written to the MMIO register is returned. This function
1215 must guarantee that all MMIO read and write operations are serialized.
1217 If 8-bit MMIO register operations are not supported, then ASSERT().
1220 @param Address The MMIO register to write.
1221 @param AndData The value to AND with the read value from the MMIO register.
1222 @param OrData The value to OR with the result of the AND operation.
1224 @return The value written back to the MMIO register.
1235 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1239 Reads a bit field of a MMIO register.
1241 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1242 the StartBit and the EndBit. The value of the bit field is returned.
1244 If 8-bit MMIO register operations are not supported, then ASSERT().
1245 If StartBit is greater than 7, then ASSERT().
1246 If EndBit is greater than 7, then ASSERT().
1247 If EndBit is less than StartBit, then ASSERT().
1249 @param Address MMIO register to read.
1250 @param StartBit The ordinal of the least significant bit in the bit field.
1252 @param EndBit The ordinal of the most significant bit in the bit field.
1255 @return The value read from I/O port specified by StartBit and
1267 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1271 Writes a bit field to a MMIO register.
1273 Writes Value to the bit field of the MMIO register. The bit field is
1274 specified by the StartBit and the EndBit. All other bits in the destination
1275 MMIO register are preserved. The new value of the 8-bit register is returned.
1277 If 8-bit MMIO register operations are not supported, then ASSERT().
1278 If StartBit is greater than 7, then ASSERT().
1279 If EndBit is greater than 7, then ASSERT().
1280 If EndBit is less than StartBit, then ASSERT().
1282 @param Address MMIO register to write.
1283 @param StartBit The ordinal of the least significant bit in the bit field.
1285 @param EndBit The ordinal of the most significant bit in the bit field.
1287 @param Value New value of the bit field.
1289 @return The value written back to the MMIO register.
1294 MmioBitFieldWrite8 (
1303 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1308 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1309 writes the result back to the bit field in the 8-bit MMIO register.
1311 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1312 inclusive OR between the read result and the value specified by OrData, and
1313 writes the result to the 8-bit MMIO register specified by Address. The value
1314 written to the MMIO register is returned. This function must guarantee that
1315 all MMIO read and write operations are serialized. Extra left bits in OrData
1318 If 8-bit MMIO register operations are not supported, then ASSERT().
1319 If StartBit is greater than 7, then ASSERT().
1320 If EndBit is greater than 7, then ASSERT().
1321 If EndBit is less than StartBit, then ASSERT().
1323 @param Address MMIO register to write.
1324 @param StartBit The ordinal of the least significant bit in the bit field.
1326 @param EndBit The ordinal of the most significant bit in the bit field.
1328 @param OrData The value to OR with read value from the MMIO register.
1330 @return The value written back to the MMIO register.
1344 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1349 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1350 writes the result back to the bit field in the 8-bit MMIO register.
1352 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1353 between the read result and the value specified by AndData, and writes the
1354 result to the 8-bit MMIO register specified by Address. The value written to
1355 the MMIO register is returned. This function must guarantee that all MMIO
1356 read and write operations are serialized. Extra left bits in AndData are
1359 If 8-bit MMIO register operations are not supported, then ASSERT().
1360 If StartBit is greater than 7, then ASSERT().
1361 If EndBit is greater than 7, then ASSERT().
1362 If EndBit is less than StartBit, then ASSERT().
1364 @param Address MMIO register to write.
1365 @param StartBit The ordinal of the least significant bit in the bit field.
1367 @param EndBit The ordinal of the most significant bit in the bit field.
1369 @param AndData The value to AND with read value from the MMIO register.
1371 @return The value written back to the MMIO register.
1385 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1390 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1391 by a bitwise inclusive OR, and writes the result back to the bit field in the
1392 8-bit MMIO register.
1394 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1395 followed by a bitwise inclusive OR between the read result and the value
1396 specified by AndData, and writes the result to the 8-bit MMIO register
1397 specified by Address. The value written to the MMIO register is returned.
1398 This function must guarantee that all MMIO read and write operations are
1399 serialized. Extra left bits in both AndData and OrData are stripped.
1401 If 8-bit MMIO register operations are not supported, then ASSERT().
1402 If StartBit is greater than 7, then ASSERT().
1403 If EndBit is greater than 7, then ASSERT().
1404 If EndBit is less than StartBit, then ASSERT().
1406 @param Address MMIO register to write.
1407 @param StartBit The ordinal of the least significant bit in the bit field.
1409 @param EndBit The ordinal of the most significant bit in the bit field.
1411 @param AndData The value to AND with read value from the MMIO register.
1412 @param OrData The value to OR with the result of the AND operation.
1414 @return The value written back to the MMIO register.
1419 MmioBitFieldAndThenOr8 (
1429 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1434 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1435 result back to the 16-bit MMIO register.
1437 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1438 inclusive OR between the read result and the value specified by OrData, and
1439 writes the result to the 16-bit MMIO register specified by Address. The value
1440 written to the MMIO register is returned. This function must guarantee that
1441 all MMIO read and write operations are serialized.
1443 If 16-bit MMIO register operations are not supported, then ASSERT().
1445 @param Address The MMIO register to write.
1446 @param OrData The value to OR with the read value from the MMIO register.
1448 @return The value written back to the MMIO register.
1458 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1462 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1463 back to the 16-bit MMIO register.
1465 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1466 between the read result and the value specified by AndData, and writes the
1467 result to the 16-bit MMIO register specified by Address. The value written to
1468 the MMIO register is returned. This function must guarantee that all MMIO
1469 read and write operations are serialized.
1471 If 16-bit MMIO register operations are not supported, then ASSERT().
1473 @param Address The MMIO register to write.
1474 @param AndData The value to AND with the read value from the MMIO register.
1476 @return The value written back to the MMIO register.
1486 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1490 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1491 inclusive OR, and writes the result back to the 16-bit MMIO register.
1493 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1494 between the read result and the value specified by AndData, performs a
1495 bitwise OR between the result of the AND operation and the value specified by
1496 OrData, and writes the result to the 16-bit MMIO register specified by
1497 Address. The value written to the MMIO register is returned. This function
1498 must guarantee that all MMIO read and write operations are serialized.
1500 If 16-bit MMIO register operations are not supported, then ASSERT().
1503 @param Address The MMIO register to write.
1504 @param AndData The value to AND with the read value from the MMIO register.
1505 @param OrData The value to OR with the result of the AND operation.
1507 @return The value written back to the MMIO register.
1518 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1522 Reads a bit field of a MMIO register.
1524 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1525 the StartBit and the EndBit. The value of the bit field is returned.
1527 If 16-bit MMIO register operations are not supported, then ASSERT().
1528 If StartBit is greater than 15, then ASSERT().
1529 If EndBit is greater than 15, then ASSERT().
1530 If EndBit is less than StartBit, then ASSERT().
1532 @param Address MMIO register to read.
1533 @param StartBit The ordinal of the least significant bit in the bit field.
1535 @param EndBit The ordinal of the most significant bit in the bit field.
1538 @return The value read from I/O port specified by StartBit and
1544 MmioBitFieldRead16 (
1550 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1554 Writes a bit field to a MMIO register.
1556 Writes Value to the bit field of the MMIO register. The bit field is
1557 specified by the StartBit and the EndBit. All other bits in the destination
1558 MMIO register are preserved. The new value of the 16-bit register is returned.
1560 If 16-bit MMIO register operations are not supported, then ASSERT().
1561 If StartBit is greater than 15, then ASSERT().
1562 If EndBit is greater than 15, then ASSERT().
1563 If EndBit is less than StartBit, then ASSERT().
1565 @param Address MMIO register to write.
1566 @param StartBit The ordinal of the least significant bit in the bit field.
1568 @param EndBit The ordinal of the most significant bit in the bit field.
1570 @param Value New value of the bit field.
1572 @return The value written back to the MMIO register.
1577 MmioBitFieldWrite16 (
1584 return MmioWrite16 (
1586 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1591 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1592 writes the result back to the bit field in the 16-bit MMIO register.
1594 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1595 inclusive OR between the read result and the value specified by OrData, and
1596 writes the result to the 16-bit MMIO register specified by Address. The value
1597 written to the MMIO register is returned. This function must guarantee that
1598 all MMIO read and write operations are serialized. Extra left bits in OrData
1601 If 16-bit MMIO register operations are not supported, then ASSERT().
1602 If StartBit is greater than 15, then ASSERT().
1603 If EndBit is greater than 15, then ASSERT().
1604 If EndBit is less than StartBit, then ASSERT().
1606 @param Address MMIO register to write.
1607 @param StartBit The ordinal of the least significant bit in the bit field.
1609 @param EndBit The ordinal of the most significant bit in the bit field.
1611 @param OrData The value to OR with read value from the MMIO register.
1613 @return The value written back to the MMIO register.
1625 return MmioWrite16 (
1627 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1632 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1633 writes the result back to the bit field in the 16-bit MMIO register.
1635 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1636 between the read result and the value specified by AndData, and writes the
1637 result to the 16-bit MMIO register specified by Address. The value written to
1638 the MMIO register is returned. This function must guarantee that all MMIO
1639 read and write operations are serialized. Extra left bits in AndData are
1642 If 16-bit MMIO register operations are not supported, then ASSERT().
1643 If StartBit is greater than 15, then ASSERT().
1644 If EndBit is greater than 15, then ASSERT().
1645 If EndBit is less than StartBit, then ASSERT().
1647 @param Address MMIO register to write.
1648 @param StartBit The ordinal of the least significant bit in the bit field.
1650 @param EndBit The ordinal of the most significant bit in the bit field.
1652 @param AndData The value to AND with read value from the MMIO register.
1654 @return The value written back to the MMIO register.
1666 return MmioWrite16 (
1668 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1673 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1674 by a bitwise inclusive OR, and writes the result back to the bit field in the
1675 16-bit MMIO register.
1677 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1678 followed by a bitwise inclusive OR between the read result and the value
1679 specified by AndData, and writes the result to the 16-bit MMIO register
1680 specified by Address. The value written to the MMIO register is returned.
1681 This function must guarantee that all MMIO read and write operations are
1682 serialized. Extra left bits in both AndData and OrData are stripped.
1684 If 16-bit MMIO register operations are not supported, then ASSERT().
1685 If StartBit is greater than 15, then ASSERT().
1686 If EndBit is greater than 15, then ASSERT().
1687 If EndBit is less than StartBit, then ASSERT().
1689 @param Address MMIO register to write.
1690 @param StartBit The ordinal of the least significant bit in the bit field.
1692 @param EndBit The ordinal of the most significant bit in the bit field.
1694 @param AndData The value to AND with read value from the MMIO register.
1695 @param OrData The value to OR with the result of the AND operation.
1697 @return The value written back to the MMIO register.
1702 MmioBitFieldAndThenOr16 (
1710 return MmioWrite16 (
1712 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1717 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1718 result back to the 32-bit MMIO register.
1720 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1721 inclusive OR between the read result and the value specified by OrData, and
1722 writes the result to the 32-bit MMIO register specified by Address. The value
1723 written to the MMIO register is returned. This function must guarantee that
1724 all MMIO read and write operations are serialized.
1726 If 32-bit MMIO register operations are not supported, then ASSERT().
1728 @param Address The MMIO register to write.
1729 @param OrData The value to OR with the read value from the MMIO register.
1731 @return The value written back to the MMIO register.
1741 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1745 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1746 back to the 32-bit MMIO register.
1748 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1749 between the read result and the value specified by AndData, and writes the
1750 result to the 32-bit MMIO register specified by Address. The value written to
1751 the MMIO register is returned. This function must guarantee that all MMIO
1752 read and write operations are serialized.
1754 If 32-bit MMIO register operations are not supported, then ASSERT().
1756 @param Address The MMIO register to write.
1757 @param AndData The value to AND with the read value from the MMIO register.
1759 @return The value written back to the MMIO register.
1769 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1773 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1774 inclusive OR, and writes the result back to the 32-bit MMIO register.
1776 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1777 between the read result and the value specified by AndData, performs a
1778 bitwise OR between the result of the AND operation and the value specified by
1779 OrData, and writes the result to the 32-bit MMIO register specified by
1780 Address. The value written to the MMIO register is returned. This function
1781 must guarantee that all MMIO read and write operations are serialized.
1783 If 32-bit MMIO register operations are not supported, then ASSERT().
1786 @param Address The MMIO register to write.
1787 @param AndData The value to AND with the read value from the MMIO register.
1788 @param OrData The value to OR with the result of the AND operation.
1790 @return The value written back to the MMIO register.
1801 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1805 Reads a bit field of a MMIO register.
1807 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1808 the StartBit and the EndBit. The value of the bit field is returned.
1810 If 32-bit MMIO register operations are not supported, then ASSERT().
1811 If StartBit is greater than 31, then ASSERT().
1812 If EndBit is greater than 31, then ASSERT().
1813 If EndBit is less than StartBit, then ASSERT().
1815 @param Address MMIO register to read.
1816 @param StartBit The ordinal of the least significant bit in the bit field.
1818 @param EndBit The ordinal of the most significant bit in the bit field.
1821 @return The value read from I/O port specified by StartBit and
1827 MmioBitFieldRead32 (
1833 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1837 Writes a bit field to a MMIO register.
1839 Writes Value to the bit field of the MMIO register. The bit field is
1840 specified by the StartBit and the EndBit. All other bits in the destination
1841 MMIO register are preserved. The new value of the 32-bit register is returned.
1843 If 32-bit MMIO register operations are not supported, then ASSERT().
1844 If StartBit is greater than 31, then ASSERT().
1845 If EndBit is greater than 31, then ASSERT().
1846 If EndBit is less than StartBit, then ASSERT().
1848 @param Address MMIO register to write.
1849 @param StartBit The ordinal of the least significant bit in the bit field.
1851 @param EndBit The ordinal of the most significant bit in the bit field.
1853 @param Value New value of the bit field.
1855 @return The value written back to the MMIO register.
1860 MmioBitFieldWrite32 (
1867 return MmioWrite32 (
1869 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1874 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1875 writes the result back to the bit field in the 32-bit MMIO register.
1877 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1878 inclusive OR between the read result and the value specified by OrData, and
1879 writes the result to the 32-bit MMIO register specified by Address. The value
1880 written to the MMIO register is returned. This function must guarantee that
1881 all MMIO read and write operations are serialized. Extra left bits in OrData
1884 If 32-bit MMIO register operations are not supported, then ASSERT().
1885 If StartBit is greater than 31, then ASSERT().
1886 If EndBit is greater than 31, then ASSERT().
1887 If EndBit is less than StartBit, then ASSERT().
1889 @param Address MMIO register to write.
1890 @param StartBit The ordinal of the least significant bit in the bit field.
1892 @param EndBit The ordinal of the most significant bit in the bit field.
1894 @param OrData The value to OR with read value from the MMIO register.
1896 @return The value written back to the MMIO register.
1908 return MmioWrite32 (
1910 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1915 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1916 writes the result back to the bit field in the 32-bit MMIO register.
1918 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1919 between the read result and the value specified by AndData, and writes the
1920 result to the 32-bit MMIO register specified by Address. The value written to
1921 the MMIO register is returned. This function must guarantee that all MMIO
1922 read and write operations are serialized. Extra left bits in AndData are
1925 If 32-bit MMIO register operations are not supported, then ASSERT().
1926 If StartBit is greater than 31, then ASSERT().
1927 If EndBit is greater than 31, then ASSERT().
1928 If EndBit is less than StartBit, then ASSERT().
1930 @param Address MMIO register to write.
1931 @param StartBit The ordinal of the least significant bit in the bit field.
1933 @param EndBit The ordinal of the most significant bit in the bit field.
1935 @param AndData The value to AND with read value from the MMIO register.
1937 @return The value written back to the MMIO register.
1949 return MmioWrite32 (
1951 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1956 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1957 by a bitwise inclusive OR, and writes the result back to the bit field in the
1958 32-bit MMIO register.
1960 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1961 followed by a bitwise inclusive OR between the read result and the value
1962 specified by AndData, and writes the result to the 32-bit MMIO register
1963 specified by Address. The value written to the MMIO register is returned.
1964 This function must guarantee that all MMIO read and write operations are
1965 serialized. Extra left bits in both AndData and OrData are stripped.
1967 If 32-bit MMIO register operations are not supported, then ASSERT().
1968 If StartBit is greater than 31, then ASSERT().
1969 If EndBit is greater than 31, then ASSERT().
1970 If EndBit is less than StartBit, then ASSERT().
1972 @param Address MMIO register to write.
1973 @param StartBit The ordinal of the least significant bit in the bit field.
1975 @param EndBit The ordinal of the most significant bit in the bit field.
1977 @param AndData The value to AND with read value from the MMIO register.
1978 @param OrData The value to OR with the result of the AND operation.
1980 @return The value written back to the MMIO register.
1985 MmioBitFieldAndThenOr32 (
1993 return MmioWrite32 (
1995 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2000 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
2001 result back to the 64-bit MMIO register.
2003 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2004 inclusive OR between the read result and the value specified by OrData, and
2005 writes the result to the 64-bit MMIO register specified by Address. The value
2006 written to the MMIO register is returned. This function must guarantee that
2007 all MMIO read and write operations are serialized.
2009 If 64-bit MMIO register operations are not supported, then ASSERT().
2011 @param Address The MMIO register to write.
2012 @param OrData The value to OR with the read value from the MMIO register.
2014 @return The value written back to the MMIO register.
2024 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2028 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2029 back to the 64-bit MMIO register.
2031 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2032 between the read result and the value specified by AndData, and writes the
2033 result to the 64-bit MMIO register specified by Address. The value written to
2034 the MMIO register is returned. This function must guarantee that all MMIO
2035 read and write operations are serialized.
2037 If 64-bit MMIO register operations are not supported, then ASSERT().
2039 @param Address The MMIO register to write.
2040 @param AndData The value to AND with the read value from the MMIO register.
2042 @return The value written back to the MMIO register.
2052 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2056 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2057 inclusive OR, and writes the result back to the 64-bit MMIO register.
2059 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2060 between the read result and the value specified by AndData, performs a
2061 bitwise OR between the result of the AND operation and the value specified by
2062 OrData, and writes the result to the 64-bit MMIO register specified by
2063 Address. The value written to the MMIO register is returned. This function
2064 must guarantee that all MMIO read and write operations are serialized.
2066 If 64-bit MMIO register operations are not supported, then ASSERT().
2069 @param Address The MMIO register to write.
2070 @param AndData The value to AND with the read value from the MMIO register.
2071 @param OrData The value to OR with the result of the AND operation.
2073 @return The value written back to the MMIO register.
2084 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2088 Reads a bit field of a MMIO register.
2090 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2091 the StartBit and the EndBit. The value of the bit field is returned.
2093 If 64-bit MMIO register operations are not supported, then ASSERT().
2094 If StartBit is greater than 63, then ASSERT().
2095 If EndBit is greater than 63, then ASSERT().
2096 If EndBit is less than StartBit, then ASSERT().
2098 @param Address MMIO register to read.
2099 @param StartBit The ordinal of the least significant bit in the bit field.
2101 @param EndBit The ordinal of the most significant bit in the bit field.
2104 @return The value read from I/O port specified by StartBit and
2110 MmioBitFieldRead64 (
2116 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2120 Writes a bit field to a MMIO register.
2122 Writes Value to the bit field of the MMIO register. The bit field is
2123 specified by the StartBit and the EndBit. All other bits in the destination
2124 MMIO register are preserved. The new value of the 64-bit register is returned.
2126 If 64-bit MMIO register operations are not supported, then ASSERT().
2127 If StartBit is greater than 63, then ASSERT().
2128 If EndBit is greater than 63, then ASSERT().
2129 If EndBit is less than StartBit, then ASSERT().
2131 @param Address MMIO register to write.
2132 @param StartBit The ordinal of the least significant bit in the bit field.
2134 @param EndBit The ordinal of the most significant bit in the bit field.
2136 @param Value New value of the bit field.
2138 @return The value written back to the MMIO register.
2143 MmioBitFieldWrite64 (
2150 return MmioWrite64 (
2152 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2157 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2158 writes the result back to the bit field in the 64-bit MMIO register.
2160 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2161 inclusive OR between the read result and the value specified by OrData, and
2162 writes the result to the 64-bit MMIO register specified by Address. The value
2163 written to the MMIO register is returned. This function must guarantee that
2164 all MMIO read and write operations are serialized. Extra left bits in OrData
2167 If 64-bit MMIO register operations are not supported, then ASSERT().
2168 If StartBit is greater than 63, then ASSERT().
2169 If EndBit is greater than 63, then ASSERT().
2170 If EndBit is less than StartBit, then ASSERT().
2172 @param Address MMIO register to write.
2173 @param StartBit The ordinal of the least significant bit in the bit field.
2175 @param EndBit The ordinal of the most significant bit in the bit field.
2177 @param OrData The value to OR with read value from the MMIO register.
2179 @return The value written back to the MMIO register.
2191 return MmioWrite64 (
2193 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2198 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2199 writes the result back to the bit field in the 64-bit MMIO register.
2201 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2202 between the read result and the value specified by AndData, and writes the
2203 result to the 64-bit MMIO register specified by Address. The value written to
2204 the MMIO register is returned. This function must guarantee that all MMIO
2205 read and write operations are serialized. Extra left bits in AndData are
2208 If 64-bit MMIO register operations are not supported, then ASSERT().
2209 If StartBit is greater than 63, then ASSERT().
2210 If EndBit is greater than 63, then ASSERT().
2211 If EndBit is less than StartBit, then ASSERT().
2213 @param Address MMIO register to write.
2214 @param StartBit The ordinal of the least significant bit in the bit field.
2216 @param EndBit The ordinal of the most significant bit in the bit field.
2218 @param AndData The value to AND with read value from the MMIO register.
2220 @return The value written back to the MMIO register.
2232 return MmioWrite64 (
2234 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2239 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2240 by a bitwise inclusive OR, and writes the result back to the bit field in the
2241 64-bit MMIO register.
2243 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2244 followed by a bitwise inclusive OR between the read result and the value
2245 specified by AndData, and writes the result to the 64-bit MMIO register
2246 specified by Address. The value written to the MMIO register is returned.
2247 This function must guarantee that all MMIO read and write operations are
2248 serialized. Extra left bits in both AndData and OrData are stripped.
2250 If 64-bit MMIO register operations are not supported, then ASSERT().
2251 If StartBit is greater than 63, then ASSERT().
2252 If EndBit is greater than 63, then ASSERT().
2253 If EndBit is less than StartBit, then ASSERT().
2255 @param Address MMIO register to write.
2256 @param StartBit The ordinal of the least significant bit in the bit field.
2258 @param EndBit The ordinal of the most significant bit in the bit field.
2260 @param AndData The value to AND with read value from the MMIO register.
2261 @param OrData The value to OR with the result of the AND operation.
2263 @return The value written back to the MMIO register.
2268 MmioBitFieldAndThenOr64 (
2276 return MmioWrite64 (
2278 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)