bfb6527324e452cb4256669d6953a00562404db1
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 "DxeCpuIoLibInternal.h"
30 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
31 result back to the 8-bit I/O port.
33 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
34 between the read result and the value specified by OrData, and writes the
35 result to the 8-bit I/O port specified by Port. The value written to the I/O
36 port is returned. This function must guarantee that all I/O read and write
37 operations are serialized.
39 If 8-bit I/O port operations are not supported, then ASSERT().
41 @param Port The I/O port to write.
42 @param OrData The value to OR with the read value from the I/O port.
44 @return The value written back to the I/O port.
54 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
58 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
59 to the 8-bit I/O port.
61 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
62 the read result and the value specified by AndData, and writes the result to
63 the 8-bit I/O port specified by Port. The value written to the I/O port is
64 returned. This function must guarantee that all I/O read and write operations
67 If 8-bit I/O port operations are not supported, then ASSERT().
69 @param Port The I/O port to write.
70 @param AndData The value to AND with the read value from the I/O port.
72 @return The value written back to the I/O port.
82 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
86 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
87 inclusive OR, and writes the result back to the 8-bit I/O port.
89 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
90 the read result and the value specified by AndData, performs a bitwise OR
91 between the result of the AND operation and the value specified by OrData,
92 and writes the result to the 8-bit I/O port specified by Port. The value
93 written to the I/O port is returned. This function must guarantee that all
94 I/O read and write operations are serialized.
96 If 8-bit I/O port operations are not supported, then ASSERT().
98 @param Port The I/O port to write.
99 @param AndData The value to AND with the read value from the I/O port.
100 @param OrData The value to OR with the result of the AND operation.
102 @return The value written back to the I/O port.
113 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
117 Reads a bit field of an I/O register.
119 Reads the bit field in an 8-bit I/O register. The bit field is specified by
120 the StartBit and the EndBit. The value of the bit field is returned.
122 If 8-bit I/O port operations are not supported, then ASSERT().
123 If StartBit is greater than 7, then ASSERT().
124 If EndBit is greater than 7, then ASSERT().
125 If EndBit is less than StartBit, then ASSERT().
127 @param Port The I/O port to read.
128 @param StartBit The ordinal of the least significant bit in the bit field.
130 @param EndBit The ordinal of the most significant bit in the bit field.
133 @return The value read.
144 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
148 Writes a bit field to an I/O register.
150 Writes Value to the bit field of the I/O register. The bit field is specified
151 by the StartBit and the EndBit. All other bits in the destination I/O
152 register are preserved. The value written to the I/O port is returned. Extra
153 left bits in Value are stripped.
155 If 8-bit I/O port operations are not supported, then ASSERT().
156 If StartBit is greater than 7, then ASSERT().
157 If EndBit is greater than 7, then ASSERT().
158 If EndBit is less than StartBit, then ASSERT().
160 @param Port The I/O port to write.
161 @param StartBit The ordinal of the least significant bit in the bit field.
163 @param EndBit The ordinal of the most significant bit in the bit field.
165 @param Value New value of the bit field.
167 @return The value written back to the I/O port.
181 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
186 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
187 result back to the bit field in the 8-bit port.
189 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
190 between the read result and the value specified by OrData, and writes the
191 result to the 8-bit I/O port specified by Port. The value written to the I/O
192 port is returned. This function must guarantee that all I/O read and write
193 operations are serialized. Extra left bits in OrData are stripped.
195 If 8-bit I/O port operations are not supported, then ASSERT().
196 If StartBit is greater than 7, then ASSERT().
197 If EndBit is greater than 7, then ASSERT().
198 If EndBit is less than StartBit, then ASSERT().
200 @param Port The I/O port to write.
201 @param StartBit The ordinal of the least significant bit in the bit field.
203 @param EndBit The ordinal of the most significant bit in the bit field.
205 @param OrData The value to OR with the read value from the I/O port.
207 @return The value written back to the I/O port.
221 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
226 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
227 result back to the bit field in the 8-bit port.
229 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
230 the read result and the value specified by AndData, and writes the result to
231 the 8-bit I/O port specified by Port. The value written to the I/O port is
232 returned. This function must guarantee that all I/O read and write operations
233 are serialized. Extra left bits in AndData are stripped.
235 If 8-bit I/O port operations are not supported, then ASSERT().
236 If StartBit is greater than 7, then ASSERT().
237 If EndBit is greater than 7, then ASSERT().
238 If EndBit is less than StartBit, then ASSERT().
240 @param Port The I/O port to write.
241 @param StartBit The ordinal of the least significant bit in the bit field.
243 @param EndBit The ordinal of the most significant bit in the bit field.
245 @param AndData The value to AND with the read value from the I/O port.
247 @return The value written back to the I/O port.
261 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
266 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
267 bitwise inclusive OR, and writes the result back to the bit field in the
270 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
271 by a bitwise inclusive OR between the read result and the value specified by
272 AndData, and writes the result to the 8-bit I/O port specified by Port. The
273 value written to the I/O port is returned. This function must guarantee that
274 all I/O read and write operations are serialized. Extra left bits in both
275 AndData and OrData are stripped.
277 If 8-bit I/O port operations are not supported, then ASSERT().
278 If StartBit is greater than 7, then ASSERT().
279 If EndBit is greater than 7, then ASSERT().
280 If EndBit is less than StartBit, then ASSERT().
282 @param Port The I/O port to write.
283 @param StartBit The ordinal of the least significant bit in the bit field.
285 @param EndBit The ordinal of the most significant bit in the bit field.
287 @param AndData The value to AND with the read value from the I/O port.
288 @param OrData The value to OR with the result of the AND operation.
290 @return The value written back to the I/O port.
295 IoBitFieldAndThenOr8 (
305 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
310 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
311 result back to the 16-bit I/O port.
313 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
314 between the read result and the value specified by OrData, and writes the
315 result to the 16-bit I/O port specified by Port. The value written to the I/O
316 port is returned. This function must guarantee that all I/O read and write
317 operations are serialized.
319 If 16-bit I/O port operations are not supported, then ASSERT().
321 @param Port The I/O port to write.
322 @param OrData The value to OR with the read value from the I/O port.
324 @return The value written back to the I/O port.
334 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
338 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
339 to the 16-bit I/O port.
341 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
342 the read result and the value specified by AndData, and writes the result to
343 the 16-bit I/O port specified by Port. The value written to the I/O port is
344 returned. This function must guarantee that all I/O read and write operations
347 If 16-bit I/O port operations are not supported, then ASSERT().
349 @param Port The I/O port to write.
350 @param AndData The value to AND with the read value from the I/O port.
352 @return The value written back to the I/O port.
362 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
366 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
367 inclusive OR, and writes the result back to the 16-bit I/O port.
369 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
370 the read result and the value specified by AndData, performs a bitwise OR
371 between the result of the AND operation and the value specified by OrData,
372 and writes the result to the 16-bit I/O port specified by Port. The value
373 written to the I/O port is returned. This function must guarantee that all
374 I/O read and write operations are serialized.
376 If 16-bit I/O port operations are not supported, then ASSERT().
378 @param Port The I/O port to write.
379 @param AndData The value to AND with the read value from the I/O port.
380 @param OrData The value to OR with the result of the AND operation.
382 @return The value written back to the I/O port.
393 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
397 Reads a bit field of an I/O register.
399 Reads the bit field in a 16-bit I/O register. The bit field is specified by
400 the StartBit and the EndBit. The value of the bit field is returned.
402 If 16-bit I/O port operations are not supported, then ASSERT().
403 If StartBit is greater than 15, then ASSERT().
404 If EndBit is greater than 15, then ASSERT().
405 If EndBit is less than StartBit, then ASSERT().
407 @param Port The I/O port to read.
408 @param StartBit The ordinal of the least significant bit in the bit field.
410 @param EndBit The ordinal of the most significant bit in the bit field.
413 @return The value read.
424 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
428 Writes a bit field to an I/O register.
430 Writes Value to the bit field of the I/O register. The bit field is specified
431 by the StartBit and the EndBit. All other bits in the destination I/O
432 register are preserved. The value written to the I/O port is returned. Extra
433 left bits in Value are stripped.
435 If 16-bit I/O port operations are not supported, then ASSERT().
436 If StartBit is greater than 15, then ASSERT().
437 If EndBit is greater than 15, then ASSERT().
438 If EndBit is less than StartBit, then ASSERT().
440 @param Port The I/O port to write.
441 @param StartBit The ordinal of the least significant bit in the bit field.
443 @param EndBit The ordinal of the most significant bit in the bit field.
445 @param Value New value of the bit field.
447 @return The value written back to the I/O port.
461 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
466 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
467 result back to the bit field in the 16-bit port.
469 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
470 between the read result and the value specified by OrData, and writes the
471 result to the 16-bit I/O port specified by Port. The value written to the I/O
472 port is returned. This function must guarantee that all I/O read and write
473 operations are serialized. Extra left bits in OrData are stripped.
475 If 16-bit I/O port operations are not supported, then ASSERT().
476 If StartBit is greater than 15, then ASSERT().
477 If EndBit is greater than 15, then ASSERT().
478 If EndBit is less than StartBit, then ASSERT().
480 @param Port The I/O port to write.
481 @param StartBit The ordinal of the least significant bit in the bit field.
483 @param EndBit The ordinal of the most significant bit in the bit field.
485 @param OrData The value to OR with the read value from the I/O port.
487 @return The value written back to the I/O port.
501 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
506 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
507 result back to the bit field in the 16-bit port.
509 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
510 the read result and the value specified by AndData, and writes the result to
511 the 16-bit I/O port specified by Port. The value written to the I/O port is
512 returned. This function must guarantee that all I/O read and write operations
513 are serialized. Extra left bits in AndData are stripped.
515 If 16-bit I/O port operations are not supported, then ASSERT().
516 If StartBit is greater than 15, then ASSERT().
517 If EndBit is greater than 15, then ASSERT().
518 If EndBit is less than StartBit, then ASSERT().
520 @param Port The I/O port to write.
521 @param StartBit The ordinal of the least significant bit in the bit field.
523 @param EndBit The ordinal of the most significant bit in the bit field.
525 @param AndData The value to AND with the read value from the I/O port.
527 @return The value written back to the I/O port.
541 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
546 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
547 bitwise inclusive OR, and writes the result back to the bit field in the
550 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
551 by a bitwise inclusive OR between the read result and the value specified by
552 AndData, and writes the result to the 16-bit I/O port specified by Port. The
553 value written to the I/O port is returned. This function must guarantee that
554 all I/O read and write operations are serialized. Extra left bits in both
555 AndData and OrData are stripped.
557 If 16-bit I/O port operations are not supported, then ASSERT().
558 If StartBit is greater than 15, then ASSERT().
559 If EndBit is greater than 15, then ASSERT().
560 If EndBit is less than StartBit, then ASSERT().
562 @param Port The I/O port to write.
563 @param StartBit The ordinal of the least significant bit in the bit field.
565 @param EndBit The ordinal of the most significant bit in the bit field.
567 @param AndData The value to AND with the read value from the I/O port.
568 @param OrData The value to OR with the result of the AND operation.
570 @return The value written back to the I/O port.
575 IoBitFieldAndThenOr16 (
585 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
590 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
591 result back to the 32-bit I/O port.
593 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
594 between the read result and the value specified by OrData, and writes the
595 result to the 32-bit I/O port specified by Port. The value written to the I/O
596 port is returned. This function must guarantee that all I/O read and write
597 operations are serialized.
599 If 32-bit I/O port operations are not supported, then ASSERT().
601 @param Port The I/O port to write.
602 @param OrData The value to OR with the read value from the I/O port.
604 @return The value written back to the I/O port.
614 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
618 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
619 to the 32-bit I/O port.
621 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
622 the read result and the value specified by AndData, and writes the result to
623 the 32-bit I/O port specified by Port. The value written to the I/O port is
624 returned. This function must guarantee that all I/O read and write operations
627 If 32-bit I/O port operations are not supported, then ASSERT().
629 @param Port The I/O port to write.
630 @param AndData The value to AND with the read value from the I/O port.
632 @return The value written back to the I/O port.
642 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
646 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
647 inclusive OR, and writes the result back to the 32-bit I/O port.
649 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
650 the read result and the value specified by AndData, performs a bitwise OR
651 between the result of the AND operation and the value specified by OrData,
652 and writes the result to the 32-bit I/O port specified by Port. The value
653 written to the I/O port is returned. This function must guarantee that all
654 I/O read and write operations are serialized.
656 If 32-bit I/O port operations are not supported, then ASSERT().
658 @param Port The I/O port to write.
659 @param AndData The value to AND with the read value from the I/O port.
660 @param OrData The value to OR with the result of the AND operation.
662 @return The value written back to the I/O port.
673 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
677 Reads a bit field of an I/O register.
679 Reads the bit field in a 32-bit I/O register. The bit field is specified by
680 the StartBit and the EndBit. The value of the bit field is returned.
682 If 32-bit I/O port operations are not supported, then ASSERT().
683 If StartBit is greater than 31, then ASSERT().
684 If EndBit is greater than 31, then ASSERT().
685 If EndBit is less than StartBit, then ASSERT().
687 @param Port The I/O port to read.
688 @param StartBit The ordinal of the least significant bit in the bit field.
690 @param EndBit The ordinal of the most significant bit in the bit field.
693 @return The value read.
704 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
708 Writes a bit field to an I/O register.
710 Writes Value to the bit field of the I/O register. The bit field is specified
711 by the StartBit and the EndBit. All other bits in the destination I/O
712 register are preserved. The value written to the I/O port is returned. Extra
713 left bits in Value are stripped.
715 If 32-bit I/O port operations are not supported, then ASSERT().
716 If StartBit is greater than 31, then ASSERT().
717 If EndBit is greater than 31, then ASSERT().
718 If EndBit is less than StartBit, then ASSERT().
720 @param Port The I/O port to write.
721 @param StartBit The ordinal of the least significant bit in the bit field.
723 @param EndBit The ordinal of the most significant bit in the bit field.
725 @param Value New value of the bit field.
727 @return The value written back to the I/O port.
741 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
746 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
747 result back to the bit field in the 32-bit port.
749 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
750 between the read result and the value specified by OrData, and writes the
751 result to the 32-bit I/O port specified by Port. The value written to the I/O
752 port is returned. This function must guarantee that all I/O read and write
753 operations are serialized. Extra left bits in OrData are stripped.
755 If 32-bit I/O port operations are not supported, then ASSERT().
756 If StartBit is greater than 31, then ASSERT().
757 If EndBit is greater than 31, then ASSERT().
758 If EndBit is less than StartBit, then ASSERT().
760 @param Port The I/O port to write.
761 @param StartBit The ordinal of the least significant bit in the bit field.
763 @param EndBit The ordinal of the most significant bit in the bit field.
765 @param OrData The value to OR with the read value from the I/O port.
767 @return The value written back to the I/O port.
781 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
786 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
787 result back to the bit field in the 32-bit port.
789 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
790 the read result and the value specified by AndData, and writes the result to
791 the 32-bit I/O port specified by Port. The value written to the I/O port is
792 returned. This function must guarantee that all I/O read and write operations
793 are serialized. Extra left bits in AndData are stripped.
795 If 32-bit I/O port operations are not supported, then ASSERT().
796 If StartBit is greater than 31, then ASSERT().
797 If EndBit is greater than 31, then ASSERT().
798 If EndBit is less than StartBit, then ASSERT().
800 @param Port The I/O port to write.
801 @param StartBit The ordinal of the least significant bit in the bit field.
803 @param EndBit The ordinal of the most significant bit in the bit field.
805 @param AndData The value to AND with the read value from the I/O port.
807 @return The value written back to the I/O port.
821 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
826 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
827 bitwise inclusive OR, and writes the result back to the bit field in the
830 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
831 by a bitwise inclusive OR between the read result and the value specified by
832 AndData, and writes the result to the 32-bit I/O port specified by Port. The
833 value written to the I/O port is returned. This function must guarantee that
834 all I/O read and write operations are serialized. Extra left bits in both
835 AndData and OrData are stripped.
837 If 32-bit I/O port operations are not supported, then ASSERT().
838 If StartBit is greater than 31, then ASSERT().
839 If EndBit is greater than 31, then ASSERT().
840 If EndBit is less than StartBit, then ASSERT().
842 @param Port The I/O port to write.
843 @param StartBit The ordinal of the least significant bit in the bit field.
845 @param EndBit The ordinal of the most significant bit in the bit field.
847 @param AndData The value to AND with the read value from the I/O port.
848 @param OrData The value to OR with the result of the AND operation.
850 @return The value written back to the I/O port.
855 IoBitFieldAndThenOr32 (
865 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
870 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
871 result back to the 64-bit I/O port.
873 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
874 between the read result and the value specified by OrData, and writes the
875 result to the 64-bit I/O port specified by Port. The value written to the I/O
876 port is returned. This function must guarantee that all I/O read and write
877 operations are serialized.
879 If 64-bit I/O port operations are not supported, then ASSERT().
881 @param Port The I/O port to write.
882 @param OrData The value to OR with the read value from the I/O port.
884 @return The value written back to the I/O port.
894 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
898 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
899 to the 64-bit I/O port.
901 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
902 the read result and the value specified by AndData, and writes the result to
903 the 64-bit I/O port specified by Port. The value written to the I/O port is
904 returned. This function must guarantee that all I/O read and write operations
907 If 64-bit I/O port operations are not supported, then ASSERT().
909 @param Port The I/O port to write.
910 @param AndData The value to AND with the read value from the I/O port.
912 @return The value written back to the I/O port.
922 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
926 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
927 inclusive OR, and writes the result back to the 64-bit I/O port.
929 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
930 the read result and the value specified by AndData, performs a bitwise OR
931 between the result of the AND operation and the value specified by OrData,
932 and writes the result to the 64-bit I/O port specified by Port. The value
933 written to the I/O port is returned. This function must guarantee that all
934 I/O read and write operations are serialized.
936 If 64-bit I/O port operations are not supported, then ASSERT().
938 @param Port The I/O port to write.
939 @param AndData The value to AND with the read value from the I/O port.
940 @param OrData The value to OR with the result of the AND operation.
942 @return The value written back to the I/O port.
953 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
957 Reads a bit field of an I/O register.
959 Reads the bit field in a 64-bit I/O register. The bit field is specified by
960 the StartBit and the EndBit. The value of the bit field is returned.
962 If 64-bit I/O port operations are not supported, then ASSERT().
963 If StartBit is greater than 63, then ASSERT().
964 If EndBit is greater than 63, then ASSERT().
965 If EndBit is less than StartBit, then ASSERT().
967 @param Port The I/O port to read.
968 @param StartBit The ordinal of the least significant bit in the bit field.
970 @param EndBit The ordinal of the most significant bit in the bit field.
973 @return The value read.
984 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
988 Writes a bit field to an I/O register.
990 Writes Value to the bit field of the I/O register. The bit field is specified
991 by the StartBit and the EndBit. All other bits in the destination I/O
992 register are preserved. The value written to the I/O port is returned. Extra
993 left bits in Value are stripped.
995 If 64-bit I/O port operations are not supported, then ASSERT().
996 If StartBit is greater than 63, then ASSERT().
997 If EndBit is greater than 63, then ASSERT().
998 If EndBit is less than StartBit, then ASSERT().
1000 @param Port The I/O port to write.
1001 @param StartBit The ordinal of the least significant bit in the bit field.
1003 @param EndBit The ordinal of the most significant bit in the bit field.
1005 @param Value New value of the bit field.
1007 @return The value written back to the I/O port.
1021 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1026 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1027 result back to the bit field in the 64-bit port.
1029 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1030 between the read result and the value specified by OrData, and writes the
1031 result to the 64-bit I/O port specified by Port. The value written to the I/O
1032 port is returned. This function must guarantee that all I/O read and write
1033 operations are serialized. Extra left bits in OrData are stripped.
1035 If 64-bit I/O port operations are not supported, then ASSERT().
1036 If StartBit is greater than 63, then ASSERT().
1037 If EndBit is greater than 63, then ASSERT().
1038 If EndBit is less than StartBit, then ASSERT().
1040 @param Port The I/O port to write.
1041 @param StartBit The ordinal of the least significant bit in the bit field.
1043 @param EndBit The ordinal of the most significant bit in the bit field.
1045 @param OrData The value to OR with the read value from the I/O port.
1047 @return The value written back to the I/O port.
1061 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1066 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1067 result back to the bit field in the 64-bit port.
1069 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1070 the read result and the value specified by AndData, and writes the result to
1071 the 64-bit I/O port specified by Port. The value written to the I/O port is
1072 returned. This function must guarantee that all I/O read and write operations
1073 are serialized. Extra left bits in AndData are stripped.
1075 If 64-bit I/O port operations are not supported, then ASSERT().
1076 If StartBit is greater than 63, then ASSERT().
1077 If EndBit is greater than 63, then ASSERT().
1078 If EndBit is less than StartBit, then ASSERT().
1080 @param Port The I/O port to write.
1081 @param StartBit The ordinal of the least significant bit in the bit field.
1083 @param EndBit The ordinal of the most significant bit in the bit field.
1085 @param AndData The value to AND with the read value from the I/O port.
1087 @return The value written back to the I/O port.
1101 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1106 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1107 bitwise inclusive OR, and writes the result back to the bit field in the
1110 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1111 by a bitwise inclusive OR between the read result and the value specified by
1112 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1113 value written to the I/O port is returned. This function must guarantee that
1114 all I/O read and write operations are serialized. Extra left bits in both
1115 AndData and OrData are stripped.
1117 If 64-bit I/O port operations are not supported, then ASSERT().
1118 If StartBit is greater than 63, then ASSERT().
1119 If EndBit is greater than 63, then ASSERT().
1120 If EndBit is less than StartBit, then ASSERT().
1122 @param Port The I/O port to write.
1123 @param StartBit The ordinal of the least significant bit in the bit field.
1125 @param EndBit The ordinal of the most significant bit in the bit field.
1127 @param AndData The value to AND with the read value from the I/O port.
1128 @param OrData The value to OR with the result of the AND operation.
1130 @return The value written back to the I/O port.
1135 IoBitFieldAndThenOr64 (
1145 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1150 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1151 result back to the 8-bit MMIO register.
1153 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1154 inclusive OR between the read result and the value specified by OrData, and
1155 writes the result to the 8-bit MMIO register specified by Address. The value
1156 written to the MMIO register is returned. This function must guarantee that
1157 all MMIO read and write operations are serialized.
1159 If 8-bit MMIO register operations are not supported, then ASSERT().
1161 @param Address The MMIO register to write.
1162 @param OrData The value to OR with the read value from the MMIO register.
1164 @return The value written back to the MMIO register.
1174 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1178 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1179 back to the 8-bit MMIO register.
1181 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1182 between the read result and the value specified by AndData, and writes the
1183 result to the 8-bit MMIO register specified by Address. The value written to
1184 the MMIO register is returned. This function must guarantee that all MMIO
1185 read and write operations are serialized.
1187 If 8-bit MMIO register operations are not supported, then ASSERT().
1189 @param Address The MMIO register to write.
1190 @param AndData The value to AND with the read value from the MMIO register.
1192 @return The value written back to the MMIO register.
1202 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1206 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1207 inclusive OR, and writes the result back to the 8-bit MMIO register.
1209 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1210 between the read result and the value specified by AndData, performs a
1211 bitwise OR between the result of the AND operation and the value specified by
1212 OrData, and writes the result to the 8-bit MMIO register specified by
1213 Address. The value written to the MMIO register is returned. This function
1214 must guarantee that all MMIO read and write operations are serialized.
1216 If 8-bit MMIO register operations are not supported, then ASSERT().
1219 @param Address The MMIO register to write.
1220 @param AndData The value to AND with the read value from the MMIO register.
1221 @param OrData The value to OR with the result of the AND operation.
1223 @return The value written back to the MMIO register.
1234 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1238 Reads a bit field of a MMIO register.
1240 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1241 the StartBit and the EndBit. The value of the bit field is returned.
1243 If 8-bit MMIO register operations are not supported, then ASSERT().
1244 If StartBit is greater than 7, then ASSERT().
1245 If EndBit is greater than 7, then ASSERT().
1246 If EndBit is less than StartBit, then ASSERT().
1248 @param Address MMIO register to read.
1249 @param StartBit The ordinal of the least significant bit in the bit field.
1251 @param EndBit The ordinal of the most significant bit in the bit field.
1254 @return The value read.
1265 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1269 Writes a bit field to a MMIO register.
1271 Writes Value to the bit field of the MMIO register. The bit field is
1272 specified by the StartBit and the EndBit. All other bits in the destination
1273 MMIO register are preserved. The new value of the 8-bit register is returned.
1275 If 8-bit MMIO register operations are not supported, then ASSERT().
1276 If StartBit is greater than 7, then ASSERT().
1277 If EndBit is greater than 7, then ASSERT().
1278 If EndBit is less than StartBit, then ASSERT().
1280 @param Address MMIO register to write.
1281 @param StartBit The ordinal of the least significant bit in the bit field.
1283 @param EndBit The ordinal of the most significant bit in the bit field.
1285 @param Value New value of the bit field.
1287 @return The value written back to the MMIO register.
1292 MmioBitFieldWrite8 (
1301 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1306 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1307 writes the result back to the bit field in the 8-bit MMIO register.
1309 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1310 inclusive OR between the read result and the value specified by OrData, and
1311 writes the result to the 8-bit MMIO register specified by Address. The value
1312 written to the MMIO register is returned. This function must guarantee that
1313 all MMIO read and write operations are serialized. Extra left bits in OrData
1316 If 8-bit MMIO register operations are not supported, then ASSERT().
1317 If StartBit is greater than 7, then ASSERT().
1318 If EndBit is greater than 7, then ASSERT().
1319 If EndBit is less than StartBit, then ASSERT().
1321 @param Address MMIO register to write.
1322 @param StartBit The ordinal of the least significant bit in the bit field.
1324 @param EndBit The ordinal of the most significant bit in the bit field.
1326 @param OrData The value to OR with read value from the MMIO register.
1328 @return The value written back to the MMIO register.
1342 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1347 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1348 writes the result back to the bit field in the 8-bit MMIO register.
1350 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1351 between the read result and the value specified by AndData, and writes the
1352 result to the 8-bit MMIO register specified by Address. The value written to
1353 the MMIO register is returned. This function must guarantee that all MMIO
1354 read and write operations are serialized. Extra left bits in AndData are
1357 If 8-bit MMIO register operations are not supported, then ASSERT().
1358 If StartBit is greater than 7, then ASSERT().
1359 If EndBit is greater than 7, then ASSERT().
1360 If EndBit is less than StartBit, then ASSERT().
1362 @param Address MMIO register to write.
1363 @param StartBit The ordinal of the least significant bit in the bit field.
1365 @param EndBit The ordinal of the most significant bit in the bit field.
1367 @param AndData The value to AND with read value from the MMIO register.
1369 @return The value written back to the MMIO register.
1383 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1388 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1389 by a bitwise inclusive OR, and writes the result back to the bit field in the
1390 8-bit MMIO register.
1392 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1393 followed by a bitwise inclusive OR between the read result and the value
1394 specified by AndData, and writes the result to the 8-bit MMIO register
1395 specified by Address. The value written to the MMIO register is returned.
1396 This function must guarantee that all MMIO read and write operations are
1397 serialized. Extra left bits in both AndData and OrData are stripped.
1399 If 8-bit MMIO register operations are not supported, then ASSERT().
1400 If StartBit is greater than 7, then ASSERT().
1401 If EndBit is greater than 7, then ASSERT().
1402 If EndBit is less than StartBit, then ASSERT().
1404 @param Address MMIO register to write.
1405 @param StartBit The ordinal of the least significant bit in the bit field.
1407 @param EndBit The ordinal of the most significant bit in the bit field.
1409 @param AndData The value to AND with read value from the MMIO register.
1410 @param OrData The value to OR with the result of the AND operation.
1412 @return The value written back to the MMIO register.
1417 MmioBitFieldAndThenOr8 (
1427 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1432 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1433 result back to the 16-bit MMIO register.
1435 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1436 inclusive OR between the read result and the value specified by OrData, and
1437 writes the result to the 16-bit MMIO register specified by Address. The value
1438 written to the MMIO register is returned. This function must guarantee that
1439 all MMIO read and write operations are serialized.
1441 If 16-bit MMIO register operations are not supported, then ASSERT().
1443 @param Address The MMIO register to write.
1444 @param OrData The value to OR with the read value from the MMIO register.
1446 @return The value written back to the MMIO register.
1456 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1460 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1461 back to the 16-bit MMIO register.
1463 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1464 between the read result and the value specified by AndData, and writes the
1465 result to the 16-bit MMIO register specified by Address. The value written to
1466 the MMIO register is returned. This function must guarantee that all MMIO
1467 read and write operations are serialized.
1469 If 16-bit MMIO register operations are not supported, then ASSERT().
1471 @param Address The MMIO register to write.
1472 @param AndData The value to AND with the read value from the MMIO register.
1474 @return The value written back to the MMIO register.
1484 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1488 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1489 inclusive OR, and writes the result back to the 16-bit MMIO register.
1491 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1492 between the read result and the value specified by AndData, performs a
1493 bitwise OR between the result of the AND operation and the value specified by
1494 OrData, and writes the result to the 16-bit MMIO register specified by
1495 Address. The value written to the MMIO register is returned. This function
1496 must guarantee that all MMIO read and write operations are serialized.
1498 If 16-bit MMIO register operations are not supported, then ASSERT().
1501 @param Address The MMIO register to write.
1502 @param AndData The value to AND with the read value from the MMIO register.
1503 @param OrData The value to OR with the result of the AND operation.
1505 @return The value written back to the MMIO register.
1516 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1520 Reads a bit field of a MMIO register.
1522 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1523 the StartBit and the EndBit. The value of the bit field is returned.
1525 If 16-bit MMIO register operations are not supported, then ASSERT().
1526 If StartBit is greater than 15, then ASSERT().
1527 If EndBit is greater than 15, then ASSERT().
1528 If EndBit is less than StartBit, then ASSERT().
1530 @param Address MMIO register to read.
1531 @param StartBit The ordinal of the least significant bit in the bit field.
1533 @param EndBit The ordinal of the most significant bit in the bit field.
1536 @return The value read.
1541 MmioBitFieldRead16 (
1547 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1551 Writes a bit field to a MMIO register.
1553 Writes Value to the bit field of the MMIO register. The bit field is
1554 specified by the StartBit and the EndBit. All other bits in the destination
1555 MMIO register are preserved. The new value of the 16-bit register is returned.
1557 If 16-bit MMIO register operations are not supported, then ASSERT().
1558 If StartBit is greater than 15, then ASSERT().
1559 If EndBit is greater than 15, then ASSERT().
1560 If EndBit is less than StartBit, then ASSERT().
1562 @param Address MMIO register to write.
1563 @param StartBit The ordinal of the least significant bit in the bit field.
1565 @param EndBit The ordinal of the most significant bit in the bit field.
1567 @param Value New value of the bit field.
1569 @return The value written back to the MMIO register.
1574 MmioBitFieldWrite16 (
1581 return MmioWrite16 (
1583 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1588 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1589 writes the result back to the bit field in the 16-bit MMIO register.
1591 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1592 inclusive OR between the read result and the value specified by OrData, and
1593 writes the result to the 16-bit MMIO register specified by Address. The value
1594 written to the MMIO register is returned. This function must guarantee that
1595 all MMIO read and write operations are serialized. Extra left bits in OrData
1598 If 16-bit MMIO register operations are not supported, then ASSERT().
1599 If StartBit is greater than 15, then ASSERT().
1600 If EndBit is greater than 15, then ASSERT().
1601 If EndBit is less than StartBit, then ASSERT().
1603 @param Address MMIO register to write.
1604 @param StartBit The ordinal of the least significant bit in the bit field.
1606 @param EndBit The ordinal of the most significant bit in the bit field.
1608 @param OrData The value to OR with read value from the MMIO register.
1610 @return The value written back to the MMIO register.
1622 return MmioWrite16 (
1624 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1629 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1630 writes the result back to the bit field in the 16-bit MMIO register.
1632 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1633 between the read result and the value specified by AndData, and writes the
1634 result to the 16-bit MMIO register specified by Address. The value written to
1635 the MMIO register is returned. This function must guarantee that all MMIO
1636 read and write operations are serialized. Extra left bits in AndData are
1639 If 16-bit MMIO register operations are not supported, then ASSERT().
1640 If StartBit is greater than 15, then ASSERT().
1641 If EndBit is greater than 15, then ASSERT().
1642 If EndBit is less than StartBit, then ASSERT().
1644 @param Address MMIO register to write.
1645 @param StartBit The ordinal of the least significant bit in the bit field.
1647 @param EndBit The ordinal of the most significant bit in the bit field.
1649 @param AndData The value to AND with read value from the MMIO register.
1651 @return The value written back to the MMIO register.
1663 return MmioWrite16 (
1665 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1670 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1671 by a bitwise inclusive OR, and writes the result back to the bit field in the
1672 16-bit MMIO register.
1674 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1675 followed by a bitwise inclusive OR between the read result and the value
1676 specified by AndData, and writes the result to the 16-bit MMIO register
1677 specified by Address. The value written to the MMIO register is returned.
1678 This function must guarantee that all MMIO read and write operations are
1679 serialized. Extra left bits in both AndData and OrData are stripped.
1681 If 16-bit MMIO register operations are not supported, then ASSERT().
1682 If StartBit is greater than 15, then ASSERT().
1683 If EndBit is greater than 15, then ASSERT().
1684 If EndBit is less than StartBit, then ASSERT().
1686 @param Address MMIO register to write.
1687 @param StartBit The ordinal of the least significant bit in the bit field.
1689 @param EndBit The ordinal of the most significant bit in the bit field.
1691 @param AndData The value to AND with read value from the MMIO register.
1692 @param OrData The value to OR with the result of the AND operation.
1694 @return The value written back to the MMIO register.
1699 MmioBitFieldAndThenOr16 (
1707 return MmioWrite16 (
1709 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1714 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1715 result back to the 32-bit MMIO register.
1717 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1718 inclusive OR between the read result and the value specified by OrData, and
1719 writes the result to the 32-bit MMIO register specified by Address. The value
1720 written to the MMIO register is returned. This function must guarantee that
1721 all MMIO read and write operations are serialized.
1723 If 32-bit MMIO register operations are not supported, then ASSERT().
1725 @param Address The MMIO register to write.
1726 @param OrData The value to OR with the read value from the MMIO register.
1728 @return The value written back to the MMIO register.
1738 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1742 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1743 back to the 32-bit MMIO register.
1745 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1746 between the read result and the value specified by AndData, and writes the
1747 result to the 32-bit MMIO register specified by Address. The value written to
1748 the MMIO register is returned. This function must guarantee that all MMIO
1749 read and write operations are serialized.
1751 If 32-bit MMIO register operations are not supported, then ASSERT().
1753 @param Address The MMIO register to write.
1754 @param AndData The value to AND with the read value from the MMIO register.
1756 @return The value written back to the MMIO register.
1766 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1770 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1771 inclusive OR, and writes the result back to the 32-bit MMIO register.
1773 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1774 between the read result and the value specified by AndData, performs a
1775 bitwise OR between the result of the AND operation and the value specified by
1776 OrData, and writes the result to the 32-bit MMIO register specified by
1777 Address. The value written to the MMIO register is returned. This function
1778 must guarantee that all MMIO read and write operations are serialized.
1780 If 32-bit MMIO register operations are not supported, then ASSERT().
1783 @param Address The MMIO register to write.
1784 @param AndData The value to AND with the read value from the MMIO register.
1785 @param OrData The value to OR with the result of the AND operation.
1787 @return The value written back to the MMIO register.
1798 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1802 Reads a bit field of a MMIO register.
1804 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1805 the StartBit and the EndBit. The value of the bit field is returned.
1807 If 32-bit MMIO register operations are not supported, then ASSERT().
1808 If StartBit is greater than 31, then ASSERT().
1809 If EndBit is greater than 31, then ASSERT().
1810 If EndBit is less than StartBit, then ASSERT().
1812 @param Address MMIO register to read.
1813 @param StartBit The ordinal of the least significant bit in the bit field.
1815 @param EndBit The ordinal of the most significant bit in the bit field.
1818 @return The value read.
1823 MmioBitFieldRead32 (
1829 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1833 Writes a bit field to a MMIO register.
1835 Writes Value to the bit field of the MMIO register. The bit field is
1836 specified by the StartBit and the EndBit. All other bits in the destination
1837 MMIO register are preserved. The new value of the 32-bit register is returned.
1839 If 32-bit MMIO register operations are not supported, then ASSERT().
1840 If StartBit is greater than 31, then ASSERT().
1841 If EndBit is greater than 31, then ASSERT().
1842 If EndBit is less than StartBit, then ASSERT().
1844 @param Address MMIO register to write.
1845 @param StartBit The ordinal of the least significant bit in the bit field.
1847 @param EndBit The ordinal of the most significant bit in the bit field.
1849 @param Value New value of the bit field.
1851 @return The value written back to the MMIO register.
1856 MmioBitFieldWrite32 (
1863 return MmioWrite32 (
1865 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1870 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1871 writes the result back to the bit field in the 32-bit MMIO register.
1873 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1874 inclusive OR between the read result and the value specified by OrData, and
1875 writes the result to the 32-bit MMIO register specified by Address. The value
1876 written to the MMIO register is returned. This function must guarantee that
1877 all MMIO read and write operations are serialized. Extra left bits in OrData
1880 If 32-bit MMIO register operations are not supported, then ASSERT().
1881 If StartBit is greater than 31, then ASSERT().
1882 If EndBit is greater than 31, then ASSERT().
1883 If EndBit is less than StartBit, then ASSERT().
1885 @param Address MMIO register to write.
1886 @param StartBit The ordinal of the least significant bit in the bit field.
1888 @param EndBit The ordinal of the most significant bit in the bit field.
1890 @param OrData The value to OR with read value from the MMIO register.
1892 @return The value written back to the MMIO register.
1904 return MmioWrite32 (
1906 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1911 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1912 writes the result back to the bit field in the 32-bit MMIO register.
1914 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1915 between the read result and the value specified by AndData, and writes the
1916 result to the 32-bit MMIO register specified by Address. The value written to
1917 the MMIO register is returned. This function must guarantee that all MMIO
1918 read and write operations are serialized. Extra left bits in AndData are
1921 If 32-bit MMIO register operations are not supported, then ASSERT().
1922 If StartBit is greater than 31, then ASSERT().
1923 If EndBit is greater than 31, then ASSERT().
1924 If EndBit is less than StartBit, then ASSERT().
1926 @param Address MMIO register to write.
1927 @param StartBit The ordinal of the least significant bit in the bit field.
1929 @param EndBit The ordinal of the most significant bit in the bit field.
1931 @param AndData The value to AND with read value from the MMIO register.
1933 @return The value written back to the MMIO register.
1945 return MmioWrite32 (
1947 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1952 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1953 by a bitwise inclusive OR, and writes the result back to the bit field in the
1954 32-bit MMIO register.
1956 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1957 followed by a bitwise inclusive OR between the read result and the value
1958 specified by AndData, and writes the result to the 32-bit MMIO register
1959 specified by Address. The value written to the MMIO register is returned.
1960 This function must guarantee that all MMIO read and write operations are
1961 serialized. Extra left bits in both AndData and OrData are stripped.
1963 If 32-bit MMIO register operations are not supported, then ASSERT().
1964 If StartBit is greater than 31, then ASSERT().
1965 If EndBit is greater than 31, then ASSERT().
1966 If EndBit is less than StartBit, then ASSERT().
1968 @param Address MMIO register to write.
1969 @param StartBit The ordinal of the least significant bit in the bit field.
1971 @param EndBit The ordinal of the most significant bit in the bit field.
1973 @param AndData The value to AND with read value from the MMIO register.
1974 @param OrData The value to OR with the result of the AND operation.
1976 @return The value written back to the MMIO register.
1981 MmioBitFieldAndThenOr32 (
1989 return MmioWrite32 (
1991 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1996 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
1997 result back to the 64-bit MMIO register.
1999 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2000 inclusive OR between the read result and the value specified by OrData, and
2001 writes the result to the 64-bit MMIO register specified by Address. The value
2002 written to the MMIO register is returned. This function must guarantee that
2003 all MMIO read and write operations are serialized.
2005 If 64-bit MMIO register operations are not supported, then ASSERT().
2007 @param Address The MMIO register to write.
2008 @param OrData The value to OR with the read value from the MMIO register.
2010 @return The value written back to the MMIO register.
2020 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2024 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2025 back to the 64-bit MMIO register.
2027 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2028 between the read result and the value specified by AndData, and writes the
2029 result to the 64-bit MMIO register specified by Address. The value written to
2030 the MMIO register is returned. This function must guarantee that all MMIO
2031 read and write operations are serialized.
2033 If 64-bit MMIO register operations are not supported, then ASSERT().
2035 @param Address The MMIO register to write.
2036 @param AndData The value to AND with the read value from the MMIO register.
2038 @return The value written back to the MMIO register.
2048 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2052 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2053 inclusive OR, and writes the result back to the 64-bit MMIO register.
2055 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2056 between the read result and the value specified by AndData, performs a
2057 bitwise OR between the result of the AND operation and the value specified by
2058 OrData, and writes the result to the 64-bit MMIO register specified by
2059 Address. The value written to the MMIO register is returned. This function
2060 must guarantee that all MMIO read and write operations are serialized.
2062 If 64-bit MMIO register operations are not supported, then ASSERT().
2065 @param Address The MMIO register to write.
2066 @param AndData The value to AND with the read value from the MMIO register.
2067 @param OrData The value to OR with the result of the AND operation.
2069 @return The value written back to the MMIO register.
2080 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2084 Reads a bit field of a MMIO register.
2086 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2087 the StartBit and the EndBit. The value of the bit field is returned.
2089 If 64-bit MMIO register operations are not supported, then ASSERT().
2090 If StartBit is greater than 63, then ASSERT().
2091 If EndBit is greater than 63, then ASSERT().
2092 If EndBit is less than StartBit, then ASSERT().
2094 @param Address MMIO register to read.
2095 @param StartBit The ordinal of the least significant bit in the bit field.
2097 @param EndBit The ordinal of the most significant bit in the bit field.
2100 @return The value read.
2105 MmioBitFieldRead64 (
2111 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2115 Writes a bit field to a MMIO register.
2117 Writes Value to the bit field of the MMIO register. The bit field is
2118 specified by the StartBit and the EndBit. All other bits in the destination
2119 MMIO register are preserved. The new value of the 64-bit register is returned.
2121 If 64-bit MMIO register operations are not supported, then ASSERT().
2122 If StartBit is greater than 63, then ASSERT().
2123 If EndBit is greater than 63, then ASSERT().
2124 If EndBit is less than StartBit, then ASSERT().
2126 @param Address MMIO register to write.
2127 @param StartBit The ordinal of the least significant bit in the bit field.
2129 @param EndBit The ordinal of the most significant bit in the bit field.
2131 @param Value New value of the bit field.
2133 @return The value written back to the MMIO register.
2138 MmioBitFieldWrite64 (
2145 return MmioWrite64 (
2147 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2152 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2153 writes the result back to the bit field in the 64-bit MMIO register.
2155 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2156 inclusive OR between the read result and the value specified by OrData, and
2157 writes the result to the 64-bit MMIO register specified by Address. The value
2158 written to the MMIO register is returned. This function must guarantee that
2159 all MMIO read and write operations are serialized. Extra left bits in OrData
2162 If 64-bit MMIO register operations are not supported, then ASSERT().
2163 If StartBit is greater than 63, then ASSERT().
2164 If EndBit is greater than 63, then ASSERT().
2165 If EndBit is less than StartBit, then ASSERT().
2167 @param Address MMIO register to write.
2168 @param StartBit The ordinal of the least significant bit in the bit field.
2170 @param EndBit The ordinal of the most significant bit in the bit field.
2172 @param OrData The value to OR with read value from the MMIO register.
2174 @return The value written back to the MMIO register.
2186 return MmioWrite64 (
2188 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2193 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2194 writes the result back to the bit field in the 64-bit MMIO register.
2196 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2197 between the read result and the value specified by AndData, and writes the
2198 result to the 64-bit MMIO register specified by Address. The value written to
2199 the MMIO register is returned. This function must guarantee that all MMIO
2200 read and write operations are serialized. Extra left bits in AndData are
2203 If 64-bit MMIO register operations are not supported, then ASSERT().
2204 If StartBit is greater than 63, then ASSERT().
2205 If EndBit is greater than 63, then ASSERT().
2206 If EndBit is less than StartBit, then ASSERT().
2208 @param Address MMIO register to write.
2209 @param StartBit The ordinal of the least significant bit in the bit field.
2211 @param EndBit The ordinal of the most significant bit in the bit field.
2213 @param AndData The value to AND with read value from the MMIO register.
2215 @return The value written back to the MMIO register.
2227 return MmioWrite64 (
2229 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2234 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2235 by a bitwise inclusive OR, and writes the result back to the bit field in the
2236 64-bit MMIO register.
2238 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2239 followed by a bitwise inclusive OR between the read result and the value
2240 specified by AndData, and writes the result to the 64-bit MMIO register
2241 specified by Address. The value written to the MMIO register is returned.
2242 This function must guarantee that all MMIO read and write operations are
2243 serialized. Extra left bits in both AndData and OrData are stripped.
2245 If 64-bit MMIO register operations are not supported, then ASSERT().
2246 If StartBit is greater than 63, then ASSERT().
2247 If EndBit is greater than 63, then ASSERT().
2248 If EndBit is less than StartBit, then ASSERT().
2250 @param Address MMIO register to write.
2251 @param StartBit The ordinal of the least significant bit in the bit field.
2253 @param EndBit The ordinal of the most significant bit in the bit field.
2255 @param AndData The value to AND with read value from the MMIO register.
2256 @param OrData The value to OR with the result of the AND operation.
2258 @return The value written back to the MMIO register.
2263 MmioBitFieldAndThenOr64 (
2271 return MmioWrite64 (
2273 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)