b47b889bd0bd59bd97374a17290d260a24295d6e
2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2006, 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 Module Name: IoHighLevel.c
18 The following IoLib instances share the same version of this file:
27 // Include common header file for this module.
29 #include "CommonHeader.h"
31 #include "DxeCpuIoLibInternal.h"
34 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
35 result back to the 8-bit I/O port.
37 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
38 between the read result and the value specified by OrData, and writes the
39 result to the 8-bit I/O port specified by Port. The value written to the I/O
40 port is returned. This function must guarantee that all I/O read and write
41 operations are serialized.
43 If 8-bit I/O port operations are not supported, then ASSERT().
45 @param Port The I/O port to write.
46 @param OrData The value to OR with the read value from the I/O port.
48 @return The value written back to the I/O port.
58 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
62 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
63 to the 8-bit I/O port.
65 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
66 the read result and the value specified by AndData, and writes the result to
67 the 8-bit I/O port specified by Port. The value written to the I/O port is
68 returned. This function must guarantee that all I/O read and write operations
71 If 8-bit I/O port operations are not supported, then ASSERT().
73 @param Port The I/O port to write.
74 @param AndData The value to AND with the read value from the I/O port.
76 @return The value written back to the I/O port.
86 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
90 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
91 inclusive OR, and writes the result back to the 8-bit I/O port.
93 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
94 the read result and the value specified by AndData, performs a bitwise OR
95 between the result of the AND operation and the value specified by OrData,
96 and writes the result to the 8-bit I/O port specified by Port. The value
97 written to the I/O port is returned. This function must guarantee that all
98 I/O read and write operations are serialized.
100 If 8-bit I/O port operations are not supported, then ASSERT().
102 @param Port The I/O port to write.
103 @param AndData The value to AND with the read value from the I/O port.
104 @param OrData The value to OR with the result of the AND operation.
106 @return The value written back to the I/O port.
117 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
121 Reads a bit field of an I/O register.
123 Reads the bit field in an 8-bit I/O register. The bit field is specified by
124 the StartBit and the EndBit. The value of the bit field is returned.
126 If 8-bit I/O port operations are not supported, then ASSERT().
127 If StartBit is greater than 7, then ASSERT().
128 If EndBit is greater than 7, then ASSERT().
129 If EndBit is less than StartBit, then ASSERT().
131 @param Port The I/O port to read.
132 @param StartBit The ordinal of the least significant bit in the bit field.
134 @param EndBit The ordinal of the most significant bit in the bit field.
137 @return The value read.
148 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
152 Writes a bit field to an I/O register.
154 Writes Value to the bit field of the I/O register. The bit field is specified
155 by the StartBit and the EndBit. All other bits in the destination I/O
156 register are preserved. The value written to the I/O port is returned. Extra
157 left bits in Value are stripped.
159 If 8-bit I/O port operations are not supported, then ASSERT().
160 If StartBit is greater than 7, then ASSERT().
161 If EndBit is greater than 7, then ASSERT().
162 If EndBit is less than StartBit, then ASSERT().
164 @param Port The I/O port to write.
165 @param StartBit The ordinal of the least significant bit in the bit field.
167 @param EndBit The ordinal of the most significant bit in the bit field.
169 @param Value New value of the bit field.
171 @return The value written back to the I/O port.
185 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
190 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
191 result back to the bit field in the 8-bit port.
193 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
194 between the read result and the value specified by OrData, and writes the
195 result to the 8-bit I/O port specified by Port. The value written to the I/O
196 port is returned. This function must guarantee that all I/O read and write
197 operations are serialized. Extra left bits in OrData are stripped.
199 If 8-bit I/O port operations are not supported, then ASSERT().
200 If StartBit is greater than 7, then ASSERT().
201 If EndBit is greater than 7, then ASSERT().
202 If EndBit is less than StartBit, then ASSERT().
204 @param Port The I/O port to write.
205 @param StartBit The ordinal of the least significant bit in the bit field.
207 @param EndBit The ordinal of the most significant bit in the bit field.
209 @param OrData The value to OR with the read value from the I/O port.
211 @return The value written back to the I/O port.
225 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
230 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
231 result back to the bit field in the 8-bit port.
233 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
234 the read result and the value specified by AndData, and writes the result to
235 the 8-bit I/O port specified by Port. The value written to the I/O port is
236 returned. This function must guarantee that all I/O read and write operations
237 are serialized. Extra left bits in AndData are stripped.
239 If 8-bit I/O port operations are not supported, then ASSERT().
240 If StartBit is greater than 7, then ASSERT().
241 If EndBit is greater than 7, then ASSERT().
242 If EndBit is less than StartBit, then ASSERT().
244 @param Port The I/O port to write.
245 @param StartBit The ordinal of the least significant bit in the bit field.
247 @param EndBit The ordinal of the most significant bit in the bit field.
249 @param AndData The value to AND with the read value from the I/O port.
251 @return The value written back to the I/O port.
265 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
270 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
271 bitwise inclusive OR, and writes the result back to the bit field in the
274 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
275 by a bitwise inclusive OR between the read result and the value specified by
276 AndData, and writes the result to the 8-bit I/O port specified by Port. The
277 value written to the I/O port is returned. This function must guarantee that
278 all I/O read and write operations are serialized. Extra left bits in both
279 AndData and OrData are stripped.
281 If 8-bit I/O port operations are not supported, then ASSERT().
282 If StartBit is greater than 7, then ASSERT().
283 If EndBit is greater than 7, then ASSERT().
284 If EndBit is less than StartBit, then ASSERT().
286 @param Port The I/O port to write.
287 @param StartBit The ordinal of the least significant bit in the bit field.
289 @param EndBit The ordinal of the most significant bit in the bit field.
291 @param AndData The value to AND with the read value from the I/O port.
292 @param OrData The value to OR with the result of the AND operation.
294 @return The value written back to the I/O port.
299 IoBitFieldAndThenOr8 (
309 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
314 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
315 result back to the 16-bit I/O port.
317 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
318 between the read result and the value specified by OrData, and writes the
319 result to the 16-bit I/O port specified by Port. The value written to the I/O
320 port is returned. This function must guarantee that all I/O read and write
321 operations are serialized.
323 If 16-bit I/O port operations are not supported, then ASSERT().
325 @param Port The I/O port to write.
326 @param OrData The value to OR with the read value from the I/O port.
328 @return The value written back to the I/O port.
338 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
342 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
343 to the 16-bit I/O port.
345 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
346 the read result and the value specified by AndData, and writes the result to
347 the 16-bit I/O port specified by Port. The value written to the I/O port is
348 returned. This function must guarantee that all I/O read and write operations
351 If 16-bit I/O port operations are not supported, then ASSERT().
353 @param Port The I/O port to write.
354 @param AndData The value to AND with the read value from the I/O port.
356 @return The value written back to the I/O port.
366 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
370 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
371 inclusive OR, and writes the result back to the 16-bit I/O port.
373 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
374 the read result and the value specified by AndData, performs a bitwise OR
375 between the result of the AND operation and the value specified by OrData,
376 and writes the result to the 16-bit I/O port specified by Port. The value
377 written to the I/O port is returned. This function must guarantee that all
378 I/O read and write operations are serialized.
380 If 16-bit I/O port operations are not supported, then ASSERT().
382 @param Port The I/O port to write.
383 @param AndData The value to AND with the read value from the I/O port.
384 @param OrData The value to OR with the result of the AND operation.
386 @return The value written back to the I/O port.
397 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
401 Reads a bit field of an I/O register.
403 Reads the bit field in a 16-bit I/O register. The bit field is specified by
404 the StartBit and the EndBit. The value of the bit field is returned.
406 If 16-bit I/O port operations are not supported, then ASSERT().
407 If StartBit is greater than 15, then ASSERT().
408 If EndBit is greater than 15, then ASSERT().
409 If EndBit is less than StartBit, then ASSERT().
411 @param Port The I/O port to read.
412 @param StartBit The ordinal of the least significant bit in the bit field.
414 @param EndBit The ordinal of the most significant bit in the bit field.
417 @return The value read.
428 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
432 Writes a bit field to an I/O register.
434 Writes Value to the bit field of the I/O register. The bit field is specified
435 by the StartBit and the EndBit. All other bits in the destination I/O
436 register are preserved. The value written to the I/O port is returned. Extra
437 left bits in Value are stripped.
439 If 16-bit I/O port operations are not supported, then ASSERT().
440 If StartBit is greater than 15, then ASSERT().
441 If EndBit is greater than 15, then ASSERT().
442 If EndBit is less than StartBit, then ASSERT().
444 @param Port The I/O port to write.
445 @param StartBit The ordinal of the least significant bit in the bit field.
447 @param EndBit The ordinal of the most significant bit in the bit field.
449 @param Value New value of the bit field.
451 @return The value written back to the I/O port.
465 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
470 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
471 result back to the bit field in the 16-bit port.
473 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
474 between the read result and the value specified by OrData, and writes the
475 result to the 16-bit I/O port specified by Port. The value written to the I/O
476 port is returned. This function must guarantee that all I/O read and write
477 operations are serialized. Extra left bits in OrData are stripped.
479 If 16-bit I/O port operations are not supported, then ASSERT().
480 If StartBit is greater than 15, then ASSERT().
481 If EndBit is greater than 15, then ASSERT().
482 If EndBit is less than StartBit, then ASSERT().
484 @param Port The I/O port to write.
485 @param StartBit The ordinal of the least significant bit in the bit field.
487 @param EndBit The ordinal of the most significant bit in the bit field.
489 @param OrData The value to OR with the read value from the I/O port.
491 @return The value written back to the I/O port.
505 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
510 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
511 result back to the bit field in the 16-bit port.
513 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
514 the read result and the value specified by AndData, and writes the result to
515 the 16-bit I/O port specified by Port. The value written to the I/O port is
516 returned. This function must guarantee that all I/O read and write operations
517 are serialized. Extra left bits in AndData are stripped.
519 If 16-bit I/O port operations are not supported, then ASSERT().
520 If StartBit is greater than 15, then ASSERT().
521 If EndBit is greater than 15, then ASSERT().
522 If EndBit is less than StartBit, then ASSERT().
524 @param Port The I/O port to write.
525 @param StartBit The ordinal of the least significant bit in the bit field.
527 @param EndBit The ordinal of the most significant bit in the bit field.
529 @param AndData The value to AND with the read value from the I/O port.
531 @return The value written back to the I/O port.
545 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
550 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
551 bitwise inclusive OR, and writes the result back to the bit field in the
554 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
555 by a bitwise inclusive OR between the read result and the value specified by
556 AndData, and writes the result to the 16-bit I/O port specified by Port. The
557 value written to the I/O port is returned. This function must guarantee that
558 all I/O read and write operations are serialized. Extra left bits in both
559 AndData and OrData are stripped.
561 If 16-bit I/O port operations are not supported, then ASSERT().
562 If StartBit is greater than 15, then ASSERT().
563 If EndBit is greater than 15, then ASSERT().
564 If EndBit is less than StartBit, then ASSERT().
566 @param Port The I/O port to write.
567 @param StartBit The ordinal of the least significant bit in the bit field.
569 @param EndBit The ordinal of the most significant bit in the bit field.
571 @param AndData The value to AND with the read value from the I/O port.
572 @param OrData The value to OR with the result of the AND operation.
574 @return The value written back to the I/O port.
579 IoBitFieldAndThenOr16 (
589 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
594 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
595 result back to the 32-bit I/O port.
597 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
598 between the read result and the value specified by OrData, and writes the
599 result to the 32-bit I/O port specified by Port. The value written to the I/O
600 port is returned. This function must guarantee that all I/O read and write
601 operations are serialized.
603 If 32-bit I/O port operations are not supported, then ASSERT().
605 @param Port The I/O port to write.
606 @param OrData The value to OR with the read value from the I/O port.
608 @return The value written back to the I/O port.
618 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
622 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
623 to the 32-bit I/O port.
625 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
626 the read result and the value specified by AndData, and writes the result to
627 the 32-bit I/O port specified by Port. The value written to the I/O port is
628 returned. This function must guarantee that all I/O read and write operations
631 If 32-bit I/O port operations are not supported, then ASSERT().
633 @param Port The I/O port to write.
634 @param AndData The value to AND with the read value from the I/O port.
636 @return The value written back to the I/O port.
646 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
650 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
651 inclusive OR, and writes the result back to the 32-bit I/O port.
653 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
654 the read result and the value specified by AndData, performs a bitwise OR
655 between the result of the AND operation and the value specified by OrData,
656 and writes the result to the 32-bit I/O port specified by Port. The value
657 written to the I/O port is returned. This function must guarantee that all
658 I/O read and write operations are serialized.
660 If 32-bit I/O port operations are not supported, then ASSERT().
662 @param Port The I/O port to write.
663 @param AndData The value to AND with the read value from the I/O port.
664 @param OrData The value to OR with the result of the AND operation.
666 @return The value written back to the I/O port.
677 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
681 Reads a bit field of an I/O register.
683 Reads the bit field in a 32-bit I/O register. The bit field is specified by
684 the StartBit and the EndBit. The value of the bit field is returned.
686 If 32-bit I/O port operations are not supported, then ASSERT().
687 If StartBit is greater than 31, then ASSERT().
688 If EndBit is greater than 31, then ASSERT().
689 If EndBit is less than StartBit, then ASSERT().
691 @param Port The I/O port to read.
692 @param StartBit The ordinal of the least significant bit in the bit field.
694 @param EndBit The ordinal of the most significant bit in the bit field.
697 @return The value read.
708 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
712 Writes a bit field to an I/O register.
714 Writes Value to the bit field of the I/O register. The bit field is specified
715 by the StartBit and the EndBit. All other bits in the destination I/O
716 register are preserved. The value written to the I/O port is returned. Extra
717 left bits in Value are stripped.
719 If 32-bit I/O port operations are not supported, then ASSERT().
720 If StartBit is greater than 31, then ASSERT().
721 If EndBit is greater than 31, then ASSERT().
722 If EndBit is less than StartBit, then ASSERT().
724 @param Port The I/O port to write.
725 @param StartBit The ordinal of the least significant bit in the bit field.
727 @param EndBit The ordinal of the most significant bit in the bit field.
729 @param Value New value of the bit field.
731 @return The value written back to the I/O port.
745 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
750 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
751 result back to the bit field in the 32-bit port.
753 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
754 between the read result and the value specified by OrData, and writes the
755 result to the 32-bit I/O port specified by Port. The value written to the I/O
756 port is returned. This function must guarantee that all I/O read and write
757 operations are serialized. Extra left bits in OrData are stripped.
759 If 32-bit I/O port operations are not supported, then ASSERT().
760 If StartBit is greater than 31, then ASSERT().
761 If EndBit is greater than 31, then ASSERT().
762 If EndBit is less than StartBit, then ASSERT().
764 @param Port The I/O port to write.
765 @param StartBit The ordinal of the least significant bit in the bit field.
767 @param EndBit The ordinal of the most significant bit in the bit field.
769 @param OrData The value to OR with the read value from the I/O port.
771 @return The value written back to the I/O port.
785 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
790 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
791 result back to the bit field in the 32-bit port.
793 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
794 the read result and the value specified by AndData, and writes the result to
795 the 32-bit I/O port specified by Port. The value written to the I/O port is
796 returned. This function must guarantee that all I/O read and write operations
797 are serialized. Extra left bits in AndData are stripped.
799 If 32-bit I/O port operations are not supported, then ASSERT().
800 If StartBit is greater than 31, then ASSERT().
801 If EndBit is greater than 31, then ASSERT().
802 If EndBit is less than StartBit, then ASSERT().
804 @param Port The I/O port to write.
805 @param StartBit The ordinal of the least significant bit in the bit field.
807 @param EndBit The ordinal of the most significant bit in the bit field.
809 @param AndData The value to AND with the read value from the I/O port.
811 @return The value written back to the I/O port.
825 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
830 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
831 bitwise inclusive OR, and writes the result back to the bit field in the
834 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
835 by a bitwise inclusive OR between the read result and the value specified by
836 AndData, and writes the result to the 32-bit I/O port specified by Port. The
837 value written to the I/O port is returned. This function must guarantee that
838 all I/O read and write operations are serialized. Extra left bits in both
839 AndData and OrData are stripped.
841 If 32-bit I/O port operations are not supported, then ASSERT().
842 If StartBit is greater than 31, then ASSERT().
843 If EndBit is greater than 31, then ASSERT().
844 If EndBit is less than StartBit, then ASSERT().
846 @param Port The I/O port to write.
847 @param StartBit The ordinal of the least significant bit in the bit field.
849 @param EndBit The ordinal of the most significant bit in the bit field.
851 @param AndData The value to AND with the read value from the I/O port.
852 @param OrData The value to OR with the result of the AND operation.
854 @return The value written back to the I/O port.
859 IoBitFieldAndThenOr32 (
869 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
874 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
875 result back to the 64-bit I/O port.
877 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
878 between the read result and the value specified by OrData, and writes the
879 result to the 64-bit I/O port specified by Port. The value written to the I/O
880 port is returned. This function must guarantee that all I/O read and write
881 operations are serialized.
883 If 64-bit I/O port operations are not supported, then ASSERT().
885 @param Port The I/O port to write.
886 @param OrData The value to OR with the read value from the I/O port.
888 @return The value written back to the I/O port.
898 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
902 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
903 to the 64-bit I/O port.
905 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
906 the read result and the value specified by AndData, and writes the result to
907 the 64-bit I/O port specified by Port. The value written to the I/O port is
908 returned. This function must guarantee that all I/O read and write operations
911 If 64-bit I/O port operations are not supported, then ASSERT().
913 @param Port The I/O port to write.
914 @param AndData The value to AND with the read value from the I/O port.
916 @return The value written back to the I/O port.
926 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
930 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
931 inclusive OR, and writes the result back to the 64-bit I/O port.
933 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
934 the read result and the value specified by AndData, performs a bitwise OR
935 between the result of the AND operation and the value specified by OrData,
936 and writes the result to the 64-bit I/O port specified by Port. The value
937 written to the I/O port is returned. This function must guarantee that all
938 I/O read and write operations are serialized.
940 If 64-bit I/O port operations are not supported, then ASSERT().
942 @param Port The I/O port to write.
943 @param AndData The value to AND with the read value from the I/O port.
944 @param OrData The value to OR with the result of the AND operation.
946 @return The value written back to the I/O port.
957 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
961 Reads a bit field of an I/O register.
963 Reads the bit field in a 64-bit I/O register. The bit field is specified by
964 the StartBit and the EndBit. The value of the bit field is returned.
966 If 64-bit I/O port operations are not supported, then ASSERT().
967 If StartBit is greater than 63, then ASSERT().
968 If EndBit is greater than 63, then ASSERT().
969 If EndBit is less than StartBit, then ASSERT().
971 @param Port The I/O port to read.
972 @param StartBit The ordinal of the least significant bit in the bit field.
974 @param EndBit The ordinal of the most significant bit in the bit field.
977 @return The value read.
988 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
992 Writes a bit field to an I/O register.
994 Writes Value to the bit field of the I/O register. The bit field is specified
995 by the StartBit and the EndBit. All other bits in the destination I/O
996 register are preserved. The value written to the I/O port is returned. Extra
997 left bits in Value are stripped.
999 If 64-bit I/O port operations are not supported, then ASSERT().
1000 If StartBit is greater than 63, then ASSERT().
1001 If EndBit is greater than 63, then ASSERT().
1002 If EndBit is less than StartBit, then ASSERT().
1004 @param Port The I/O port to write.
1005 @param StartBit The ordinal of the least significant bit in the bit field.
1007 @param EndBit The ordinal of the most significant bit in the bit field.
1009 @param Value New value of the bit field.
1011 @return The value written back to the I/O port.
1025 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1030 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1031 result back to the bit field in the 64-bit port.
1033 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1034 between the read result and the value specified by OrData, and writes the
1035 result to the 64-bit I/O port specified by Port. The value written to the I/O
1036 port is returned. This function must guarantee that all I/O read and write
1037 operations are serialized. Extra left bits in OrData are stripped.
1039 If 64-bit I/O port operations are not supported, then ASSERT().
1040 If StartBit is greater than 63, then ASSERT().
1041 If EndBit is greater than 63, then ASSERT().
1042 If EndBit is less than StartBit, then ASSERT().
1044 @param Port The I/O port to write.
1045 @param StartBit The ordinal of the least significant bit in the bit field.
1047 @param EndBit The ordinal of the most significant bit in the bit field.
1049 @param OrData The value to OR with the read value from the I/O port.
1051 @return The value written back to the I/O port.
1065 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1070 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1071 result back to the bit field in the 64-bit port.
1073 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1074 the read result and the value specified by AndData, and writes the result to
1075 the 64-bit I/O port specified by Port. The value written to the I/O port is
1076 returned. This function must guarantee that all I/O read and write operations
1077 are serialized. Extra left bits in AndData are stripped.
1079 If 64-bit I/O port operations are not supported, then ASSERT().
1080 If StartBit is greater than 63, then ASSERT().
1081 If EndBit is greater than 63, then ASSERT().
1082 If EndBit is less than StartBit, then ASSERT().
1084 @param Port The I/O port to write.
1085 @param StartBit The ordinal of the least significant bit in the bit field.
1087 @param EndBit The ordinal of the most significant bit in the bit field.
1089 @param AndData The value to AND with the read value from the I/O port.
1091 @return The value written back to the I/O port.
1105 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1110 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1111 bitwise inclusive OR, and writes the result back to the bit field in the
1114 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1115 by a bitwise inclusive OR between the read result and the value specified by
1116 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1117 value written to the I/O port is returned. This function must guarantee that
1118 all I/O read and write operations are serialized. Extra left bits in both
1119 AndData and OrData are stripped.
1121 If 64-bit I/O port operations are not supported, then ASSERT().
1122 If StartBit is greater than 63, then ASSERT().
1123 If EndBit is greater than 63, then ASSERT().
1124 If EndBit is less than StartBit, then ASSERT().
1126 @param Port The I/O port to write.
1127 @param StartBit The ordinal of the least significant bit in the bit field.
1129 @param EndBit The ordinal of the most significant bit in the bit field.
1131 @param AndData The value to AND with the read value from the I/O port.
1132 @param OrData The value to OR with the result of the AND operation.
1134 @return The value written back to the I/O port.
1139 IoBitFieldAndThenOr64 (
1149 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1154 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1155 result back to the 8-bit MMIO register.
1157 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1158 inclusive OR between the read result and the value specified by OrData, and
1159 writes the result to the 8-bit MMIO register specified by Address. The value
1160 written to the MMIO register is returned. This function must guarantee that
1161 all MMIO read and write operations are serialized.
1163 If 8-bit MMIO register operations are not supported, then ASSERT().
1165 @param Address The MMIO register to write.
1166 @param OrData The value to OR with the read value from the MMIO register.
1168 @return The value written back to the MMIO register.
1178 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1182 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1183 back to the 8-bit MMIO register.
1185 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1186 between the read result and the value specified by AndData, and writes the
1187 result to the 8-bit MMIO register specified by Address. The value written to
1188 the MMIO register is returned. This function must guarantee that all MMIO
1189 read and write operations are serialized.
1191 If 8-bit MMIO register operations are not supported, then ASSERT().
1193 @param Address The MMIO register to write.
1194 @param AndData The value to AND with the read value from the MMIO register.
1196 @return The value written back to the MMIO register.
1206 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1210 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1211 inclusive OR, and writes the result back to the 8-bit MMIO register.
1213 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1214 between the read result and the value specified by AndData, performs a
1215 bitwise OR between the result of the AND operation and the value specified by
1216 OrData, and writes the result to the 8-bit MMIO register specified by
1217 Address. The value written to the MMIO register is returned. This function
1218 must guarantee that all MMIO read and write operations are serialized.
1220 If 8-bit MMIO register operations are not supported, then ASSERT().
1223 @param Address The MMIO register to write.
1224 @param AndData The value to AND with the read value from the MMIO register.
1225 @param OrData The value to OR with the result of the AND operation.
1227 @return The value written back to the MMIO register.
1238 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1242 Reads a bit field of a MMIO register.
1244 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1245 the StartBit and the EndBit. The value of the bit field is returned.
1247 If 8-bit MMIO register operations are not supported, then ASSERT().
1248 If StartBit is greater than 7, then ASSERT().
1249 If EndBit is greater than 7, then ASSERT().
1250 If EndBit is less than StartBit, then ASSERT().
1252 @param Address MMIO register to read.
1253 @param StartBit The ordinal of the least significant bit in the bit field.
1255 @param EndBit The ordinal of the most significant bit in the bit field.
1258 @return The value read.
1269 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1273 Writes a bit field to a MMIO register.
1275 Writes Value to the bit field of the MMIO register. The bit field is
1276 specified by the StartBit and the EndBit. All other bits in the destination
1277 MMIO register are preserved. The new value of the 8-bit register is returned.
1279 If 8-bit MMIO register operations are not supported, then ASSERT().
1280 If StartBit is greater than 7, then ASSERT().
1281 If EndBit is greater than 7, then ASSERT().
1282 If EndBit is less than StartBit, then ASSERT().
1284 @param Address MMIO register to write.
1285 @param StartBit The ordinal of the least significant bit in the bit field.
1287 @param EndBit The ordinal of the most significant bit in the bit field.
1289 @param Value New value of the bit field.
1291 @return The value written back to the MMIO register.
1296 MmioBitFieldWrite8 (
1305 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1310 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1311 writes the result back to the bit field in the 8-bit MMIO register.
1313 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1314 inclusive OR between the read result and the value specified by OrData, and
1315 writes the result to the 8-bit MMIO register specified by Address. The value
1316 written to the MMIO register is returned. This function must guarantee that
1317 all MMIO read and write operations are serialized. Extra left bits in OrData
1320 If 8-bit MMIO register operations are not supported, then ASSERT().
1321 If StartBit is greater than 7, then ASSERT().
1322 If EndBit is greater than 7, then ASSERT().
1323 If EndBit is less than StartBit, then ASSERT().
1325 @param Address MMIO register to write.
1326 @param StartBit The ordinal of the least significant bit in the bit field.
1328 @param EndBit The ordinal of the most significant bit in the bit field.
1330 @param OrData The value to OR with read value from the MMIO register.
1332 @return The value written back to the MMIO register.
1346 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1351 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1352 writes the result back to the bit field in the 8-bit MMIO register.
1354 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1355 between the read result and the value specified by AndData, and writes the
1356 result to the 8-bit MMIO register specified by Address. The value written to
1357 the MMIO register is returned. This function must guarantee that all MMIO
1358 read and write operations are serialized. Extra left bits in AndData are
1361 If 8-bit MMIO register operations are not supported, then ASSERT().
1362 If StartBit is greater than 7, then ASSERT().
1363 If EndBit is greater than 7, then ASSERT().
1364 If EndBit is less than StartBit, then ASSERT().
1366 @param Address MMIO register to write.
1367 @param StartBit The ordinal of the least significant bit in the bit field.
1369 @param EndBit The ordinal of the most significant bit in the bit field.
1371 @param AndData The value to AND with read value from the MMIO register.
1373 @return The value written back to the MMIO register.
1387 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1392 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1393 by a bitwise inclusive OR, and writes the result back to the bit field in the
1394 8-bit MMIO register.
1396 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1397 followed by a bitwise inclusive OR between the read result and the value
1398 specified by AndData, and writes the result to the 8-bit MMIO register
1399 specified by Address. The value written to the MMIO register is returned.
1400 This function must guarantee that all MMIO read and write operations are
1401 serialized. Extra left bits in both AndData and OrData are stripped.
1403 If 8-bit MMIO register operations are not supported, then ASSERT().
1404 If StartBit is greater than 7, then ASSERT().
1405 If EndBit is greater than 7, then ASSERT().
1406 If EndBit is less than StartBit, then ASSERT().
1408 @param Address MMIO register to write.
1409 @param StartBit The ordinal of the least significant bit in the bit field.
1411 @param EndBit The ordinal of the most significant bit in the bit field.
1413 @param AndData The value to AND with read value from the MMIO register.
1414 @param OrData The value to OR with the result of the AND operation.
1416 @return The value written back to the MMIO register.
1421 MmioBitFieldAndThenOr8 (
1431 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1436 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1437 result back to the 16-bit MMIO register.
1439 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1440 inclusive OR between the read result and the value specified by OrData, and
1441 writes the result to the 16-bit MMIO register specified by Address. The value
1442 written to the MMIO register is returned. This function must guarantee that
1443 all MMIO read and write operations are serialized.
1445 If 16-bit MMIO register operations are not supported, then ASSERT().
1447 @param Address The MMIO register to write.
1448 @param OrData The value to OR with the read value from the MMIO register.
1450 @return The value written back to the MMIO register.
1460 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1464 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1465 back to the 16-bit MMIO register.
1467 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1468 between the read result and the value specified by AndData, and writes the
1469 result to the 16-bit MMIO register specified by Address. The value written to
1470 the MMIO register is returned. This function must guarantee that all MMIO
1471 read and write operations are serialized.
1473 If 16-bit MMIO register operations are not supported, then ASSERT().
1475 @param Address The MMIO register to write.
1476 @param AndData The value to AND with the read value from the MMIO register.
1478 @return The value written back to the MMIO register.
1488 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1492 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1493 inclusive OR, and writes the result back to the 16-bit MMIO register.
1495 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1496 between the read result and the value specified by AndData, performs a
1497 bitwise OR between the result of the AND operation and the value specified by
1498 OrData, and writes the result to the 16-bit MMIO register specified by
1499 Address. The value written to the MMIO register is returned. This function
1500 must guarantee that all MMIO read and write operations are serialized.
1502 If 16-bit MMIO register operations are not supported, then ASSERT().
1505 @param Address The MMIO register to write.
1506 @param AndData The value to AND with the read value from the MMIO register.
1507 @param OrData The value to OR with the result of the AND operation.
1509 @return The value written back to the MMIO register.
1520 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1524 Reads a bit field of a MMIO register.
1526 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1527 the StartBit and the EndBit. The value of the bit field is returned.
1529 If 16-bit MMIO register operations are not supported, then ASSERT().
1530 If StartBit is greater than 15, then ASSERT().
1531 If EndBit is greater than 15, then ASSERT().
1532 If EndBit is less than StartBit, then ASSERT().
1534 @param Address MMIO register to read.
1535 @param StartBit The ordinal of the least significant bit in the bit field.
1537 @param EndBit The ordinal of the most significant bit in the bit field.
1540 @return The value read.
1545 MmioBitFieldRead16 (
1551 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1555 Writes a bit field to a MMIO register.
1557 Writes Value to the bit field of the MMIO register. The bit field is
1558 specified by the StartBit and the EndBit. All other bits in the destination
1559 MMIO register are preserved. The new value of the 16-bit register is returned.
1561 If 16-bit MMIO register operations are not supported, then ASSERT().
1562 If StartBit is greater than 15, then ASSERT().
1563 If EndBit is greater than 15, then ASSERT().
1564 If EndBit is less than StartBit, then ASSERT().
1566 @param Address MMIO register to write.
1567 @param StartBit The ordinal of the least significant bit in the bit field.
1569 @param EndBit The ordinal of the most significant bit in the bit field.
1571 @param Value New value of the bit field.
1573 @return The value written back to the MMIO register.
1578 MmioBitFieldWrite16 (
1585 return MmioWrite16 (
1587 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1592 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1593 writes the result back to the bit field in the 16-bit MMIO register.
1595 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1596 inclusive OR between the read result and the value specified by OrData, and
1597 writes the result to the 16-bit MMIO register specified by Address. The value
1598 written to the MMIO register is returned. This function must guarantee that
1599 all MMIO read and write operations are serialized. Extra left bits in OrData
1602 If 16-bit MMIO register operations are not supported, then ASSERT().
1603 If StartBit is greater than 15, then ASSERT().
1604 If EndBit is greater than 15, then ASSERT().
1605 If EndBit is less than StartBit, then ASSERT().
1607 @param Address MMIO register to write.
1608 @param StartBit The ordinal of the least significant bit in the bit field.
1610 @param EndBit The ordinal of the most significant bit in the bit field.
1612 @param OrData The value to OR with read value from the MMIO register.
1614 @return The value written back to the MMIO register.
1626 return MmioWrite16 (
1628 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1633 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1634 writes the result back to the bit field in the 16-bit MMIO register.
1636 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1637 between the read result and the value specified by AndData, and writes the
1638 result to the 16-bit MMIO register specified by Address. The value written to
1639 the MMIO register is returned. This function must guarantee that all MMIO
1640 read and write operations are serialized. Extra left bits in AndData are
1643 If 16-bit MMIO register operations are not supported, then ASSERT().
1644 If StartBit is greater than 15, then ASSERT().
1645 If EndBit is greater than 15, then ASSERT().
1646 If EndBit is less than StartBit, then ASSERT().
1648 @param Address MMIO register to write.
1649 @param StartBit The ordinal of the least significant bit in the bit field.
1651 @param EndBit The ordinal of the most significant bit in the bit field.
1653 @param AndData The value to AND with read value from the MMIO register.
1655 @return The value written back to the MMIO register.
1667 return MmioWrite16 (
1669 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1674 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1675 by a bitwise inclusive OR, and writes the result back to the bit field in the
1676 16-bit MMIO register.
1678 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1679 followed by a bitwise inclusive OR between the read result and the value
1680 specified by AndData, and writes the result to the 16-bit MMIO register
1681 specified by Address. The value written to the MMIO register is returned.
1682 This function must guarantee that all MMIO read and write operations are
1683 serialized. Extra left bits in both AndData and OrData are stripped.
1685 If 16-bit MMIO register operations are not supported, then ASSERT().
1686 If StartBit is greater than 15, then ASSERT().
1687 If EndBit is greater than 15, then ASSERT().
1688 If EndBit is less than StartBit, then ASSERT().
1690 @param Address MMIO register to write.
1691 @param StartBit The ordinal of the least significant bit in the bit field.
1693 @param EndBit The ordinal of the most significant bit in the bit field.
1695 @param AndData The value to AND with read value from the MMIO register.
1696 @param OrData The value to OR with the result of the AND operation.
1698 @return The value written back to the MMIO register.
1703 MmioBitFieldAndThenOr16 (
1711 return MmioWrite16 (
1713 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1718 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1719 result back to the 32-bit MMIO register.
1721 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1722 inclusive OR between the read result and the value specified by OrData, and
1723 writes the result to the 32-bit MMIO register specified by Address. The value
1724 written to the MMIO register is returned. This function must guarantee that
1725 all MMIO read and write operations are serialized.
1727 If 32-bit MMIO register operations are not supported, then ASSERT().
1729 @param Address The MMIO register to write.
1730 @param OrData The value to OR with the read value from the MMIO register.
1732 @return The value written back to the MMIO register.
1742 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1746 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1747 back to the 32-bit MMIO register.
1749 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1750 between the read result and the value specified by AndData, and writes the
1751 result to the 32-bit MMIO register specified by Address. The value written to
1752 the MMIO register is returned. This function must guarantee that all MMIO
1753 read and write operations are serialized.
1755 If 32-bit MMIO register operations are not supported, then ASSERT().
1757 @param Address The MMIO register to write.
1758 @param AndData The value to AND with the read value from the MMIO register.
1760 @return The value written back to the MMIO register.
1770 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1774 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1775 inclusive OR, and writes the result back to the 32-bit MMIO register.
1777 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1778 between the read result and the value specified by AndData, performs a
1779 bitwise OR between the result of the AND operation and the value specified by
1780 OrData, and writes the result to the 32-bit MMIO register specified by
1781 Address. The value written to the MMIO register is returned. This function
1782 must guarantee that all MMIO read and write operations are serialized.
1784 If 32-bit MMIO register operations are not supported, then ASSERT().
1787 @param Address The MMIO register to write.
1788 @param AndData The value to AND with the read value from the MMIO register.
1789 @param OrData The value to OR with the result of the AND operation.
1791 @return The value written back to the MMIO register.
1802 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1806 Reads a bit field of a MMIO register.
1808 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1809 the StartBit and the EndBit. The value of the bit field is returned.
1811 If 32-bit MMIO register operations are not supported, then ASSERT().
1812 If StartBit is greater than 31, then ASSERT().
1813 If EndBit is greater than 31, then ASSERT().
1814 If EndBit is less than StartBit, then ASSERT().
1816 @param Address MMIO register to read.
1817 @param StartBit The ordinal of the least significant bit in the bit field.
1819 @param EndBit The ordinal of the most significant bit in the bit field.
1822 @return The value read.
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.
2109 MmioBitFieldRead64 (
2115 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2119 Writes a bit field to a MMIO register.
2121 Writes Value to the bit field of the MMIO register. The bit field is
2122 specified by the StartBit and the EndBit. All other bits in the destination
2123 MMIO register are preserved. The new value of the 64-bit register is returned.
2125 If 64-bit MMIO register operations are not supported, then ASSERT().
2126 If StartBit is greater than 63, then ASSERT().
2127 If EndBit is greater than 63, then ASSERT().
2128 If EndBit is less than StartBit, then ASSERT().
2130 @param Address MMIO register to write.
2131 @param StartBit The ordinal of the least significant bit in the bit field.
2133 @param EndBit The ordinal of the most significant bit in the bit field.
2135 @param Value New value of the bit field.
2137 @return The value written back to the MMIO register.
2142 MmioBitFieldWrite64 (
2149 return MmioWrite64 (
2151 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2156 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2157 writes the result back to the bit field in the 64-bit MMIO register.
2159 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2160 inclusive OR between the read result and the value specified by OrData, and
2161 writes the result to the 64-bit MMIO register specified by Address. The value
2162 written to the MMIO register is returned. This function must guarantee that
2163 all MMIO read and write operations are serialized. Extra left bits in OrData
2166 If 64-bit MMIO register operations are not supported, then ASSERT().
2167 If StartBit is greater than 63, then ASSERT().
2168 If EndBit is greater than 63, then ASSERT().
2169 If EndBit is less than StartBit, then ASSERT().
2171 @param Address MMIO register to write.
2172 @param StartBit The ordinal of the least significant bit in the bit field.
2174 @param EndBit The ordinal of the most significant bit in the bit field.
2176 @param OrData The value to OR with read value from the MMIO register.
2178 @return The value written back to the MMIO register.
2190 return MmioWrite64 (
2192 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2197 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2198 writes the result back to the bit field in the 64-bit MMIO register.
2200 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2201 between the read result and the value specified by AndData, and writes the
2202 result to the 64-bit MMIO register specified by Address. The value written to
2203 the MMIO register is returned. This function must guarantee that all MMIO
2204 read and write operations are serialized. Extra left bits in AndData are
2207 If 64-bit MMIO register operations are not supported, then ASSERT().
2208 If StartBit is greater than 63, then ASSERT().
2209 If EndBit is greater than 63, then ASSERT().
2210 If EndBit is less than StartBit, then ASSERT().
2212 @param Address MMIO register to write.
2213 @param StartBit The ordinal of the least significant bit in the bit field.
2215 @param EndBit The ordinal of the most significant bit in the bit field.
2217 @param AndData The value to AND with read value from the MMIO register.
2219 @return The value written back to the MMIO register.
2231 return MmioWrite64 (
2233 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2238 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2239 by a bitwise inclusive OR, and writes the result back to the bit field in the
2240 64-bit MMIO register.
2242 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2243 followed by a bitwise inclusive OR between the read result and the value
2244 specified by AndData, and writes the result to the 64-bit MMIO register
2245 specified by Address. The value written to the MMIO register is returned.
2246 This function must guarantee that all MMIO read and write operations are
2247 serialized. Extra left bits in both AndData and OrData are stripped.
2249 If 64-bit MMIO register operations are not supported, then ASSERT().
2250 If StartBit is greater than 63, then ASSERT().
2251 If EndBit is greater than 63, then ASSERT().
2252 If EndBit is less than StartBit, then ASSERT().
2254 @param Address MMIO register to write.
2255 @param StartBit The ordinal of the least significant bit in the bit field.
2257 @param EndBit The ordinal of the most significant bit in the bit field.
2259 @param AndData The value to AND with read value from the MMIO register.
2260 @param OrData The value to OR with the result of the AND operation.
2262 @return The value written back to the MMIO register.
2267 MmioBitFieldAndThenOr64 (
2275 return MmioWrite64 (
2277 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)