]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/DxeIoLibCpuIo2/IoHighLevel.c
2 High-level Io/Mmio functions.
4 All assertions for bit field operations are handled bit field functions in the
7 Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available
9 under the terms and conditions of the BSD License which accompanies this
10 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.
19 #include "DxeCpuIo2LibInternal.h"
22 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
23 result back to the 8-bit I/O port.
25 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
26 between the read result and the value specified by OrData, and writes the
27 result to the 8-bit I/O port specified by Port. The value written to the I/O
28 port is returned. This function must guarantee that all I/O read and write
29 operations are serialized.
31 If 8-bit I/O port operations are not supported, then ASSERT().
33 @param Port The I/O port to write.
34 @param OrData The value to OR with the read value from the I/O port.
36 @return The value written back to the I/O port.
46 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
50 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
51 to the 8-bit I/O port.
53 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
54 the read result and the value specified by AndData, and writes the result to
55 the 8-bit I/O port specified by Port. The value written to the I/O port is
56 returned. This function must guarantee that all I/O read and write operations
59 If 8-bit I/O port operations are not supported, then ASSERT().
61 @param Port The I/O port to write.
62 @param AndData The value to AND with the read value from the I/O port.
64 @return The value written back to the I/O port.
74 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
78 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
79 inclusive OR, and writes the result back to the 8-bit I/O port.
81 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
82 the read result and the value specified by AndData, performs a bitwise OR
83 between the result of the AND operation and the value specified by OrData,
84 and writes the result to the 8-bit I/O port specified by Port. The value
85 written to the I/O port is returned. This function must guarantee that all
86 I/O read and write operations are serialized.
88 If 8-bit I/O port operations are not supported, then ASSERT().
90 @param Port The I/O port to write.
91 @param AndData The value to AND with the read value from the I/O port.
92 @param OrData The value to OR with the result of the AND operation.
94 @return The value written back to the I/O port.
105 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
109 Reads a bit field of an I/O register.
111 Reads the bit field in an 8-bit I/O register. The bit field is specified by
112 the StartBit and the EndBit. The value of the bit field is returned.
114 If 8-bit I/O port operations are not supported, then ASSERT().
115 If StartBit is greater than 7, then ASSERT().
116 If EndBit is greater than 7, then ASSERT().
117 If EndBit is less than StartBit, then ASSERT().
119 @param Port The I/O port to read.
120 @param StartBit The ordinal of the least significant bit in the bit field.
122 @param EndBit The ordinal of the most significant bit in the bit field.
125 @return The value read.
136 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
140 Writes a bit field to an I/O register.
142 Writes Value to the bit field of the I/O register. The bit field is specified
143 by the StartBit and the EndBit. All other bits in the destination I/O
144 register are preserved. The value written to the I/O port is returned. Extra
145 left bits in Value are stripped.
147 If 8-bit I/O port operations are not supported, then ASSERT().
148 If StartBit is greater than 7, then ASSERT().
149 If EndBit is greater than 7, then ASSERT().
150 If EndBit is less than StartBit, then ASSERT().
151 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
153 @param Port The I/O port to write.
154 @param StartBit The ordinal of the least significant bit in the bit field.
156 @param EndBit The ordinal of the most significant bit in the bit field.
158 @param Value The new value of the bit field.
160 @return The value written back to the I/O port.
174 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
179 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
180 result back to the bit field in the 8-bit port.
182 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
183 between the read result and the value specified by OrData, and writes the
184 result to the 8-bit I/O port specified by Port. The value written to the I/O
185 port is returned. This function must guarantee that all I/O read and write
186 operations are serialized. Extra left bits in OrData are stripped.
188 If 8-bit I/O port operations are not supported, then ASSERT().
189 If StartBit is greater than 7, then ASSERT().
190 If EndBit is greater than 7, then ASSERT().
191 If EndBit is less than StartBit, then ASSERT().
192 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
194 @param Port The I/O port to write.
195 @param StartBit The ordinal of the least significant bit in the bit field.
197 @param EndBit The ordinal of the most significant bit in the bit field.
199 @param OrData The value to OR with the read value from the I/O port.
201 @return The value written back to the I/O port.
215 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
220 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
221 result back to the bit field in the 8-bit port.
223 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
224 the read result and the value specified by AndData, and writes the result to
225 the 8-bit I/O port specified by Port. The value written to the I/O port is
226 returned. This function must guarantee that all I/O read and write operations
227 are serialized. Extra left bits in AndData are stripped.
229 If 8-bit I/O port operations are not supported, then ASSERT().
230 If StartBit is greater than 7, then ASSERT().
231 If EndBit is greater than 7, then ASSERT().
232 If EndBit is less than StartBit, then ASSERT().
233 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
235 @param Port The I/O port to write.
236 @param StartBit The ordinal of the least significant bit in the bit field.
238 @param EndBit The ordinal of the most significant bit in the bit field.
240 @param AndData The value to AND with the read value from the I/O port.
242 @return The value written back to the I/O port.
256 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
261 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
262 bitwise OR, and writes the result back to the bit field in the
265 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
266 by a bitwise OR between the read result and the value specified by
267 AndData, and writes the result to the 8-bit I/O port specified by Port. The
268 value written to the I/O port is returned. This function must guarantee that
269 all I/O read and write operations are serialized. Extra left bits in both
270 AndData and OrData are stripped.
272 If 8-bit I/O port operations are not supported, then ASSERT().
273 If StartBit is greater than 7, then ASSERT().
274 If EndBit is greater than 7, then ASSERT().
275 If EndBit is less than StartBit, then ASSERT().
276 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
277 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
279 @param Port The I/O port to write.
280 @param StartBit The ordinal of the least significant bit in the bit field.
282 @param EndBit The ordinal of the most significant bit in the bit field.
284 @param AndData The value to AND with the read value from the I/O port.
285 @param OrData The value to OR with the result of the AND operation.
287 @return The value written back to the I/O port.
292 IoBitFieldAndThenOr8 (
302 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
307 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
308 result back to the 16-bit I/O port.
310 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
311 between the read result and the value specified by OrData, and writes the
312 result to the 16-bit I/O port specified by Port. The value written to the I/O
313 port is returned. This function must guarantee that all I/O read and write
314 operations are serialized.
316 If 16-bit I/O port operations are not supported, then ASSERT().
318 @param Port The I/O port to write.
319 @param OrData The value to OR with the read value from the I/O port.
321 @return The value written back to the I/O port.
331 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
335 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
336 to the 16-bit I/O port.
338 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
339 the read result and the value specified by AndData, and writes the result to
340 the 16-bit I/O port specified by Port. The value written to the I/O port is
341 returned. This function must guarantee that all I/O read and write operations
344 If 16-bit I/O port operations are not supported, then ASSERT().
346 @param Port The I/O port to write.
347 @param AndData The value to AND with the read value from the I/O port.
349 @return The value written back to the I/O port.
359 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
363 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
364 inclusive OR, and writes the result back to the 16-bit I/O port.
366 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
367 the read result and the value specified by AndData, performs a bitwise OR
368 between the result of the AND operation and the value specified by OrData,
369 and writes the result to the 16-bit I/O port specified by Port. The value
370 written to the I/O port is returned. This function must guarantee that all
371 I/O read and write operations are serialized.
373 If 16-bit I/O port operations are not supported, then ASSERT().
375 @param Port The I/O port to write.
376 @param AndData The value to AND with the read value from the I/O port.
377 @param OrData The value to OR with the result of the AND operation.
379 @return The value written back to the I/O port.
390 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
394 Reads a bit field of an I/O register.
396 Reads the bit field in a 16-bit I/O register. The bit field is specified by
397 the StartBit and the EndBit. The value of the bit field is returned.
399 If 16-bit I/O port operations are not supported, then ASSERT().
400 If StartBit is greater than 15, then ASSERT().
401 If EndBit is greater than 15, then ASSERT().
402 If EndBit is less than StartBit, then ASSERT().
404 @param Port The I/O port to read.
405 @param StartBit The ordinal of the least significant bit in the bit field.
407 @param EndBit The ordinal of the most significant bit in the bit field.
410 @return The value read.
421 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
425 Writes a bit field to an I/O register.
427 Writes Value to the bit field of the I/O register. The bit field is specified
428 by the StartBit and the EndBit. All other bits in the destination I/O
429 register are preserved. The value written to the I/O port is returned. Extra
430 left bits in Value are stripped.
432 If 16-bit I/O port operations are not supported, then ASSERT().
433 If StartBit is greater than 15, then ASSERT().
434 If EndBit is greater than 15, then ASSERT().
435 If EndBit is less than StartBit, then ASSERT().
436 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
438 @param Port The I/O port to write.
439 @param StartBit The ordinal of the least significant bit in the bit field.
441 @param EndBit The ordinal of the most significant bit in the bit field.
443 @param Value The new value of the bit field.
445 @return The value written back to the I/O port.
459 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
464 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
465 result back to the bit field in the 16-bit port.
467 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
468 between the read result and the value specified by OrData, and writes the
469 result to the 16-bit I/O port specified by Port. The value written to the I/O
470 port is returned. This function must guarantee that all I/O read and write
471 operations are serialized. Extra left bits in OrData are stripped.
473 If 16-bit I/O port operations are not supported, then ASSERT().
474 If StartBit is greater than 15, then ASSERT().
475 If EndBit is greater than 15, then ASSERT().
476 If EndBit is less than StartBit, then ASSERT().
477 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
479 @param Port The I/O port to write.
480 @param StartBit The ordinal of the least significant bit in the bit field.
482 @param EndBit The ordinal of the most significant bit in the bit field.
484 @param OrData The value to OR with the read value from the I/O port.
486 @return The value written back to the I/O port.
500 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
505 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
506 result back to the bit field in the 16-bit port.
508 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
509 the read result and the value specified by AndData, and writes the result to
510 the 16-bit I/O port specified by Port. The value written to the I/O port is
511 returned. This function must guarantee that all I/O read and write operations
512 are serialized. Extra left bits in AndData are stripped.
514 If 16-bit I/O port operations are not supported, then ASSERT().
515 If StartBit is greater than 15, then ASSERT().
516 If EndBit is greater than 15, then ASSERT().
517 If EndBit is less than StartBit, then ASSERT().
518 If AndData is larger than the bitmask value range specified by StartBit and EndBit, 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 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 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().
561 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
562 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
564 @param Port The I/O port to write.
565 @param StartBit The ordinal of the least significant bit in the bit field.
567 @param EndBit The ordinal of the most significant bit in the bit field.
569 @param AndData The value to AND with the read value from the I/O port.
570 @param OrData The value to OR with the result of the AND operation.
572 @return The value written back to the I/O port.
577 IoBitFieldAndThenOr16 (
587 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
592 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
593 result back to the 32-bit I/O port.
595 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
596 between the read result and the value specified by OrData, and writes the
597 result to the 32-bit I/O port specified by Port. The value written to the I/O
598 port is returned. This function must guarantee that all I/O read and write
599 operations are serialized.
601 If 32-bit I/O port operations are not supported, then ASSERT().
603 @param Port The I/O port to write.
604 @param OrData The value to OR with the read value from the I/O port.
606 @return The value written back to the I/O port.
616 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
620 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
621 to the 32-bit I/O port.
623 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
624 the read result and the value specified by AndData, and writes the result to
625 the 32-bit I/O port specified by Port. The value written to the I/O port is
626 returned. This function must guarantee that all I/O read and write operations
629 If 32-bit I/O port operations are not supported, then ASSERT().
631 @param Port The I/O port to write.
632 @param AndData The value to AND with the read value from the I/O port.
634 @return The value written back to the I/O port.
644 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
648 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
649 inclusive OR, and writes the result back to the 32-bit I/O port.
651 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
652 the read result and the value specified by AndData, performs a bitwise OR
653 between the result of the AND operation and the value specified by OrData,
654 and writes the result to the 32-bit I/O port specified by Port. The value
655 written to the I/O port is returned. This function must guarantee that all
656 I/O read and write operations are serialized.
658 If 32-bit I/O port operations are not supported, then ASSERT().
660 @param Port The I/O port to write.
661 @param AndData The value to AND with the read value from the I/O port.
662 @param OrData The value to OR with the result of the AND operation.
664 @return The value written back to the I/O port.
675 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
679 Reads a bit field of an I/O register.
681 Reads the bit field in a 32-bit I/O register. The bit field is specified by
682 the StartBit and the EndBit. The value of the bit field is returned.
684 If 32-bit I/O port operations are not supported, then ASSERT().
685 If StartBit is greater than 31, then ASSERT().
686 If EndBit is greater than 31, then ASSERT().
687 If EndBit is less than StartBit, then ASSERT().
689 @param Port The I/O port to read.
690 @param StartBit The ordinal of the least significant bit in the bit field.
692 @param EndBit The ordinal of the most significant bit in the bit field.
695 @return The value read.
706 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
710 Writes a bit field to an I/O register.
712 Writes Value to the bit field of the I/O register. The bit field is specified
713 by the StartBit and the EndBit. All other bits in the destination I/O
714 register are preserved. The value written to the I/O port is returned. Extra
715 left bits in Value are stripped.
717 If 32-bit I/O port operations are not supported, then ASSERT().
718 If StartBit is greater than 31, then ASSERT().
719 If EndBit is greater than 31, then ASSERT().
720 If EndBit is less than StartBit, then ASSERT().
721 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
723 @param Port The I/O port to write.
724 @param StartBit The ordinal of the least significant bit in the bit field.
726 @param EndBit The ordinal of the most significant bit in the bit field.
728 @param Value The new value of the bit field.
730 @return The value written back to the I/O port.
744 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
749 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
750 result back to the bit field in the 32-bit port.
752 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
753 between the read result and the value specified by OrData, and writes the
754 result to the 32-bit I/O port specified by Port. The value written to the I/O
755 port is returned. This function must guarantee that all I/O read and write
756 operations are serialized. Extra left bits in OrData are stripped.
758 If 32-bit I/O port operations are not supported, then ASSERT().
759 If StartBit is greater than 31, then ASSERT().
760 If EndBit is greater than 31, then ASSERT().
761 If EndBit is less than StartBit, then ASSERT().
762 If OrData is larger than the bitmask value range specified by StartBit and EndBit, 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().
803 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
805 @param Port The I/O port to write.
806 @param StartBit The ordinal of the least significant bit in the bit field.
808 @param EndBit The ordinal of the most significant bit in the bit field.
810 @param AndData The value to AND with the read value from the I/O port.
812 @return The value written back to the I/O port.
826 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
831 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
832 bitwise OR, and writes the result back to the bit field in the
835 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
836 by a bitwise OR between the read result and the value specified by
837 AndData, and writes the result to the 32-bit I/O port specified by Port. The
838 value written to the I/O port is returned. This function must guarantee that
839 all I/O read and write operations are serialized. Extra left bits in both
840 AndData and OrData are stripped.
842 If 32-bit I/O port operations are not supported, then ASSERT().
843 If StartBit is greater than 31, then ASSERT().
844 If EndBit is greater than 31, then ASSERT().
845 If EndBit is less than StartBit, then ASSERT().
846 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
847 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
849 @param Port The I/O port to write.
850 @param StartBit The ordinal of the least significant bit in the bit field.
852 @param EndBit The ordinal of the most significant bit in the bit field.
854 @param AndData The value to AND with the read value from the I/O port.
855 @param OrData The value to OR with the result of the AND operation.
857 @return The value written back to the I/O port.
862 IoBitFieldAndThenOr32 (
872 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
877 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
878 result back to the 64-bit I/O port.
880 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
881 between the read result and the value specified by OrData, and writes the
882 result to the 64-bit I/O port specified by Port. The value written to the I/O
883 port is returned. This function must guarantee that all I/O read and write
884 operations are serialized.
886 If 64-bit I/O port operations are not supported, then ASSERT().
888 @param Port The I/O port to write.
889 @param OrData The value to OR with the read value from the I/O port.
891 @return The value written back to the I/O port.
901 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
905 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
906 to the 64-bit I/O port.
908 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
909 the read result and the value specified by AndData, and writes the result to
910 the 64-bit I/O port specified by Port. The value written to the I/O port is
911 returned. This function must guarantee that all I/O read and write operations
914 If 64-bit I/O port operations are not supported, then ASSERT().
916 @param Port The I/O port to write.
917 @param AndData The value to AND with the read value from the I/O port.
919 @return The value written back to the I/O port.
929 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
933 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
934 inclusive OR, and writes the result back to the 64-bit I/O port.
936 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
937 the read result and the value specified by AndData, performs a bitwise OR
938 between the result of the AND operation and the value specified by OrData,
939 and writes the result to the 64-bit I/O port specified by Port. The value
940 written to the I/O port is returned. This function must guarantee that all
941 I/O read and write operations are serialized.
943 If 64-bit I/O port operations are not supported, then ASSERT().
945 @param Port The I/O port to write.
946 @param AndData The value to AND with the read value from the I/O port.
947 @param OrData The value to OR with the result of the AND operation.
949 @return The value written back to the I/O port.
960 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
964 Reads a bit field of an I/O register.
966 Reads the bit field in a 64-bit I/O register. The bit field is specified by
967 the StartBit and the EndBit. The value of the bit field is returned.
969 If 64-bit I/O port operations are not supported, then ASSERT().
970 If StartBit is greater than 63, then ASSERT().
971 If EndBit is greater than 63, then ASSERT().
972 If EndBit is less than StartBit, then ASSERT().
974 @param Port The I/O port to read.
975 @param StartBit The ordinal of the least significant bit in the bit field.
977 @param EndBit The ordinal of the most significant bit in the bit field.
980 @return The value read.
991 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
995 Writes a bit field to an I/O register.
997 Writes Value to the bit field of the I/O register. The bit field is specified
998 by the StartBit and the EndBit. All other bits in the destination I/O
999 register are preserved. The value written to the I/O port is returned. Extra
1000 left bits in Value are stripped.
1002 If 64-bit I/O port operations are not supported, then ASSERT().
1003 If StartBit is greater than 63, then ASSERT().
1004 If EndBit is greater than 63, then ASSERT().
1005 If EndBit is less than StartBit, then ASSERT().
1006 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1008 @param Port The I/O port to write.
1009 @param StartBit The ordinal of the least significant bit in the bit field.
1011 @param EndBit The ordinal of the most significant bit in the bit field.
1013 @param Value The new value of the bit field.
1015 @return The value written back to the I/O port.
1029 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1034 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1035 result back to the bit field in the 64-bit port.
1037 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1038 between the read result and the value specified by OrData, and writes the
1039 result to the 64-bit I/O port specified by Port. The value written to the I/O
1040 port is returned. This function must guarantee that all I/O read and write
1041 operations are serialized. Extra left bits in OrData are stripped.
1043 If 64-bit I/O port operations are not supported, then ASSERT().
1044 If StartBit is greater than 63, then ASSERT().
1045 If EndBit is greater than 63, then ASSERT().
1046 If EndBit is less than StartBit, then ASSERT().
1047 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1049 @param Port The I/O port to write.
1050 @param StartBit The ordinal of the least significant bit in the bit field.
1052 @param EndBit The ordinal of the most significant bit in the bit field.
1054 @param OrData The value to OR with the read value from the I/O port.
1056 @return The value written back to the I/O port.
1070 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1075 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1076 result back to the bit field in the 64-bit port.
1078 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1079 the read result and the value specified by AndData, and writes the result to
1080 the 64-bit I/O port specified by Port. The value written to the I/O port is
1081 returned. This function must guarantee that all I/O read and write operations
1082 are serialized. Extra left bits in AndData are stripped.
1084 If 64-bit I/O port operations are not supported, then ASSERT().
1085 If StartBit is greater than 63, then ASSERT().
1086 If EndBit is greater than 63, then ASSERT().
1087 If EndBit is less than StartBit, then ASSERT().
1088 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1090 @param Port The I/O port to write.
1091 @param StartBit The ordinal of the least significant bit in the bit field.
1093 @param EndBit The ordinal of the most significant bit in the bit field.
1095 @param AndData The value to AND with the read value from the I/O port.
1097 @return The value written back to the I/O port.
1111 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1116 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1117 bitwise OR, and writes the result back to the bit field in the
1120 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1121 by a bitwise OR between the read result and the value specified by
1122 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1123 value written to the I/O port is returned. This function must guarantee that
1124 all I/O read and write operations are serialized. Extra left bits in both
1125 AndData and OrData are stripped.
1127 If 64-bit I/O port operations are not supported, then ASSERT().
1128 If StartBit is greater than 63, then ASSERT().
1129 If EndBit is greater than 63, then ASSERT().
1130 If EndBit is less than StartBit, then ASSERT().
1131 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1132 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1134 @param Port The I/O port to write.
1135 @param StartBit The ordinal of the least significant bit in the bit field.
1137 @param EndBit The ordinal of the most significant bit in the bit field.
1139 @param AndData The value to AND with the read value from the I/O port.
1140 @param OrData The value to OR with the result of the AND operation.
1142 @return The value written back to the I/O port.
1147 IoBitFieldAndThenOr64 (
1157 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1162 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1163 result back to the 8-bit MMIO register.
1165 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1166 inclusive OR between the read result and the value specified by OrData, and
1167 writes the result to the 8-bit MMIO register specified by Address. The value
1168 written to the MMIO register is returned. This function must guarantee that
1169 all MMIO read and write operations are serialized.
1171 If 8-bit MMIO register operations are not supported, then ASSERT().
1173 @param Address The MMIO register to write.
1174 @param OrData The value to OR with the read value from the MMIO register.
1176 @return The value written back to the MMIO register.
1186 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1190 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1191 back to the 8-bit MMIO register.
1193 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1194 between the read result and the value specified by AndData, and writes the
1195 result to the 8-bit MMIO register specified by Address. The value written to
1196 the MMIO register is returned. This function must guarantee that all MMIO
1197 read and write operations are serialized.
1199 If 8-bit MMIO register operations are not supported, then ASSERT().
1201 @param Address The MMIO register to write.
1202 @param AndData The value to AND with the read value from the MMIO register.
1204 @return The value written back to the MMIO register.
1214 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1218 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1219 inclusive OR, and writes the result back to the 8-bit MMIO register.
1221 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1222 between the read result and the value specified by AndData, performs a
1223 bitwise OR between the result of the AND operation and the value specified by
1224 OrData, and writes the result to the 8-bit MMIO register specified by
1225 Address. The value written to the MMIO register is returned. This function
1226 must guarantee that all MMIO read and write operations are serialized.
1228 If 8-bit MMIO register operations are not supported, then ASSERT().
1231 @param Address The MMIO register to write.
1232 @param AndData The value to AND with the read value from the MMIO register.
1233 @param OrData The value to OR with the result of the AND operation.
1235 @return The value written back to the MMIO register.
1246 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1250 Reads a bit field of a MMIO register.
1252 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1253 the StartBit and the EndBit. The value of the bit field is returned.
1255 If 8-bit MMIO register operations are not supported, then ASSERT().
1256 If StartBit is greater than 7, then ASSERT().
1257 If EndBit is greater than 7, then ASSERT().
1258 If EndBit is less than StartBit, then ASSERT().
1260 @param Address The MMIO register to read.
1261 @param StartBit The ordinal of the least significant bit in the bit field.
1263 @param EndBit The ordinal of the most significant bit in the bit field.
1266 @return The value read.
1277 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1281 Writes a bit field to a MMIO register.
1283 Writes Value to the bit field of the MMIO register. The bit field is
1284 specified by the StartBit and the EndBit. All other bits in the destination
1285 MMIO register are preserved. The new value of the 8-bit register is returned.
1287 If 8-bit MMIO register operations are not supported, then ASSERT().
1288 If StartBit is greater than 7, then ASSERT().
1289 If EndBit is greater than 7, then ASSERT().
1290 If EndBit is less than StartBit, then ASSERT().
1291 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1293 @param Address The MMIO register to write.
1294 @param StartBit The ordinal of the least significant bit in the bit field.
1296 @param EndBit The ordinal of the most significant bit in the bit field.
1298 @param Value The new value of the bit field.
1300 @return The value written back to the MMIO register.
1305 MmioBitFieldWrite8 (
1314 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1319 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1320 writes the result back to the bit field in the 8-bit MMIO register.
1322 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1323 inclusive OR between the read result and the value specified by OrData, and
1324 writes the result to the 8-bit MMIO register specified by Address. The value
1325 written to the MMIO register is returned. This function must guarantee that
1326 all MMIO read and write operations are serialized. Extra left bits in OrData
1329 If 8-bit MMIO register operations are not supported, then ASSERT().
1330 If StartBit is greater than 7, then ASSERT().
1331 If EndBit is greater than 7, then ASSERT().
1332 If EndBit is less than StartBit, then ASSERT().
1333 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1335 @param Address The MMIO register to write.
1336 @param StartBit The ordinal of the least significant bit in the bit field.
1338 @param EndBit The ordinal of the most significant bit in the bit field.
1340 @param OrData The value to OR with read value from the MMIO register.
1342 @return The value written back to the MMIO register.
1356 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1361 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1362 writes the result back to the bit field in the 8-bit MMIO register.
1364 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1365 between the read result and the value specified by AndData, and writes the
1366 result to the 8-bit MMIO register specified by Address. The value written to
1367 the MMIO register is returned. This function must guarantee that all MMIO
1368 read and write operations are serialized. Extra left bits in AndData are
1371 If 8-bit MMIO register operations are not supported, then ASSERT().
1372 If StartBit is greater than 7, then ASSERT().
1373 If EndBit is greater than 7, then ASSERT().
1374 If EndBit is less than StartBit, then ASSERT().
1375 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1377 @param Address The MMIO register to write.
1378 @param StartBit The ordinal of the least significant bit in the bit field.
1380 @param EndBit The ordinal of the most significant bit in the bit field.
1382 @param AndData The value to AND with read value from the MMIO register.
1384 @return The value written back to the MMIO register.
1398 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1403 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1404 by a bitwise OR, and writes the result back to the bit field in the
1405 8-bit MMIO register.
1407 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1408 followed by a bitwise OR between the read result and the value
1409 specified by AndData, and writes the result to the 8-bit MMIO register
1410 specified by Address. The value written to the MMIO register is returned.
1411 This function must guarantee that all MMIO read and write operations are
1412 serialized. Extra left bits in both AndData and OrData are stripped.
1414 If 8-bit MMIO register operations are not supported, then ASSERT().
1415 If StartBit is greater than 7, then ASSERT().
1416 If EndBit is greater than 7, then ASSERT().
1417 If EndBit is less than StartBit, then ASSERT().
1418 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1419 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1421 @param Address The MMIO register to write.
1422 @param StartBit The ordinal of the least significant bit in the bit field.
1424 @param EndBit The ordinal of the most significant bit in the bit field.
1426 @param AndData The value to AND with read value from the MMIO register.
1427 @param OrData The value to OR with the result of the AND operation.
1429 @return The value written back to the MMIO register.
1434 MmioBitFieldAndThenOr8 (
1444 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1449 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1450 result back to the 16-bit MMIO register.
1452 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1453 inclusive OR between the read result and the value specified by OrData, and
1454 writes the result to the 16-bit MMIO register specified by Address. The value
1455 written to the MMIO register is returned. This function must guarantee that
1456 all MMIO read and write operations are serialized.
1458 If 16-bit MMIO register operations are not supported, then ASSERT().
1460 @param Address The MMIO register to write.
1461 @param OrData The value to OR with the read value from the MMIO register.
1463 @return The value written back to the MMIO register.
1473 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1477 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1478 back to the 16-bit MMIO register.
1480 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1481 between the read result and the value specified by AndData, and writes the
1482 result to the 16-bit MMIO register specified by Address. The value written to
1483 the MMIO register is returned. This function must guarantee that all MMIO
1484 read and write operations are serialized.
1486 If 16-bit MMIO register operations are not supported, then ASSERT().
1488 @param Address The MMIO register to write.
1489 @param AndData The value to AND with the read value from the MMIO register.
1491 @return The value written back to the MMIO register.
1501 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1505 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1506 inclusive OR, and writes the result back to the 16-bit MMIO register.
1508 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1509 between the read result and the value specified by AndData, performs a
1510 bitwise OR between the result of the AND operation and the value specified by
1511 OrData, and writes the result to the 16-bit MMIO register specified by
1512 Address. The value written to the MMIO register is returned. This function
1513 must guarantee that all MMIO read and write operations are serialized.
1515 If 16-bit MMIO register operations are not supported, then ASSERT().
1518 @param Address The MMIO register to write.
1519 @param AndData The value to AND with the read value from the MMIO register.
1520 @param OrData The value to OR with the result of the AND operation.
1522 @return The value written back to the MMIO register.
1533 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1537 Reads a bit field of a MMIO register.
1539 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1540 the StartBit and the EndBit. The value of the bit field is returned.
1542 If 16-bit MMIO register operations are not supported, then ASSERT().
1543 If StartBit is greater than 15, then ASSERT().
1544 If EndBit is greater than 15, then ASSERT().
1545 If EndBit is less than StartBit, then ASSERT().
1547 @param Address The MMIO register to read.
1548 @param StartBit The ordinal of the least significant bit in the bit field.
1550 @param EndBit The ordinal of the most significant bit in the bit field.
1553 @return The value read.
1558 MmioBitFieldRead16 (
1564 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1568 Writes a bit field to a MMIO register.
1570 Writes Value to the bit field of the MMIO register. The bit field is
1571 specified by the StartBit and the EndBit. All other bits in the destination
1572 MMIO register are preserved. The new value of the 16-bit register is returned.
1574 If 16-bit MMIO register operations are not supported, then ASSERT().
1575 If StartBit is greater than 15, then ASSERT().
1576 If EndBit is greater than 15, then ASSERT().
1577 If EndBit is less than StartBit, then ASSERT().
1578 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1580 @param Address The MMIO register to write.
1581 @param StartBit The ordinal of the least significant bit in the bit field.
1583 @param EndBit The ordinal of the most significant bit in the bit field.
1585 @param Value The new value of the bit field.
1587 @return The value written back to the MMIO register.
1592 MmioBitFieldWrite16 (
1599 return MmioWrite16 (
1601 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1606 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1607 writes the result back to the bit field in the 16-bit MMIO register.
1609 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1610 inclusive OR between the read result and the value specified by OrData, and
1611 writes the result to the 16-bit MMIO register specified by Address. The value
1612 written to the MMIO register is returned. This function must guarantee that
1613 all MMIO read and write operations are serialized. Extra left bits in OrData
1616 If 16-bit MMIO register operations are not supported, then ASSERT().
1617 If StartBit is greater than 15, then ASSERT().
1618 If EndBit is greater than 15, then ASSERT().
1619 If EndBit is less than StartBit, then ASSERT().
1620 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1622 @param Address The MMIO register to write.
1623 @param StartBit The ordinal of the least significant bit in the bit field.
1625 @param EndBit The ordinal of the most significant bit in the bit field.
1627 @param OrData The value to OR with read value from the MMIO register.
1629 @return The value written back to the MMIO register.
1641 return MmioWrite16 (
1643 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1648 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1649 writes the result back to the bit field in the 16-bit MMIO register.
1651 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1652 between the read result and the value specified by AndData, and writes the
1653 result to the 16-bit MMIO register specified by Address. The value written to
1654 the MMIO register is returned. This function must guarantee that all MMIO
1655 read and write operations are serialized. Extra left bits in AndData are
1658 If 16-bit MMIO register operations are not supported, then ASSERT().
1659 If StartBit is greater than 15, then ASSERT().
1660 If EndBit is greater than 15, then ASSERT().
1661 If EndBit is less than StartBit, then ASSERT().
1662 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1664 @param Address The MMIO register to write.
1665 @param StartBit The ordinal of the least significant bit in the bit field.
1667 @param EndBit The ordinal of the most significant bit in the bit field.
1669 @param AndData The value to AND with read value from the MMIO register.
1671 @return The value written back to the MMIO register.
1683 return MmioWrite16 (
1685 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1690 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1691 by a bitwise OR, and writes the result back to the bit field in the
1692 16-bit MMIO register.
1694 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1695 followed by a bitwise OR between the read result and the value
1696 specified by AndData, and writes the result to the 16-bit MMIO register
1697 specified by Address. The value written to the MMIO register is returned.
1698 This function must guarantee that all MMIO read and write operations are
1699 serialized. Extra left bits in both AndData and OrData are stripped.
1701 If 16-bit MMIO register operations are not supported, then ASSERT().
1702 If StartBit is greater than 15, then ASSERT().
1703 If EndBit is greater than 15, then ASSERT().
1704 If EndBit is less than StartBit, then ASSERT().
1705 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1706 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1708 @param Address The MMIO register to write.
1709 @param StartBit The ordinal of the least significant bit in the bit field.
1711 @param EndBit The ordinal of the most significant bit in the bit field.
1713 @param AndData The value to AND with read value from the MMIO register.
1714 @param OrData The value to OR with the result of the AND operation.
1716 @return The value written back to the MMIO register.
1721 MmioBitFieldAndThenOr16 (
1729 return MmioWrite16 (
1731 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1736 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
1737 result back to the 32-bit MMIO register.
1739 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1740 inclusive OR between the read result and the value specified by OrData, and
1741 writes the result to the 32-bit MMIO register specified by Address. The value
1742 written to the MMIO register is returned. This function must guarantee that
1743 all MMIO read and write operations are serialized.
1745 If 32-bit MMIO register operations are not supported, then ASSERT().
1747 @param Address The MMIO register to write.
1748 @param OrData The value to OR with the read value from the MMIO register.
1750 @return The value written back to the MMIO register.
1760 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1764 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1765 back to the 32-bit MMIO register.
1767 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1768 between the read result and the value specified by AndData, and writes the
1769 result to the 32-bit MMIO register specified by Address. The value written to
1770 the MMIO register is returned. This function must guarantee that all MMIO
1771 read and write operations are serialized.
1773 If 32-bit MMIO register operations are not supported, then ASSERT().
1775 @param Address The MMIO register to write.
1776 @param AndData The value to AND with the read value from the MMIO register.
1778 @return The value written back to the MMIO register.
1788 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1792 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1793 inclusive OR, and writes the result back to the 32-bit MMIO register.
1795 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1796 between the read result and the value specified by AndData, performs a
1797 bitwise OR between the result of the AND operation and the value specified by
1798 OrData, and writes the result to the 32-bit MMIO register specified by
1799 Address. The value written to the MMIO register is returned. This function
1800 must guarantee that all MMIO read and write operations are serialized.
1802 If 32-bit MMIO register operations are not supported, then ASSERT().
1805 @param Address The MMIO register to write.
1806 @param AndData The value to AND with the read value from the MMIO register.
1807 @param OrData The value to OR with the result of the AND operation.
1809 @return The value written back to the MMIO register.
1820 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1824 Reads a bit field of a MMIO register.
1826 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1827 the StartBit and the EndBit. The value of the bit field is returned.
1829 If 32-bit MMIO register operations are not supported, then ASSERT().
1830 If StartBit is greater than 31, then ASSERT().
1831 If EndBit is greater than 31, then ASSERT().
1832 If EndBit is less than StartBit, then ASSERT().
1834 @param Address The MMIO register to read.
1835 @param StartBit The ordinal of the least significant bit in the bit field.
1837 @param EndBit The ordinal of the most significant bit in the bit field.
1840 @return The value read.
1845 MmioBitFieldRead32 (
1851 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1855 Writes a bit field to a MMIO register.
1857 Writes Value to the bit field of the MMIO register. The bit field is
1858 specified by the StartBit and the EndBit. All other bits in the destination
1859 MMIO register are preserved. The new value of the 32-bit register is returned.
1861 If 32-bit MMIO register operations are not supported, then ASSERT().
1862 If StartBit is greater than 31, then ASSERT().
1863 If EndBit is greater than 31, then ASSERT().
1864 If EndBit is less than StartBit, then ASSERT().
1865 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1867 @param Address The MMIO register to write.
1868 @param StartBit The ordinal of the least significant bit in the bit field.
1870 @param EndBit The ordinal of the most significant bit in the bit field.
1872 @param Value The new value of the bit field.
1874 @return The value written back to the MMIO register.
1879 MmioBitFieldWrite32 (
1886 return MmioWrite32 (
1888 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1893 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1894 writes the result back to the bit field in the 32-bit MMIO register.
1896 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1897 inclusive OR between the read result and the value specified by OrData, and
1898 writes the result to the 32-bit MMIO register specified by Address. The value
1899 written to the MMIO register is returned. This function must guarantee that
1900 all MMIO read and write operations are serialized. Extra left bits in OrData
1903 If 32-bit MMIO register operations are not supported, then ASSERT().
1904 If StartBit is greater than 31, then ASSERT().
1905 If EndBit is greater than 31, then ASSERT().
1906 If EndBit is less than StartBit, then ASSERT().
1907 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1909 @param Address The MMIO register to write.
1910 @param StartBit The ordinal of the least significant bit in the bit field.
1912 @param EndBit The ordinal of the most significant bit in the bit field.
1914 @param OrData The value to OR with read value from the MMIO register.
1916 @return The value written back to the MMIO register.
1928 return MmioWrite32 (
1930 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1935 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1936 writes the result back to the bit field in the 32-bit MMIO register.
1938 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1939 between the read result and the value specified by AndData, and writes the
1940 result to the 32-bit MMIO register specified by Address. The value written to
1941 the MMIO register is returned. This function must guarantee that all MMIO
1942 read and write operations are serialized. Extra left bits in AndData are
1945 If 32-bit MMIO register operations are not supported, then ASSERT().
1946 If StartBit is greater than 31, then ASSERT().
1947 If EndBit is greater than 31, then ASSERT().
1948 If EndBit is less than StartBit, then ASSERT().
1949 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1951 @param Address The MMIO register to write.
1952 @param StartBit The ordinal of the least significant bit in the bit field.
1954 @param EndBit The ordinal of the most significant bit in the bit field.
1956 @param AndData The value to AND with read value from the MMIO register.
1958 @return The value written back to the MMIO register.
1970 return MmioWrite32 (
1972 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1977 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1978 by a bitwise OR, and writes the result back to the bit field in the
1979 32-bit MMIO register.
1981 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1982 followed by a bitwise OR between the read result and the value
1983 specified by AndData, and writes the result to the 32-bit MMIO register
1984 specified by Address. The value written to the MMIO register is returned.
1985 This function must guarantee that all MMIO read and write operations are
1986 serialized. Extra left bits in both AndData and OrData are stripped.
1988 If 32-bit MMIO register operations are not supported, then ASSERT().
1989 If StartBit is greater than 31, then ASSERT().
1990 If EndBit is greater than 31, then ASSERT().
1991 If EndBit is less than StartBit, then ASSERT().
1992 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1993 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1995 @param Address The MMIO register to write.
1996 @param StartBit The ordinal of the least significant bit in the bit field.
1998 @param EndBit The ordinal of the most significant bit in the bit field.
2000 @param AndData The value to AND with read value from the MMIO register.
2001 @param OrData The value to OR with the result of the AND operation.
2003 @return The value written back to the MMIO register.
2008 MmioBitFieldAndThenOr32 (
2016 return MmioWrite32 (
2018 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
2023 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2024 result back to the 64-bit MMIO register.
2026 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2027 inclusive OR between the read result and the value specified by OrData, and
2028 writes the result to the 64-bit MMIO register specified by Address. The value
2029 written to the MMIO register is returned. This function must guarantee that
2030 all MMIO read and write operations are serialized.
2032 If 64-bit MMIO register operations are not supported, then ASSERT().
2034 @param Address The MMIO register to write.
2035 @param OrData The value to OR with the read value from the MMIO register.
2037 @return The value written back to the MMIO register.
2047 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2051 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2052 back to the 64-bit MMIO register.
2054 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2055 between the read result and the value specified by AndData, and writes the
2056 result to the 64-bit MMIO register specified by Address. The value written to
2057 the MMIO register is returned. This function must guarantee that all MMIO
2058 read and write operations are serialized.
2060 If 64-bit MMIO register operations are not supported, then ASSERT().
2062 @param Address The MMIO register to write.
2063 @param AndData The value to AND with the read value from the MMIO register.
2065 @return The value written back to the MMIO register.
2075 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2079 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2080 inclusive OR, and writes the result back to the 64-bit MMIO register.
2082 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2083 between the read result and the value specified by AndData, performs a
2084 bitwise OR between the result of the AND operation and the value specified by
2085 OrData, and writes the result to the 64-bit MMIO register specified by
2086 Address. The value written to the MMIO register is returned. This function
2087 must guarantee that all MMIO read and write operations are serialized.
2089 If 64-bit MMIO register operations are not supported, then ASSERT().
2092 @param Address The MMIO register to write.
2093 @param AndData The value to AND with the read value from the MMIO register.
2094 @param OrData The value to OR with the result of the AND operation.
2096 @return The value written back to the MMIO register.
2107 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2111 Reads a bit field of a MMIO register.
2113 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2114 the StartBit and the EndBit. The value of the bit field is returned.
2116 If 64-bit MMIO register operations are not supported, then ASSERT().
2117 If StartBit is greater than 63, then ASSERT().
2118 If EndBit is greater than 63, then ASSERT().
2119 If EndBit is less than StartBit, then ASSERT().
2121 @param Address The MMIO register to read.
2122 @param StartBit The ordinal of the least significant bit in the bit field.
2124 @param EndBit The ordinal of the most significant bit in the bit field.
2127 @return The value read.
2132 MmioBitFieldRead64 (
2138 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2142 Writes a bit field to a MMIO register.
2144 Writes Value to the bit field of the MMIO register. The bit field is
2145 specified by the StartBit and the EndBit. All other bits in the destination
2146 MMIO register are preserved. The new value of the 64-bit register is returned.
2148 If 64-bit MMIO register operations are not supported, then ASSERT().
2149 If StartBit is greater than 63, then ASSERT().
2150 If EndBit is greater than 63, then ASSERT().
2151 If EndBit is less than StartBit, then ASSERT().
2152 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2154 @param Address The MMIO register to write.
2155 @param StartBit The ordinal of the least significant bit in the bit field.
2157 @param EndBit The ordinal of the most significant bit in the bit field.
2159 @param Value The new value of the bit field.
2161 @return The value written back to the MMIO register.
2166 MmioBitFieldWrite64 (
2173 return MmioWrite64 (
2175 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2180 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2181 writes the result back to the bit field in the 64-bit MMIO register.
2183 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2184 inclusive OR between the read result and the value specified by OrData, and
2185 writes the result to the 64-bit MMIO register specified by Address. The value
2186 written to the MMIO register is returned. This function must guarantee that
2187 all MMIO read and write operations are serialized. Extra left bits in OrData
2190 If 64-bit MMIO register operations are not supported, then ASSERT().
2191 If StartBit is greater than 63, then ASSERT().
2192 If EndBit is greater than 63, then ASSERT().
2193 If EndBit is less than StartBit, then ASSERT().
2194 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2196 @param Address The MMIO register to write.
2197 @param StartBit The ordinal of the least significant bit in the bit field.
2199 @param EndBit The ordinal of the most significant bit in the bit field.
2201 @param OrData The value to OR with read value from the MMIO register.
2203 @return The value written back to the MMIO register.
2215 return MmioWrite64 (
2217 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2222 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2223 writes the result back to the bit field in the 64-bit MMIO register.
2225 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2226 between the read result and the value specified by AndData, and writes the
2227 result to the 64-bit MMIO register specified by Address. The value written to
2228 the MMIO register is returned. This function must guarantee that all MMIO
2229 read and write operations are serialized. Extra left bits in AndData are
2232 If 64-bit MMIO register operations are not supported, then ASSERT().
2233 If StartBit is greater than 63, then ASSERT().
2234 If EndBit is greater than 63, then ASSERT().
2235 If EndBit is less than StartBit, then ASSERT().
2236 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2238 @param Address The MMIO register to write.
2239 @param StartBit The ordinal of the least significant bit in the bit field.
2241 @param EndBit The ordinal of the most significant bit in the bit field.
2243 @param AndData The value to AND with read value from the MMIO register.
2245 @return The value written back to the MMIO register.
2257 return MmioWrite64 (
2259 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2264 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2265 by a bitwise OR, and writes the result back to the bit field in the
2266 64-bit MMIO register.
2268 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2269 followed by a bitwise OR between the read result and the value
2270 specified by AndData, and writes the result to the 64-bit MMIO register
2271 specified by Address. The value written to the MMIO register is returned.
2272 This function must guarantee that all MMIO read and write operations are
2273 serialized. Extra left bits in both AndData and OrData are stripped.
2275 If 64-bit MMIO register operations are not supported, then ASSERT().
2276 If StartBit is greater than 63, then ASSERT().
2277 If EndBit is greater than 63, then ASSERT().
2278 If EndBit is less than StartBit, then ASSERT().
2279 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2280 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2282 @param Address The MMIO register to write.
2283 @param StartBit The ordinal of the least significant bit in the bit field.
2285 @param EndBit The ordinal of the most significant bit in the bit field.
2287 @param AndData The value to AND with read value from the MMIO register.
2288 @param OrData The value to OR with the result of the AND operation.
2290 @return The value written back to the MMIO register.
2295 MmioBitFieldAndThenOr64 (
2303 return MmioWrite64 (
2305 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)