]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoHighLevel.c
3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 High-level Io/Mmio functions.
21 All assertions for bit field operations are handled bit field functions in the
24 The following IoLib instances share the same version of this file:
32 #include "EdkIIGlueBase.h"
35 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
36 result back to the 8-bit I/O port.
38 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
39 between the read result and the value specified by OrData, and writes the
40 result to the 8-bit I/O port specified by Port. The value written to the I/O
41 port is returned. This function must guarantee that all I/O read and write
42 operations are serialized.
44 If 8-bit I/O port operations are not supported, then ASSERT().
46 @param Port The I/O port to write.
47 @param OrData The value to OR with the read value from the I/O port.
49 @return The value written back to the I/O port.
59 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
63 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
64 to the 8-bit I/O port.
66 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
67 the read result and the value specified by AndData, and writes the result to
68 the 8-bit I/O port specified by Port. The value written to the I/O port is
69 returned. This function must guarantee that all I/O read and write operations
72 If 8-bit I/O port operations are not supported, then ASSERT().
74 @param Port The I/O port to write.
75 @param AndData The value to AND with the read value from the I/O port.
77 @return The value written back to the I/O port.
87 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
91 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
92 inclusive OR, and writes the result back to the 8-bit I/O port.
94 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
95 the read result and the value specified by AndData, performs a bitwise OR
96 between the result of the AND operation and the value specified by OrData,
97 and writes the result to the 8-bit I/O port specified by Port. The value
98 written to the I/O port is returned. This function must guarantee that all
99 I/O read and write operations are serialized.
101 If 8-bit I/O port operations are not supported, then ASSERT().
103 @param Port The I/O port to write.
104 @param AndData The value to AND with the read value from the I/O port.
105 @param OrData The value to OR with the result of the AND operation.
107 @return The value written back to the I/O port.
118 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
122 Reads a bit field of an I/O register.
124 Reads the bit field in an 8-bit I/O register. The bit field is specified by
125 the StartBit and the EndBit. The value of the bit field is returned.
127 If 8-bit I/O port operations are not supported, then ASSERT().
128 If StartBit is greater than 7, then ASSERT().
129 If EndBit is greater than 7, then ASSERT().
130 If EndBit is less than StartBit, then ASSERT().
132 @param Port The I/O port to read.
133 @param StartBit The ordinal of the least significant bit in the bit field.
135 @param EndBit The ordinal of the most significant bit in the bit field.
138 @return The value read.
149 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
153 Writes a bit field to an I/O register.
155 Writes Value to the bit field of the I/O register. The bit field is specified
156 by the StartBit and the EndBit. All other bits in the destination I/O
157 register are preserved. The value written to the I/O port is returned. Extra
158 left bits in Value are stripped.
160 If 8-bit I/O port operations are not supported, then ASSERT().
161 If StartBit is greater than 7, then ASSERT().
162 If EndBit is greater than 7, then ASSERT().
163 If EndBit is less than StartBit, then ASSERT().
165 @param Port The I/O port to write.
166 @param StartBit The ordinal of the least significant bit in the bit field.
168 @param EndBit The ordinal of the most significant bit in the bit field.
170 @param Value New value of the bit field.
172 @return The value written back to the I/O port.
186 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
191 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
192 result back to the bit field in the 8-bit port.
194 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
195 between the read result and the value specified by OrData, and writes the
196 result to the 8-bit I/O port specified by Port. The value written to the I/O
197 port is returned. This function must guarantee that all I/O read and write
198 operations are serialized. Extra left bits in OrData are stripped.
200 If 8-bit I/O port operations are not supported, then ASSERT().
201 If StartBit is greater than 7, then ASSERT().
202 If EndBit is greater than 7, then ASSERT().
203 If EndBit is less than StartBit, then ASSERT().
205 @param Port The I/O port to write.
206 @param StartBit The ordinal of the least significant bit in the bit field.
208 @param EndBit The ordinal of the most significant bit in the bit field.
210 @param OrData The value to OR with the read value from the I/O port.
212 @return The value written back to the I/O port.
226 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
231 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
232 result back to the bit field in the 8-bit port.
234 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
235 the read result and the value specified by AndData, and writes the result to
236 the 8-bit I/O port specified by Port. The value written to the I/O port is
237 returned. This function must guarantee that all I/O read and write operations
238 are serialized. Extra left bits in AndData are stripped.
240 If 8-bit I/O port operations are not supported, then ASSERT().
241 If StartBit is greater than 7, then ASSERT().
242 If EndBit is greater than 7, then ASSERT().
243 If EndBit is less than StartBit, then ASSERT().
245 @param Port The I/O port to write.
246 @param StartBit The ordinal of the least significant bit in the bit field.
248 @param EndBit The ordinal of the most significant bit in the bit field.
250 @param AndData The value to AND with the read value from the I/O port.
252 @return The value written back to the I/O port.
266 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
271 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
272 bitwise inclusive OR, and writes the result back to the bit field in the
275 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
276 by a bitwise inclusive OR between the read result and the value specified by
277 AndData, and writes the result to the 8-bit I/O port specified by Port. The
278 value written to the I/O port is returned. This function must guarantee that
279 all I/O read and write operations are serialized. Extra left bits in both
280 AndData and OrData are stripped.
282 If 8-bit I/O port operations are not supported, then ASSERT().
283 If StartBit is greater than 7, then ASSERT().
284 If EndBit is greater than 7, then ASSERT().
285 If EndBit is less than StartBit, then ASSERT().
287 @param Port The I/O port to write.
288 @param StartBit The ordinal of the least significant bit in the bit field.
290 @param EndBit The ordinal of the most significant bit in the bit field.
292 @param AndData The value to AND with the read value from the I/O port.
293 @param OrData The value to OR with the result of the AND operation.
295 @return The value written back to the I/O port.
300 IoBitFieldAndThenOr8 (
310 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
315 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
316 result back to the 16-bit I/O port.
318 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
319 between the read result and the value specified by OrData, and writes the
320 result to the 16-bit I/O port specified by Port. The value written to the I/O
321 port is returned. This function must guarantee that all I/O read and write
322 operations are serialized.
324 If 16-bit I/O port operations are not supported, then ASSERT().
326 @param Port The I/O port to write.
327 @param OrData The value to OR with the read value from the I/O port.
329 @return The value written back to the I/O port.
339 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
343 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
344 to the 16-bit I/O port.
346 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
347 the read result and the value specified by AndData, and writes the result to
348 the 16-bit I/O port specified by Port. The value written to the I/O port is
349 returned. This function must guarantee that all I/O read and write operations
352 If 16-bit I/O port operations are not supported, then ASSERT().
354 @param Port The I/O port to write.
355 @param AndData The value to AND with the read value from the I/O port.
357 @return The value written back to the I/O port.
367 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
371 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
372 inclusive OR, and writes the result back to the 16-bit I/O port.
374 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
375 the read result and the value specified by AndData, performs a bitwise OR
376 between the result of the AND operation and the value specified by OrData,
377 and writes the result to the 16-bit I/O port specified by Port. The value
378 written to the I/O port is returned. This function must guarantee that all
379 I/O read and write operations are serialized.
381 If 16-bit I/O port operations are not supported, then ASSERT().
383 @param Port The I/O port to write.
384 @param AndData The value to AND with the read value from the I/O port.
385 @param OrData The value to OR with the result of the AND operation.
387 @return The value written back to the I/O port.
398 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
402 Reads a bit field of an I/O register.
404 Reads the bit field in a 16-bit I/O register. The bit field is specified by
405 the StartBit and the EndBit. The value of the bit field is returned.
407 If 16-bit I/O port operations are not supported, then ASSERT().
408 If StartBit is greater than 15, then ASSERT().
409 If EndBit is greater than 15, then ASSERT().
410 If EndBit is less than StartBit, then ASSERT().
412 @param Port The I/O port to read.
413 @param StartBit The ordinal of the least significant bit in the bit field.
415 @param EndBit The ordinal of the most significant bit in the bit field.
418 @return The value read.
429 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
433 Writes a bit field to an I/O register.
435 Writes Value to the bit field of the I/O register. The bit field is specified
436 by the StartBit and the EndBit. All other bits in the destination I/O
437 register are preserved. The value written to the I/O port is returned. Extra
438 left bits in Value are stripped.
440 If 16-bit I/O port operations are not supported, then ASSERT().
441 If StartBit is greater than 15, then ASSERT().
442 If EndBit is greater than 15, then ASSERT().
443 If EndBit is less than StartBit, then ASSERT().
445 @param Port The I/O port to write.
446 @param StartBit The ordinal of the least significant bit in the bit field.
448 @param EndBit The ordinal of the most significant bit in the bit field.
450 @param Value New value of the bit field.
452 @return The value written back to the I/O port.
466 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
471 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
472 result back to the bit field in the 16-bit port.
474 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
475 between the read result and the value specified by OrData, and writes the
476 result to the 16-bit I/O port specified by Port. The value written to the I/O
477 port is returned. This function must guarantee that all I/O read and write
478 operations are serialized. Extra left bits in OrData are stripped.
480 If 16-bit I/O port operations are not supported, then ASSERT().
481 If StartBit is greater than 15, then ASSERT().
482 If EndBit is greater than 15, then ASSERT().
483 If EndBit is less than StartBit, then ASSERT().
485 @param Port The I/O port to write.
486 @param StartBit The ordinal of the least significant bit in the bit field.
488 @param EndBit The ordinal of the most significant bit in the bit field.
490 @param OrData The value to OR with the read value from the I/O port.
492 @return The value written back to the I/O port.
506 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
511 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
512 result back to the bit field in the 16-bit port.
514 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
515 the read result and the value specified by AndData, and writes the result to
516 the 16-bit I/O port specified by Port. The value written to the I/O port is
517 returned. This function must guarantee that all I/O read and write operations
518 are serialized. Extra left bits in AndData are stripped.
520 If 16-bit I/O port operations are not supported, then ASSERT().
521 If StartBit is greater than 15, then ASSERT().
522 If EndBit is greater than 15, then ASSERT().
523 If EndBit is less than StartBit, then ASSERT().
525 @param Port The I/O port to write.
526 @param StartBit The ordinal of the least significant bit in the bit field.
528 @param EndBit The ordinal of the most significant bit in the bit field.
530 @param AndData The value to AND with the read value from the I/O port.
532 @return The value written back to the I/O port.
546 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
551 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
552 bitwise inclusive OR, and writes the result back to the bit field in the
555 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
556 by a bitwise inclusive OR between the read result and the value specified by
557 AndData, and writes the result to the 16-bit I/O port specified by Port. The
558 value written to the I/O port is returned. This function must guarantee that
559 all I/O read and write operations are serialized. Extra left bits in both
560 AndData and OrData are stripped.
562 If 16-bit I/O port operations are not supported, then ASSERT().
563 If StartBit is greater than 15, then ASSERT().
564 If EndBit is greater than 15, then ASSERT().
565 If EndBit is less than StartBit, then ASSERT().
567 @param Port The I/O port to write.
568 @param StartBit The ordinal of the least significant bit in the bit field.
570 @param EndBit The ordinal of the most significant bit in the bit field.
572 @param AndData The value to AND with the read value from the I/O port.
573 @param OrData The value to OR with the result of the AND operation.
575 @return The value written back to the I/O port.
580 IoBitFieldAndThenOr16 (
590 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
595 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
596 result back to the 32-bit I/O port.
598 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
599 between the read result and the value specified by OrData, and writes the
600 result to the 32-bit I/O port specified by Port. The value written to the I/O
601 port is returned. This function must guarantee that all I/O read and write
602 operations are serialized.
604 If 32-bit I/O port operations are not supported, then ASSERT().
606 @param Port The I/O port to write.
607 @param OrData The value to OR with the read value from the I/O port.
609 @return The value written back to the I/O port.
619 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
623 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
624 to the 32-bit I/O port.
626 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
627 the read result and the value specified by AndData, and writes the result to
628 the 32-bit I/O port specified by Port. The value written to the I/O port is
629 returned. This function must guarantee that all I/O read and write operations
632 If 32-bit I/O port operations are not supported, then ASSERT().
634 @param Port The I/O port to write.
635 @param AndData The value to AND with the read value from the I/O port.
637 @return The value written back to the I/O port.
647 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
651 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
652 inclusive OR, and writes the result back to the 32-bit I/O port.
654 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
655 the read result and the value specified by AndData, performs a bitwise OR
656 between the result of the AND operation and the value specified by OrData,
657 and writes the result to the 32-bit I/O port specified by Port. The value
658 written to the I/O port is returned. This function must guarantee that all
659 I/O read and write operations are serialized.
661 If 32-bit I/O port operations are not supported, then ASSERT().
663 @param Port The I/O port to write.
664 @param AndData The value to AND with the read value from the I/O port.
665 @param OrData The value to OR with the result of the AND operation.
667 @return The value written back to the I/O port.
678 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
682 Reads a bit field of an I/O register.
684 Reads the bit field in a 32-bit I/O register. The bit field is specified by
685 the StartBit and the EndBit. The value of the bit field is returned.
687 If 32-bit I/O port operations are not supported, then ASSERT().
688 If StartBit is greater than 31, then ASSERT().
689 If EndBit is greater than 31, then ASSERT().
690 If EndBit is less than StartBit, then ASSERT().
692 @param Port The I/O port to read.
693 @param StartBit The ordinal of the least significant bit in the bit field.
695 @param EndBit The ordinal of the most significant bit in the bit field.
698 @return The value read.
709 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
713 Writes a bit field to an I/O register.
715 Writes Value to the bit field of the I/O register. The bit field is specified
716 by the StartBit and the EndBit. All other bits in the destination I/O
717 register are preserved. The value written to the I/O port is returned. Extra
718 left bits in Value are stripped.
720 If 32-bit I/O port operations are not supported, then ASSERT().
721 If StartBit is greater than 31, then ASSERT().
722 If EndBit is greater than 31, then ASSERT().
723 If EndBit is less than StartBit, then ASSERT().
725 @param Port The I/O port to write.
726 @param StartBit The ordinal of the least significant bit in the bit field.
728 @param EndBit The ordinal of the most significant bit in the bit field.
730 @param Value New value of the bit field.
732 @return The value written back to the I/O port.
746 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
751 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
752 result back to the bit field in the 32-bit port.
754 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
755 between the read result and the value specified by OrData, and writes the
756 result to the 32-bit I/O port specified by Port. The value written to the I/O
757 port is returned. This function must guarantee that all I/O read and write
758 operations are serialized. Extra left bits in OrData are stripped.
760 If 32-bit I/O port operations are not supported, then ASSERT().
761 If StartBit is greater than 31, then ASSERT().
762 If EndBit is greater than 31, then ASSERT().
763 If EndBit is less than StartBit, then ASSERT().
765 @param Port The I/O port to write.
766 @param StartBit The ordinal of the least significant bit in the bit field.
768 @param EndBit The ordinal of the most significant bit in the bit field.
770 @param OrData The value to OR with the read value from the I/O port.
772 @return The value written back to the I/O port.
786 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
791 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
792 result back to the bit field in the 32-bit port.
794 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
795 the read result and the value specified by AndData, and writes the result to
796 the 32-bit I/O port specified by Port. The value written to the I/O port is
797 returned. This function must guarantee that all I/O read and write operations
798 are serialized. Extra left bits in AndData are stripped.
800 If 32-bit I/O port operations are not supported, then ASSERT().
801 If StartBit is greater than 31, then ASSERT().
802 If EndBit is greater than 31, then ASSERT().
803 If EndBit is less than StartBit, then ASSERT().
805 @param Port The I/O port to write.
806 @param StartBit The ordinal of the least significant bit in the bit field.
808 @param EndBit The ordinal of the most significant bit in the bit field.
810 @param AndData The value to AND with the read value from the I/O port.
812 @return The value written back to the I/O port.
826 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
831 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
832 bitwise inclusive OR, and writes the result back to the bit field in the
835 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
836 by a bitwise inclusive OR between the read result and the value specified by
837 AndData, and writes the result to the 32-bit I/O port specified by Port. The
838 value written to the I/O port is returned. This function must guarantee that
839 all I/O read and write operations are serialized. Extra left bits in both
840 AndData and OrData are stripped.
842 If 32-bit I/O port operations are not supported, then ASSERT().
843 If StartBit is greater than 31, then ASSERT().
844 If EndBit is greater than 31, then ASSERT().
845 If EndBit is less than StartBit, then ASSERT().
847 @param Port The I/O port to write.
848 @param StartBit The ordinal of the least significant bit in the bit field.
850 @param EndBit The ordinal of the most significant bit in the bit field.
852 @param AndData The value to AND with the read value from the I/O port.
853 @param OrData The value to OR with the result of the AND operation.
855 @return The value written back to the I/O port.
860 IoBitFieldAndThenOr32 (
870 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
875 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
876 result back to the 64-bit I/O port.
878 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
879 between the read result and the value specified by OrData, and writes the
880 result to the 64-bit I/O port specified by Port. The value written to the I/O
881 port is returned. This function must guarantee that all I/O read and write
882 operations are serialized.
884 If 64-bit I/O port operations are not supported, then ASSERT().
886 @param Port The I/O port to write.
887 @param OrData The value to OR with the read value from the I/O port.
889 @return The value written back to the I/O port.
899 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
903 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
904 to the 64-bit I/O port.
906 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
907 the read result and the value specified by AndData, and writes the result to
908 the 64-bit I/O port specified by Port. The value written to the I/O port is
909 returned. This function must guarantee that all I/O read and write operations
912 If 64-bit I/O port operations are not supported, then ASSERT().
914 @param Port The I/O port to write.
915 @param AndData The value to AND with the read value from the I/O port.
917 @return The value written back to the I/O port.
927 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
931 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
932 inclusive OR, and writes the result back to the 64-bit I/O port.
934 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
935 the read result and the value specified by AndData, performs a bitwise OR
936 between the result of the AND operation and the value specified by OrData,
937 and writes the result to the 64-bit I/O port specified by Port. The value
938 written to the I/O port is returned. This function must guarantee that all
939 I/O read and write operations are serialized.
941 If 64-bit I/O port operations are not supported, then ASSERT().
943 @param Port The I/O port to write.
944 @param AndData The value to AND with the read value from the I/O port.
945 @param OrData The value to OR with the result of the AND operation.
947 @return The value written back to the I/O port.
958 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
962 Reads a bit field of an I/O register.
964 Reads the bit field in a 64-bit I/O register. The bit field is specified by
965 the StartBit and the EndBit. The value of the bit field is returned.
967 If 64-bit I/O port operations are not supported, then ASSERT().
968 If StartBit is greater than 63, then ASSERT().
969 If EndBit is greater than 63, then ASSERT().
970 If EndBit is less than StartBit, then ASSERT().
972 @param Port The I/O port to read.
973 @param StartBit The ordinal of the least significant bit in the bit field.
975 @param EndBit The ordinal of the most significant bit in the bit field.
978 @return The value read.
989 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
993 Writes a bit field to an I/O register.
995 Writes Value to the bit field of the I/O register. The bit field is specified
996 by the StartBit and the EndBit. All other bits in the destination I/O
997 register are preserved. The value written to the I/O port is returned. Extra
998 left bits in Value are stripped.
1000 If 64-bit I/O port operations are not supported, then ASSERT().
1001 If StartBit is greater than 63, then ASSERT().
1002 If EndBit is greater than 63, then ASSERT().
1003 If EndBit is less than StartBit, then ASSERT().
1005 @param Port The I/O port to write.
1006 @param StartBit The ordinal of the least significant bit in the bit field.
1008 @param EndBit The ordinal of the most significant bit in the bit field.
1010 @param Value New value of the bit field.
1012 @return The value written back to the I/O port.
1026 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1031 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1032 result back to the bit field in the 64-bit port.
1034 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1035 between the read result and the value specified by OrData, and writes the
1036 result to the 64-bit I/O port specified by Port. The value written to the I/O
1037 port is returned. This function must guarantee that all I/O read and write
1038 operations are serialized. Extra left bits in OrData are stripped.
1040 If 64-bit I/O port operations are not supported, then ASSERT().
1041 If StartBit is greater than 63, then ASSERT().
1042 If EndBit is greater than 63, then ASSERT().
1043 If EndBit is less than StartBit, then ASSERT().
1045 @param Port The I/O port to write.
1046 @param StartBit The ordinal of the least significant bit in the bit field.
1048 @param EndBit The ordinal of the most significant bit in the bit field.
1050 @param OrData The value to OR with the read value from the I/O port.
1052 @return The value written back to the I/O port.
1066 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1071 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1072 result back to the bit field in the 64-bit port.
1074 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1075 the read result and the value specified by AndData, and writes the result to
1076 the 64-bit I/O port specified by Port. The value written to the I/O port is
1077 returned. This function must guarantee that all I/O read and write operations
1078 are serialized. Extra left bits in AndData are stripped.
1080 If 64-bit I/O port operations are not supported, then ASSERT().
1081 If StartBit is greater than 63, then ASSERT().
1082 If EndBit is greater than 63, then ASSERT().
1083 If EndBit is less than StartBit, then ASSERT().
1085 @param Port The I/O port to write.
1086 @param StartBit The ordinal of the least significant bit in the bit field.
1088 @param EndBit The ordinal of the most significant bit in the bit field.
1090 @param AndData The value to AND with the read value from the I/O port.
1092 @return The value written back to the I/O port.
1106 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1111 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1112 bitwise inclusive OR, and writes the result back to the bit field in the
1115 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1116 by a bitwise inclusive OR between the read result and the value specified by
1117 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1118 value written to the I/O port is returned. This function must guarantee that
1119 all I/O read and write operations are serialized. Extra left bits in both
1120 AndData and OrData are stripped.
1122 If 64-bit I/O port operations are not supported, then ASSERT().
1123 If StartBit is greater than 63, then ASSERT().
1124 If EndBit is greater than 63, then ASSERT().
1125 If EndBit is less than StartBit, then ASSERT().
1127 @param Port The I/O port to write.
1128 @param StartBit The ordinal of the least significant bit in the bit field.
1130 @param EndBit The ordinal of the most significant bit in the bit field.
1132 @param AndData The value to AND with the read value from the I/O port.
1133 @param OrData The value to OR with the result of the AND operation.
1135 @return The value written back to the I/O port.
1140 IoBitFieldAndThenOr64 (
1150 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1155 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1156 result back to the 8-bit MMIO register.
1158 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1159 inclusive OR between the read result and the value specified by OrData, and
1160 writes the result to the 8-bit MMIO register specified by Address. The value
1161 written to the MMIO register is returned. This function must guarantee that
1162 all MMIO read and write operations are serialized.
1164 If 8-bit MMIO register operations are not supported, then ASSERT().
1166 @param Address The MMIO register to write.
1167 @param OrData The value to OR with the read value from the MMIO register.
1169 @return The value written back to the MMIO register.
1179 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1183 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1184 back to the 8-bit MMIO register.
1186 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1187 between the read result and the value specified by AndData, and writes the
1188 result to the 8-bit MMIO register specified by Address. The value written to
1189 the MMIO register is returned. This function must guarantee that all MMIO
1190 read and write operations are serialized.
1192 If 8-bit MMIO register operations are not supported, then ASSERT().
1194 @param Address The MMIO register to write.
1195 @param AndData The value to AND with the read value from the MMIO register.
1197 @return The value written back to the MMIO register.
1207 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1211 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1212 inclusive OR, and writes the result back to the 8-bit MMIO register.
1214 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1215 between the read result and the value specified by AndData, performs a
1216 bitwise OR between the result of the AND operation and the value specified by
1217 OrData, and writes the result to the 8-bit MMIO register specified by
1218 Address. The value written to the MMIO register is returned. This function
1219 must guarantee that all MMIO read and write operations are serialized.
1221 If 8-bit MMIO register operations are not supported, then ASSERT().
1224 @param Address The MMIO register to write.
1225 @param AndData The value to AND with the read value from the MMIO register.
1226 @param OrData The value to OR with the result of the AND operation.
1228 @return The value written back to the MMIO register.
1239 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1243 Reads a bit field of a MMIO register.
1245 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1246 the StartBit and the EndBit. The value of the bit field is returned.
1248 If 8-bit MMIO register operations are not supported, then ASSERT().
1249 If StartBit is greater than 7, then ASSERT().
1250 If EndBit is greater than 7, then ASSERT().
1251 If EndBit is less than StartBit, then ASSERT().
1253 @param Address MMIO register to read.
1254 @param StartBit The ordinal of the least significant bit in the bit field.
1256 @param EndBit The ordinal of the most significant bit in the bit field.
1259 @return The value read.
1270 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1274 Writes a bit field to a MMIO register.
1276 Writes Value to the bit field of the MMIO register. The bit field is
1277 specified by the StartBit and the EndBit. All other bits in the destination
1278 MMIO register are preserved. The new value of the 8-bit register is returned.
1280 If 8-bit MMIO register operations are not supported, then ASSERT().
1281 If StartBit is greater than 7, then ASSERT().
1282 If EndBit is greater than 7, then ASSERT().
1283 If EndBit is less than StartBit, then ASSERT().
1285 @param Address MMIO register to write.
1286 @param StartBit The ordinal of the least significant bit in the bit field.
1288 @param EndBit The ordinal of the most significant bit in the bit field.
1290 @param Value New value of the bit field.
1292 @return The value written back to the MMIO register.
1297 MmioBitFieldWrite8 (
1306 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1311 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1312 writes the result back to the bit field in the 8-bit MMIO register.
1314 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1315 inclusive OR between the read result and the value specified by OrData, and
1316 writes the result to the 8-bit MMIO register specified by Address. The value
1317 written to the MMIO register is returned. This function must guarantee that
1318 all MMIO read and write operations are serialized. Extra left bits in OrData
1321 If 8-bit MMIO register operations are not supported, then ASSERT().
1322 If StartBit is greater than 7, then ASSERT().
1323 If EndBit is greater than 7, then ASSERT().
1324 If EndBit is less than StartBit, then ASSERT().
1326 @param Address MMIO register to write.
1327 @param StartBit The ordinal of the least significant bit in the bit field.
1329 @param EndBit The ordinal of the most significant bit in the bit field.
1331 @param OrData The value to OR with read value from the MMIO register.
1333 @return The value written back to the MMIO register.
1347 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1352 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1353 writes the result back to the bit field in the 8-bit MMIO register.
1355 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1356 between the read result and the value specified by AndData, and writes the
1357 result to the 8-bit MMIO register specified by Address. The value written to
1358 the MMIO register is returned. This function must guarantee that all MMIO
1359 read and write operations are serialized. Extra left bits in AndData are
1362 If 8-bit MMIO register operations are not supported, then ASSERT().
1363 If StartBit is greater than 7, then ASSERT().
1364 If EndBit is greater than 7, then ASSERT().
1365 If EndBit is less than StartBit, then ASSERT().
1367 @param Address MMIO register to write.
1368 @param StartBit The ordinal of the least significant bit in the bit field.
1370 @param EndBit The ordinal of the most significant bit in the bit field.
1372 @param AndData The value to AND with read value from the MMIO register.
1374 @return The value written back to the MMIO register.
1388 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1393 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1394 by a bitwise inclusive OR, and writes the result back to the bit field in the
1395 8-bit MMIO register.
1397 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1398 followed by a bitwise inclusive OR between the read result and the value
1399 specified by AndData, and writes the result to the 8-bit MMIO register
1400 specified by Address. The value written to the MMIO register is returned.
1401 This function must guarantee that all MMIO read and write operations are
1402 serialized. Extra left bits in both AndData and OrData are stripped.
1404 If 8-bit MMIO register operations are not supported, then ASSERT().
1405 If StartBit is greater than 7, then ASSERT().
1406 If EndBit is greater than 7, then ASSERT().
1407 If EndBit is less than StartBit, then ASSERT().
1409 @param Address MMIO register to write.
1410 @param StartBit The ordinal of the least significant bit in the bit field.
1412 @param EndBit The ordinal of the most significant bit in the bit field.
1414 @param AndData The value to AND with read value from the MMIO register.
1415 @param OrData The value to OR with the result of the AND operation.
1417 @return The value written back to the MMIO register.
1422 MmioBitFieldAndThenOr8 (
1432 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1437 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1438 result back to the 16-bit MMIO register.
1440 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1441 inclusive OR between the read result and the value specified by OrData, and
1442 writes the result to the 16-bit MMIO register specified by Address. The value
1443 written to the MMIO register is returned. This function must guarantee that
1444 all MMIO read and write operations are serialized.
1446 If 16-bit MMIO register operations are not supported, then ASSERT().
1448 @param Address The MMIO register to write.
1449 @param OrData The value to OR with the read value from the MMIO register.
1451 @return The value written back to the MMIO register.
1461 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1465 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1466 back to the 16-bit MMIO register.
1468 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1469 between the read result and the value specified by AndData, and writes the
1470 result to the 16-bit MMIO register specified by Address. The value written to
1471 the MMIO register is returned. This function must guarantee that all MMIO
1472 read and write operations are serialized.
1474 If 16-bit MMIO register operations are not supported, then ASSERT().
1476 @param Address The MMIO register to write.
1477 @param AndData The value to AND with the read value from the MMIO register.
1479 @return The value written back to the MMIO register.
1489 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1493 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1494 inclusive OR, and writes the result back to the 16-bit MMIO register.
1496 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1497 between the read result and the value specified by AndData, performs a
1498 bitwise OR between the result of the AND operation and the value specified by
1499 OrData, and writes the result to the 16-bit MMIO register specified by
1500 Address. The value written to the MMIO register is returned. This function
1501 must guarantee that all MMIO read and write operations are serialized.
1503 If 16-bit MMIO register operations are not supported, then ASSERT().
1506 @param Address The MMIO register to write.
1507 @param AndData The value to AND with the read value from the MMIO register.
1508 @param OrData The value to OR with the result of the AND operation.
1510 @return The value written back to the MMIO register.
1521 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1525 Reads a bit field of a MMIO register.
1527 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1528 the StartBit and the EndBit. The value of the bit field is returned.
1530 If 16-bit MMIO register operations are not supported, then ASSERT().
1531 If StartBit is greater than 15, then ASSERT().
1532 If EndBit is greater than 15, then ASSERT().
1533 If EndBit is less than StartBit, then ASSERT().
1535 @param Address MMIO register to read.
1536 @param StartBit The ordinal of the least significant bit in the bit field.
1538 @param EndBit The ordinal of the most significant bit in the bit field.
1541 @return The value read.
1546 MmioBitFieldRead16 (
1552 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1556 Writes a bit field to a MMIO register.
1558 Writes Value to the bit field of the MMIO register. The bit field is
1559 specified by the StartBit and the EndBit. All other bits in the destination
1560 MMIO register are preserved. The new value of the 16-bit register is returned.
1562 If 16-bit MMIO register operations are not supported, then ASSERT().
1563 If StartBit is greater than 15, then ASSERT().
1564 If EndBit is greater than 15, then ASSERT().
1565 If EndBit is less than StartBit, then ASSERT().
1567 @param Address MMIO register to write.
1568 @param StartBit The ordinal of the least significant bit in the bit field.
1570 @param EndBit The ordinal of the most significant bit in the bit field.
1572 @param Value New value of the bit field.
1574 @return The value written back to the MMIO register.
1579 MmioBitFieldWrite16 (
1586 return MmioWrite16 (
1588 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1593 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1594 writes the result back to the bit field in the 16-bit MMIO register.
1596 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1597 inclusive OR between the read result and the value specified by OrData, and
1598 writes the result to the 16-bit MMIO register specified by Address. The value
1599 written to the MMIO register is returned. This function must guarantee that
1600 all MMIO read and write operations are serialized. Extra left bits in OrData
1603 If 16-bit MMIO register operations are not supported, then ASSERT().
1604 If StartBit is greater than 15, then ASSERT().
1605 If EndBit is greater than 15, then ASSERT().
1606 If EndBit is less than StartBit, then ASSERT().
1608 @param Address MMIO register to write.
1609 @param StartBit The ordinal of the least significant bit in the bit field.
1611 @param EndBit The ordinal of the most significant bit in the bit field.
1613 @param OrData The value to OR with read value from the MMIO register.
1615 @return The value written back to the MMIO register.
1627 return MmioWrite16 (
1629 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1634 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1635 writes the result back to the bit field in the 16-bit MMIO register.
1637 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1638 between the read result and the value specified by AndData, and writes the
1639 result to the 16-bit MMIO register specified by Address. The value written to
1640 the MMIO register is returned. This function must guarantee that all MMIO
1641 read and write operations are serialized. Extra left bits in AndData are
1644 If 16-bit MMIO register operations are not supported, then ASSERT().
1645 If StartBit is greater than 15, then ASSERT().
1646 If EndBit is greater than 15, then ASSERT().
1647 If EndBit is less than StartBit, then ASSERT().
1649 @param Address MMIO register to write.
1650 @param StartBit The ordinal of the least significant bit in the bit field.
1652 @param EndBit The ordinal of the most significant bit in the bit field.
1654 @param AndData The value to AND with read value from the MMIO register.
1656 @return The value written back to the MMIO register.
1668 return MmioWrite16 (
1670 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1675 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1676 by a bitwise inclusive OR, and writes the result back to the bit field in the
1677 16-bit MMIO register.
1679 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1680 followed by a bitwise inclusive OR between the read result and the value
1681 specified by AndData, and writes the result to the 16-bit MMIO register
1682 specified by Address. The value written to the MMIO register is returned.
1683 This function must guarantee that all MMIO read and write operations are
1684 serialized. Extra left bits in both AndData and OrData are stripped.
1686 If 16-bit MMIO register operations are not supported, then ASSERT().
1687 If StartBit is greater than 15, then ASSERT().
1688 If EndBit is greater than 15, then ASSERT().
1689 If EndBit is less than StartBit, then ASSERT().
1691 @param Address MMIO register to write.
1692 @param StartBit The ordinal of the least significant bit in the bit field.
1694 @param EndBit The ordinal of the most significant bit in the bit field.
1696 @param AndData The value to AND with read value from the MMIO register.
1697 @param OrData The value to OR with the result of the AND operation.
1699 @return The value written back to the MMIO register.
1704 MmioBitFieldAndThenOr16 (
1712 return MmioWrite16 (
1714 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1719 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1720 result back to the 32-bit MMIO register.
1722 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1723 inclusive OR between the read result and the value specified by OrData, and
1724 writes the result to the 32-bit MMIO register specified by Address. The value
1725 written to the MMIO register is returned. This function must guarantee that
1726 all MMIO read and write operations are serialized.
1728 If 32-bit MMIO register operations are not supported, then ASSERT().
1730 @param Address The MMIO register to write.
1731 @param OrData The value to OR with the read value from the MMIO register.
1733 @return The value written back to the MMIO register.
1743 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1747 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1748 back to the 32-bit MMIO register.
1750 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1751 between the read result and the value specified by AndData, and writes the
1752 result to the 32-bit MMIO register specified by Address. The value written to
1753 the MMIO register is returned. This function must guarantee that all MMIO
1754 read and write operations are serialized.
1756 If 32-bit MMIO register operations are not supported, then ASSERT().
1758 @param Address The MMIO register to write.
1759 @param AndData The value to AND with the read value from the MMIO register.
1761 @return The value written back to the MMIO register.
1771 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1775 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1776 inclusive OR, and writes the result back to the 32-bit MMIO register.
1778 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1779 between the read result and the value specified by AndData, performs a
1780 bitwise OR between the result of the AND operation and the value specified by
1781 OrData, and writes the result to the 32-bit MMIO register specified by
1782 Address. The value written to the MMIO register is returned. This function
1783 must guarantee that all MMIO read and write operations are serialized.
1785 If 32-bit MMIO register operations are not supported, then ASSERT().
1788 @param Address The MMIO register to write.
1789 @param AndData The value to AND with the read value from the MMIO register.
1790 @param OrData The value to OR with the result of the AND operation.
1792 @return The value written back to the MMIO register.
1803 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1807 Reads a bit field of a MMIO register.
1809 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1810 the StartBit and the EndBit. The value of the bit field is returned.
1812 If 32-bit MMIO register operations are not supported, then ASSERT().
1813 If StartBit is greater than 31, then ASSERT().
1814 If EndBit is greater than 31, then ASSERT().
1815 If EndBit is less than StartBit, then ASSERT().
1817 @param Address MMIO register to read.
1818 @param StartBit The ordinal of the least significant bit in the bit field.
1820 @param EndBit The ordinal of the most significant bit in the bit field.
1823 @return The value read.
1828 MmioBitFieldRead32 (
1834 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1838 Writes a bit field to a MMIO register.
1840 Writes Value to the bit field of the MMIO register. The bit field is
1841 specified by the StartBit and the EndBit. All other bits in the destination
1842 MMIO register are preserved. The new value of the 32-bit register is returned.
1844 If 32-bit MMIO register operations are not supported, then ASSERT().
1845 If StartBit is greater than 31, then ASSERT().
1846 If EndBit is greater than 31, then ASSERT().
1847 If EndBit is less than StartBit, then ASSERT().
1849 @param Address MMIO register to write.
1850 @param StartBit The ordinal of the least significant bit in the bit field.
1852 @param EndBit The ordinal of the most significant bit in the bit field.
1854 @param Value New value of the bit field.
1856 @return The value written back to the MMIO register.
1861 MmioBitFieldWrite32 (
1868 return MmioWrite32 (
1870 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1875 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1876 writes the result back to the bit field in the 32-bit MMIO register.
1878 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1879 inclusive OR between the read result and the value specified by OrData, and
1880 writes the result to the 32-bit MMIO register specified by Address. The value
1881 written to the MMIO register is returned. This function must guarantee that
1882 all MMIO read and write operations are serialized. Extra left bits in OrData
1885 If 32-bit MMIO register operations are not supported, then ASSERT().
1886 If StartBit is greater than 31, then ASSERT().
1887 If EndBit is greater than 31, then ASSERT().
1888 If EndBit is less than StartBit, then ASSERT().
1890 @param Address MMIO register to write.
1891 @param StartBit The ordinal of the least significant bit in the bit field.
1893 @param EndBit The ordinal of the most significant bit in the bit field.
1895 @param OrData The value to OR with read value from the MMIO register.
1897 @return The value written back to the MMIO register.
1909 return MmioWrite32 (
1911 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1916 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1917 writes the result back to the bit field in the 32-bit MMIO register.
1919 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1920 between the read result and the value specified by AndData, and writes the
1921 result to the 32-bit MMIO register specified by Address. The value written to
1922 the MMIO register is returned. This function must guarantee that all MMIO
1923 read and write operations are serialized. Extra left bits in AndData are
1926 If 32-bit MMIO register operations are not supported, then ASSERT().
1927 If StartBit is greater than 31, then ASSERT().
1928 If EndBit is greater than 31, then ASSERT().
1929 If EndBit is less than StartBit, then ASSERT().
1931 @param Address MMIO register to write.
1932 @param StartBit The ordinal of the least significant bit in the bit field.
1934 @param EndBit The ordinal of the most significant bit in the bit field.
1936 @param AndData The value to AND with read value from the MMIO register.
1938 @return The value written back to the MMIO register.
1950 return MmioWrite32 (
1952 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1957 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1958 by a bitwise inclusive OR, and writes the result back to the bit field in the
1959 32-bit MMIO register.
1961 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1962 followed by a bitwise inclusive OR between the read result and the value
1963 specified by AndData, and writes the result to the 32-bit MMIO register
1964 specified by Address. The value written to the MMIO register is returned.
1965 This function must guarantee that all MMIO read and write operations are
1966 serialized. Extra left bits in both AndData and OrData are stripped.
1968 If 32-bit MMIO register operations are not supported, then ASSERT().
1969 If StartBit is greater than 31, then ASSERT().
1970 If EndBit is greater than 31, then ASSERT().
1971 If EndBit is less than StartBit, then ASSERT().
1973 @param Address MMIO register to write.
1974 @param StartBit The ordinal of the least significant bit in the bit field.
1976 @param EndBit The ordinal of the most significant bit in the bit field.
1978 @param AndData The value to AND with read value from the MMIO register.
1979 @param OrData The value to OR with the result of the AND operation.
1981 @return The value written back to the MMIO register.
1986 MmioBitFieldAndThenOr32 (
1994 return MmioWrite32 (
1996 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2001 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
2002 result back to the 64-bit MMIO register.
2004 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2005 inclusive OR between the read result and the value specified by OrData, and
2006 writes the result to the 64-bit MMIO register specified by Address. The value
2007 written to the MMIO register is returned. This function must guarantee that
2008 all MMIO read and write operations are serialized.
2010 If 64-bit MMIO register operations are not supported, then ASSERT().
2012 @param Address The MMIO register to write.
2013 @param OrData The value to OR with the read value from the MMIO register.
2015 @return The value written back to the MMIO register.
2025 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2029 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2030 back to the 64-bit MMIO register.
2032 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2033 between the read result and the value specified by AndData, and writes the
2034 result to the 64-bit MMIO register specified by Address. The value written to
2035 the MMIO register is returned. This function must guarantee that all MMIO
2036 read and write operations are serialized.
2038 If 64-bit MMIO register operations are not supported, then ASSERT().
2040 @param Address The MMIO register to write.
2041 @param AndData The value to AND with the read value from the MMIO register.
2043 @return The value written back to the MMIO register.
2053 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2057 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2058 inclusive OR, and writes the result back to the 64-bit MMIO register.
2060 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2061 between the read result and the value specified by AndData, performs a
2062 bitwise OR between the result of the AND operation and the value specified by
2063 OrData, and writes the result to the 64-bit MMIO register specified by
2064 Address. The value written to the MMIO register is returned. This function
2065 must guarantee that all MMIO read and write operations are serialized.
2067 If 64-bit MMIO register operations are not supported, then ASSERT().
2070 @param Address The MMIO register to write.
2071 @param AndData The value to AND with the read value from the MMIO register.
2072 @param OrData The value to OR with the result of the AND operation.
2074 @return The value written back to the MMIO register.
2085 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2089 Reads a bit field of a MMIO register.
2091 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2092 the StartBit and the EndBit. The value of the bit field is returned.
2094 If 64-bit MMIO register operations are not supported, then ASSERT().
2095 If StartBit is greater than 63, then ASSERT().
2096 If EndBit is greater than 63, then ASSERT().
2097 If EndBit is less than StartBit, then ASSERT().
2099 @param Address MMIO register to read.
2100 @param StartBit The ordinal of the least significant bit in the bit field.
2102 @param EndBit The ordinal of the most significant bit in the bit field.
2105 @return The value read.
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
)