]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoHighLevel.c
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 High-level Io/Mmio functions.
23 #include "DxeCpuIoLibInternal.h"
26 Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
27 result back to the 8-bit I/O port.
29 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
30 between the read result and the value specified by OrData, and writes the
31 result to the 8-bit I/O port specified by Port. The value written to the I/O
32 port is returned. This function must guarantee that all I/O read and write
33 operations are serialized.
35 If 8-bit I/O port operations are not supported, then ASSERT().
37 @param Port The I/O port to write.
38 @param OrData The value to OR with the read value from the I/O port.
40 @return The value written back to the I/O port.
50 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) | OrData
));
54 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
55 to the 8-bit I/O port.
57 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
58 the read result and the value specified by AndData, and writes the result to
59 the 8-bit I/O port specified by Port. The value written to the I/O port is
60 returned. This function must guarantee that all I/O read and write operations
63 If 8-bit I/O port operations are not supported, then ASSERT().
65 @param Port The I/O port to write.
66 @param AndData The value to AND with the read value from the I/O port.
68 @return The value written back to the I/O port.
78 return IoWrite8 (Port
, (UINT8
) (IoRead8 (Port
) & AndData
));
82 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
83 inclusive OR, and writes the result back to the 8-bit I/O port.
85 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
86 the read result and the value specified by AndData, performs a bitwise OR
87 between the result of the AND operation and the value specified by OrData,
88 and writes the result to the 8-bit I/O port specified by Port. The value
89 written to the I/O port is returned. This function must guarantee that all
90 I/O read and write operations are serialized.
92 If 8-bit I/O port operations are not supported, then ASSERT().
94 @param Port The I/O port to write.
95 @param AndData The value to AND with the read value from the I/O port.
96 @param OrData The value to OR with the result of the AND operation.
98 @return The value written back to the I/O port.
109 return IoWrite8 (Port
, (UINT8
) ((IoRead8 (Port
) & AndData
) | OrData
));
113 Reads a bit field of an I/O register.
115 Reads the bit field in an 8-bit I/O register. The bit field is specified by
116 the StartBit and the EndBit. The value of the bit field is returned.
118 If 8-bit I/O port operations are not supported, then ASSERT().
119 If StartBit is greater than 7, then ASSERT().
120 If EndBit is greater than 7, then ASSERT().
121 If EndBit is less than StartBit, then ASSERT().
123 @param Port The I/O port to read.
124 @param StartBit The ordinal of the least significant bit in the bit field.
126 @param EndBit The ordinal of the most significant bit in the bit field.
129 @return The value read.
140 return BitFieldRead8 (IoRead8 (Port
), StartBit
, EndBit
);
144 Writes a bit field to an I/O register.
146 Writes Value to the bit field of the I/O register. The bit field is specified
147 by the StartBit and the EndBit. All other bits in the destination I/O
148 register are preserved. The value written to the I/O port is returned. Extra
149 left bits in Value are stripped.
151 If 8-bit I/O port operations are not supported, then ASSERT().
152 If StartBit is greater than 7, then ASSERT().
153 If EndBit is greater than 7, then ASSERT().
154 If EndBit is less than StartBit, then ASSERT().
156 @param Port The I/O port to write.
157 @param StartBit The ordinal of the least significant bit in the bit field.
159 @param EndBit The ordinal of the most significant bit in the bit field.
161 @param Value New value of the bit field.
163 @return The value written back to the I/O port.
177 BitFieldWrite8 (IoRead8 (Port
), StartBit
, EndBit
, Value
)
182 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
183 result back to the bit field in the 8-bit port.
185 Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
186 between the read result and the value specified by OrData, and writes the
187 result to the 8-bit I/O port specified by Port. The value written to the I/O
188 port is returned. This function must guarantee that all I/O read and write
189 operations are serialized. Extra left bits in OrData are stripped.
191 If 8-bit I/O port operations are not supported, then ASSERT().
192 If StartBit is greater than 7, then ASSERT().
193 If EndBit is greater than 7, then ASSERT().
194 If EndBit is less than StartBit, then ASSERT().
196 @param Port The I/O port to write.
197 @param StartBit The ordinal of the least significant bit in the bit field.
199 @param EndBit The ordinal of the most significant bit in the bit field.
201 @param OrData The value to OR with the read value from the I/O port.
203 @return The value written back to the I/O port.
217 BitFieldOr8 (IoRead8 (Port
), StartBit
, EndBit
, OrData
)
222 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
223 result back to the bit field in the 8-bit port.
225 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
226 the read result and the value specified by AndData, and writes the result to
227 the 8-bit I/O port specified by Port. The value written to the I/O port is
228 returned. This function must guarantee that all I/O read and write operations
229 are serialized. Extra left bits in AndData are stripped.
231 If 8-bit I/O port operations are not supported, then ASSERT().
232 If StartBit is greater than 7, then ASSERT().
233 If EndBit is greater than 7, then ASSERT().
234 If EndBit is less than StartBit, then ASSERT().
236 @param Port The I/O port to write.
237 @param StartBit The ordinal of the least significant bit in the bit field.
239 @param EndBit The ordinal of the most significant bit in the bit field.
241 @param AndData The value to AND with the read value from the I/O port.
243 @return The value written back to the I/O port.
257 BitFieldAnd8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
)
262 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
263 bitwise inclusive OR, and writes the result back to the bit field in the
266 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
267 by a bitwise inclusive OR between the read result and the value specified by
268 AndData, and writes the result to the 8-bit I/O port specified by Port. The
269 value written to the I/O port is returned. This function must guarantee that
270 all I/O read and write operations are serialized. Extra left bits in both
271 AndData and OrData are stripped.
273 If 8-bit I/O port operations are not supported, then ASSERT().
274 If StartBit is greater than 7, then ASSERT().
275 If EndBit is greater than 7, then ASSERT().
276 If EndBit is less than StartBit, then ASSERT().
278 @param Port The I/O port to write.
279 @param StartBit The ordinal of the least significant bit in the bit field.
281 @param EndBit The ordinal of the most significant bit in the bit field.
283 @param AndData The value to AND with the read value from the I/O port.
284 @param OrData The value to OR with the result of the AND operation.
286 @return The value written back to the I/O port.
291 IoBitFieldAndThenOr8 (
301 BitFieldAndThenOr8 (IoRead8 (Port
), StartBit
, EndBit
, AndData
, OrData
)
306 Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
307 result back to the 16-bit I/O port.
309 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
310 between the read result and the value specified by OrData, and writes the
311 result to the 16-bit I/O port specified by Port. The value written to the I/O
312 port is returned. This function must guarantee that all I/O read and write
313 operations are serialized.
315 If 16-bit I/O port operations are not supported, then ASSERT().
317 @param Port The I/O port to write.
318 @param OrData The value to OR with the read value from the I/O port.
320 @return The value written back to the I/O port.
330 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) | OrData
));
334 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
335 to the 16-bit I/O port.
337 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
338 the read result and the value specified by AndData, and writes the result to
339 the 16-bit I/O port specified by Port. The value written to the I/O port is
340 returned. This function must guarantee that all I/O read and write operations
343 If 16-bit I/O port operations are not supported, then ASSERT().
345 @param Port The I/O port to write.
346 @param AndData The value to AND with the read value from the I/O port.
348 @return The value written back to the I/O port.
358 return IoWrite16 (Port
, (UINT16
) (IoRead16 (Port
) & AndData
));
362 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
363 inclusive OR, and writes the result back to the 16-bit I/O port.
365 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
366 the read result and the value specified by AndData, performs a bitwise OR
367 between the result of the AND operation and the value specified by OrData,
368 and writes the result to the 16-bit I/O port specified by Port. The value
369 written to the I/O port is returned. This function must guarantee that all
370 I/O read and write operations are serialized.
372 If 16-bit I/O port operations are not supported, then ASSERT().
374 @param Port The I/O port to write.
375 @param AndData The value to AND with the read value from the I/O port.
376 @param OrData The value to OR with the result of the AND operation.
378 @return The value written back to the I/O port.
389 return IoWrite16 (Port
, (UINT16
) ((IoRead16 (Port
) & AndData
) | OrData
));
393 Reads a bit field of an I/O register.
395 Reads the bit field in a 16-bit I/O register. The bit field is specified by
396 the StartBit and the EndBit. The value of the bit field is returned.
398 If 16-bit I/O port operations are not supported, then ASSERT().
399 If StartBit is greater than 15, then ASSERT().
400 If EndBit is greater than 15, then ASSERT().
401 If EndBit is less than StartBit, then ASSERT().
403 @param Port The I/O port to read.
404 @param StartBit The ordinal of the least significant bit in the bit field.
406 @param EndBit The ordinal of the most significant bit in the bit field.
409 @return The value read.
420 return BitFieldRead16 (IoRead16 (Port
), StartBit
, EndBit
);
424 Writes a bit field to an I/O register.
426 Writes Value to the bit field of the I/O register. The bit field is specified
427 by the StartBit and the EndBit. All other bits in the destination I/O
428 register are preserved. The value written to the I/O port is returned. Extra
429 left bits in Value are stripped.
431 If 16-bit I/O port operations are not supported, then ASSERT().
432 If StartBit is greater than 15, then ASSERT().
433 If EndBit is greater than 15, then ASSERT().
434 If EndBit is less than StartBit, then ASSERT().
436 @param Port The I/O port to write.
437 @param StartBit The ordinal of the least significant bit in the bit field.
439 @param EndBit The ordinal of the most significant bit in the bit field.
441 @param Value New value of the bit field.
443 @return The value written back to the I/O port.
457 BitFieldWrite16 (IoRead16 (Port
), StartBit
, EndBit
, Value
)
462 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
463 result back to the bit field in the 16-bit port.
465 Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
466 between the read result and the value specified by OrData, and writes the
467 result to the 16-bit I/O port specified by Port. The value written to the I/O
468 port is returned. This function must guarantee that all I/O read and write
469 operations are serialized. Extra left bits in OrData are stripped.
471 If 16-bit I/O port operations are not supported, then ASSERT().
472 If StartBit is greater than 15, then ASSERT().
473 If EndBit is greater than 15, then ASSERT().
474 If EndBit is less than StartBit, then ASSERT().
476 @param Port The I/O port to write.
477 @param StartBit The ordinal of the least significant bit in the bit field.
479 @param EndBit The ordinal of the most significant bit in the bit field.
481 @param OrData The value to OR with the read value from the I/O port.
483 @return The value written back to the I/O port.
497 BitFieldOr16 (IoRead16 (Port
), StartBit
, EndBit
, OrData
)
502 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
503 result back to the bit field in the 16-bit port.
505 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
506 the read result and the value specified by AndData, and writes the result to
507 the 16-bit I/O port specified by Port. The value written to the I/O port is
508 returned. This function must guarantee that all I/O read and write operations
509 are serialized. Extra left bits in AndData are stripped.
511 If 16-bit I/O port operations are not supported, then ASSERT().
512 If StartBit is greater than 15, then ASSERT().
513 If EndBit is greater than 15, then ASSERT().
514 If EndBit is less than StartBit, then ASSERT().
516 @param Port The I/O port to write.
517 @param StartBit The ordinal of the least significant bit in the bit field.
519 @param EndBit The ordinal of the most significant bit in the bit field.
521 @param AndData The value to AND with the read value from the I/O port.
523 @return The value written back to the I/O port.
537 BitFieldAnd16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
)
542 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
543 bitwise inclusive OR, and writes the result back to the bit field in the
546 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
547 by a bitwise inclusive OR between the read result and the value specified by
548 AndData, and writes the result to the 16-bit I/O port specified by Port. The
549 value written to the I/O port is returned. This function must guarantee that
550 all I/O read and write operations are serialized. Extra left bits in both
551 AndData and OrData are stripped.
553 If 16-bit I/O port operations are not supported, then ASSERT().
554 If StartBit is greater than 15, then ASSERT().
555 If EndBit is greater than 15, then ASSERT().
556 If EndBit is less than StartBit, then ASSERT().
558 @param Port The I/O port to write.
559 @param StartBit The ordinal of the least significant bit in the bit field.
561 @param EndBit The ordinal of the most significant bit in the bit field.
563 @param AndData The value to AND with the read value from the I/O port.
564 @param OrData The value to OR with the result of the AND operation.
566 @return The value written back to the I/O port.
571 IoBitFieldAndThenOr16 (
581 BitFieldAndThenOr16 (IoRead16 (Port
), StartBit
, EndBit
, AndData
, OrData
)
586 Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
587 result back to the 32-bit I/O port.
589 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
590 between the read result and the value specified by OrData, and writes the
591 result to the 32-bit I/O port specified by Port. The value written to the I/O
592 port is returned. This function must guarantee that all I/O read and write
593 operations are serialized.
595 If 32-bit I/O port operations are not supported, then ASSERT().
597 @param Port The I/O port to write.
598 @param OrData The value to OR with the read value from the I/O port.
600 @return The value written back to the I/O port.
610 return IoWrite32 (Port
, IoRead32 (Port
) | OrData
);
614 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
615 to the 32-bit I/O port.
617 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
618 the read result and the value specified by AndData, and writes the result to
619 the 32-bit I/O port specified by Port. The value written to the I/O port is
620 returned. This function must guarantee that all I/O read and write operations
623 If 32-bit I/O port operations are not supported, then ASSERT().
625 @param Port The I/O port to write.
626 @param AndData The value to AND with the read value from the I/O port.
628 @return The value written back to the I/O port.
638 return IoWrite32 (Port
, IoRead32 (Port
) & AndData
);
642 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
643 inclusive OR, and writes the result back to the 32-bit I/O port.
645 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
646 the read result and the value specified by AndData, performs a bitwise OR
647 between the result of the AND operation and the value specified by OrData,
648 and writes the result to the 32-bit I/O port specified by Port. The value
649 written to the I/O port is returned. This function must guarantee that all
650 I/O read and write operations are serialized.
652 If 32-bit I/O port operations are not supported, then ASSERT().
654 @param Port The I/O port to write.
655 @param AndData The value to AND with the read value from the I/O port.
656 @param OrData The value to OR with the result of the AND operation.
658 @return The value written back to the I/O port.
669 return IoWrite32 (Port
, (IoRead32 (Port
) & AndData
) | OrData
);
673 Reads a bit field of an I/O register.
675 Reads the bit field in a 32-bit I/O register. The bit field is specified by
676 the StartBit and the EndBit. The value of the bit field is returned.
678 If 32-bit I/O port operations are not supported, then ASSERT().
679 If StartBit is greater than 31, then ASSERT().
680 If EndBit is greater than 31, then ASSERT().
681 If EndBit is less than StartBit, then ASSERT().
683 @param Port The I/O port to read.
684 @param StartBit The ordinal of the least significant bit in the bit field.
686 @param EndBit The ordinal of the most significant bit in the bit field.
689 @return The value read.
700 return BitFieldRead32 (IoRead32 (Port
), StartBit
, EndBit
);
704 Writes a bit field to an I/O register.
706 Writes Value to the bit field of the I/O register. The bit field is specified
707 by the StartBit and the EndBit. All other bits in the destination I/O
708 register are preserved. The value written to the I/O port is returned. Extra
709 left bits in Value are stripped.
711 If 32-bit I/O port operations are not supported, then ASSERT().
712 If StartBit is greater than 31, then ASSERT().
713 If EndBit is greater than 31, then ASSERT().
714 If EndBit is less than StartBit, then ASSERT().
716 @param Port The I/O port to write.
717 @param StartBit The ordinal of the least significant bit in the bit field.
719 @param EndBit The ordinal of the most significant bit in the bit field.
721 @param Value New value of the bit field.
723 @return The value written back to the I/O port.
737 BitFieldWrite32 (IoRead32 (Port
), StartBit
, EndBit
, Value
)
742 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
743 result back to the bit field in the 32-bit port.
745 Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
746 between the read result and the value specified by OrData, and writes the
747 result to the 32-bit I/O port specified by Port. The value written to the I/O
748 port is returned. This function must guarantee that all I/O read and write
749 operations are serialized. Extra left bits in OrData are stripped.
751 If 32-bit I/O port operations are not supported, then ASSERT().
752 If StartBit is greater than 31, then ASSERT().
753 If EndBit is greater than 31, then ASSERT().
754 If EndBit is less than StartBit, then ASSERT().
756 @param Port The I/O port to write.
757 @param StartBit The ordinal of the least significant bit in the bit field.
759 @param EndBit The ordinal of the most significant bit in the bit field.
761 @param OrData The value to OR with the read value from the I/O port.
763 @return The value written back to the I/O port.
777 BitFieldOr32 (IoRead32 (Port
), StartBit
, EndBit
, OrData
)
782 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
783 result back to the bit field in the 32-bit port.
785 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
786 the read result and the value specified by AndData, and writes the result to
787 the 32-bit I/O port specified by Port. The value written to the I/O port is
788 returned. This function must guarantee that all I/O read and write operations
789 are serialized. Extra left bits in AndData are stripped.
791 If 32-bit I/O port operations are not supported, then ASSERT().
792 If StartBit is greater than 31, then ASSERT().
793 If EndBit is greater than 31, then ASSERT().
794 If EndBit is less than StartBit, then ASSERT().
796 @param Port The I/O port to write.
797 @param StartBit The ordinal of the least significant bit in the bit field.
799 @param EndBit The ordinal of the most significant bit in the bit field.
801 @param AndData The value to AND with the read value from the I/O port.
803 @return The value written back to the I/O port.
817 BitFieldAnd32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
)
822 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
823 bitwise inclusive OR, and writes the result back to the bit field in the
826 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
827 by a bitwise inclusive OR between the read result and the value specified by
828 AndData, and writes the result to the 32-bit I/O port specified by Port. The
829 value written to the I/O port is returned. This function must guarantee that
830 all I/O read and write operations are serialized. Extra left bits in both
831 AndData and OrData are stripped.
833 If 32-bit I/O port operations are not supported, then ASSERT().
834 If StartBit is greater than 31, then ASSERT().
835 If EndBit is greater than 31, then ASSERT().
836 If EndBit is less than StartBit, then ASSERT().
838 @param Port The I/O port to write.
839 @param StartBit The ordinal of the least significant bit in the bit field.
841 @param EndBit The ordinal of the most significant bit in the bit field.
843 @param AndData The value to AND with the read value from the I/O port.
844 @param OrData The value to OR with the result of the AND operation.
846 @return The value written back to the I/O port.
851 IoBitFieldAndThenOr32 (
861 BitFieldAndThenOr32 (IoRead32 (Port
), StartBit
, EndBit
, AndData
, OrData
)
866 Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
867 result back to the 64-bit I/O port.
869 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
870 between the read result and the value specified by OrData, and writes the
871 result to the 64-bit I/O port specified by Port. The value written to the I/O
872 port is returned. This function must guarantee that all I/O read and write
873 operations are serialized.
875 If 64-bit I/O port operations are not supported, then ASSERT().
877 @param Port The I/O port to write.
878 @param OrData The value to OR with the read value from the I/O port.
880 @return The value written back to the I/O port.
890 return IoWrite64 (Port
, IoRead64 (Port
) | OrData
);
894 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
895 to the 64-bit I/O port.
897 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
898 the read result and the value specified by AndData, and writes the result to
899 the 64-bit I/O port specified by Port. The value written to the I/O port is
900 returned. This function must guarantee that all I/O read and write operations
903 If 64-bit I/O port operations are not supported, then ASSERT().
905 @param Port The I/O port to write.
906 @param AndData The value to AND with the read value from the I/O port.
908 @return The value written back to the I/O port.
918 return IoWrite64 (Port
, IoRead64 (Port
) & AndData
);
922 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
923 inclusive OR, and writes the result back to the 64-bit I/O port.
925 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
926 the read result and the value specified by AndData, performs a bitwise OR
927 between the result of the AND operation and the value specified by OrData,
928 and writes the result to the 64-bit I/O port specified by Port. The value
929 written to the I/O port is returned. This function must guarantee that all
930 I/O read and write operations are serialized.
932 If 64-bit I/O port operations are not supported, then ASSERT().
934 @param Port The I/O port to write.
935 @param AndData The value to AND with the read value from the I/O port.
936 @param OrData The value to OR with the result of the AND operation.
938 @return The value written back to the I/O port.
949 return IoWrite64 (Port
, (IoRead64 (Port
) & AndData
) | OrData
);
953 Reads a bit field of an I/O register.
955 Reads the bit field in a 64-bit I/O register. The bit field is specified by
956 the StartBit and the EndBit. The value of the bit field is returned.
958 If 64-bit I/O port operations are not supported, then ASSERT().
959 If StartBit is greater than 63, then ASSERT().
960 If EndBit is greater than 63, then ASSERT().
961 If EndBit is less than StartBit, then ASSERT().
963 @param Port The I/O port to read.
964 @param StartBit The ordinal of the least significant bit in the bit field.
966 @param EndBit The ordinal of the most significant bit in the bit field.
969 @return The value read.
980 return BitFieldRead64 (IoRead64 (Port
), StartBit
, EndBit
);
984 Writes a bit field to an I/O register.
986 Writes Value to the bit field of the I/O register. The bit field is specified
987 by the StartBit and the EndBit. All other bits in the destination I/O
988 register are preserved. The value written to the I/O port is returned. Extra
989 left bits in Value are stripped.
991 If 64-bit I/O port operations are not supported, then ASSERT().
992 If StartBit is greater than 63, then ASSERT().
993 If EndBit is greater than 63, then ASSERT().
994 If EndBit is less than StartBit, then ASSERT().
996 @param Port The I/O port to write.
997 @param StartBit The ordinal of the least significant bit in the bit field.
999 @param EndBit The ordinal of the most significant bit in the bit field.
1001 @param Value New value of the bit field.
1003 @return The value written back to the I/O port.
1017 BitFieldWrite64 (IoRead64 (Port
), StartBit
, EndBit
, Value
)
1022 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1023 result back to the bit field in the 64-bit port.
1025 Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
1026 between the read result and the value specified by OrData, and writes the
1027 result to the 64-bit I/O port specified by Port. The value written to the I/O
1028 port is returned. This function must guarantee that all I/O read and write
1029 operations are serialized. Extra left bits in OrData are stripped.
1031 If 64-bit I/O port operations are not supported, then ASSERT().
1032 If StartBit is greater than 63, then ASSERT().
1033 If EndBit is greater than 63, then ASSERT().
1034 If EndBit is less than StartBit, then ASSERT().
1036 @param Port The I/O port to write.
1037 @param StartBit The ordinal of the least significant bit in the bit field.
1039 @param EndBit The ordinal of the most significant bit in the bit field.
1041 @param OrData The value to OR with the read value from the I/O port.
1043 @return The value written back to the I/O port.
1057 BitFieldOr64 (IoRead64 (Port
), StartBit
, EndBit
, OrData
)
1062 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1063 result back to the bit field in the 64-bit port.
1065 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1066 the read result and the value specified by AndData, and writes the result to
1067 the 64-bit I/O port specified by Port. The value written to the I/O port is
1068 returned. This function must guarantee that all I/O read and write operations
1069 are serialized. Extra left bits in AndData are stripped.
1071 If 64-bit I/O port operations are not supported, then ASSERT().
1072 If StartBit is greater than 63, then ASSERT().
1073 If EndBit is greater than 63, then ASSERT().
1074 If EndBit is less than StartBit, then ASSERT().
1076 @param Port The I/O port to write.
1077 @param StartBit The ordinal of the least significant bit in the bit field.
1079 @param EndBit The ordinal of the most significant bit in the bit field.
1081 @param AndData The value to AND with the read value from the I/O port.
1083 @return The value written back to the I/O port.
1097 BitFieldAnd64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
)
1102 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1103 bitwise inclusive OR, and writes the result back to the bit field in the
1106 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1107 by a bitwise inclusive OR between the read result and the value specified by
1108 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1109 value written to the I/O port is returned. This function must guarantee that
1110 all I/O read and write operations are serialized. Extra left bits in both
1111 AndData and OrData are stripped.
1113 If 64-bit I/O port operations are not supported, then ASSERT().
1114 If StartBit is greater than 63, then ASSERT().
1115 If EndBit is greater than 63, then ASSERT().
1116 If EndBit is less than StartBit, then ASSERT().
1118 @param Port The I/O port to write.
1119 @param StartBit The ordinal of the least significant bit in the bit field.
1121 @param EndBit The ordinal of the most significant bit in the bit field.
1123 @param AndData The value to AND with the read value from the I/O port.
1124 @param OrData The value to OR with the result of the AND operation.
1126 @return The value written back to the I/O port.
1131 IoBitFieldAndThenOr64 (
1141 BitFieldAndThenOr64 (IoRead64 (Port
), StartBit
, EndBit
, AndData
, OrData
)
1146 Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
1147 result back to the 8-bit MMIO register.
1149 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1150 inclusive OR between the read result and the value specified by OrData, and
1151 writes the result to the 8-bit MMIO register specified by Address. The value
1152 written to the MMIO register is returned. This function must guarantee that
1153 all MMIO read and write operations are serialized.
1155 If 8-bit MMIO register operations are not supported, then ASSERT().
1157 @param Address The MMIO register to write.
1158 @param OrData The value to OR with the read value from the MMIO register.
1160 @return The value written back to the MMIO register.
1170 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) | OrData
));
1174 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1175 back to the 8-bit MMIO register.
1177 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1178 between the read result and the value specified by AndData, and writes the
1179 result to the 8-bit MMIO register specified by Address. The value written to
1180 the MMIO register is returned. This function must guarantee that all MMIO
1181 read and write operations are serialized.
1183 If 8-bit MMIO register operations are not supported, then ASSERT().
1185 @param Address The MMIO register to write.
1186 @param AndData The value to AND with the read value from the MMIO register.
1188 @return The value written back to the MMIO register.
1198 return MmioWrite8 (Address
, (UINT8
) (MmioRead8 (Address
) & AndData
));
1202 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1203 inclusive OR, and writes the result back to the 8-bit MMIO register.
1205 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1206 between the read result and the value specified by AndData, performs a
1207 bitwise OR between the result of the AND operation and the value specified by
1208 OrData, and writes the result to the 8-bit MMIO register specified by
1209 Address. The value written to the MMIO register is returned. This function
1210 must guarantee that all MMIO read and write operations are serialized.
1212 If 8-bit MMIO register operations are not supported, then ASSERT().
1215 @param Address The MMIO register to write.
1216 @param AndData The value to AND with the read value from the MMIO register.
1217 @param OrData The value to OR with the result of the AND operation.
1219 @return The value written back to the MMIO register.
1230 return MmioWrite8 (Address
, (UINT8
) ((MmioRead8 (Address
) & AndData
) | OrData
));
1234 Reads a bit field of a MMIO register.
1236 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1237 the StartBit and the EndBit. The value of the bit field is returned.
1239 If 8-bit MMIO register operations are not supported, then ASSERT().
1240 If StartBit is greater than 7, then ASSERT().
1241 If EndBit is greater than 7, then ASSERT().
1242 If EndBit is less than StartBit, then ASSERT().
1244 @param Address MMIO register to read.
1245 @param StartBit The ordinal of the least significant bit in the bit field.
1247 @param EndBit The ordinal of the most significant bit in the bit field.
1250 @return The value read.
1261 return BitFieldRead8 (MmioRead8 (Address
), StartBit
, EndBit
);
1265 Writes a bit field to a MMIO register.
1267 Writes Value to the bit field of the MMIO register. The bit field is
1268 specified by the StartBit and the EndBit. All other bits in the destination
1269 MMIO register are preserved. The new value of the 8-bit register is returned.
1271 If 8-bit MMIO register operations are not supported, then ASSERT().
1272 If StartBit is greater than 7, then ASSERT().
1273 If EndBit is greater than 7, then ASSERT().
1274 If EndBit is less than StartBit, then ASSERT().
1276 @param Address MMIO register to write.
1277 @param StartBit The ordinal of the least significant bit in the bit field.
1279 @param EndBit The ordinal of the most significant bit in the bit field.
1281 @param Value New value of the bit field.
1283 @return The value written back to the MMIO register.
1288 MmioBitFieldWrite8 (
1297 BitFieldWrite8 (MmioRead8 (Address
), StartBit
, EndBit
, Value
)
1302 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1303 writes the result back to the bit field in the 8-bit MMIO register.
1305 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1306 inclusive OR between the read result and the value specified by OrData, and
1307 writes the result to the 8-bit MMIO register specified by Address. The value
1308 written to the MMIO register is returned. This function must guarantee that
1309 all MMIO read and write operations are serialized. Extra left bits in OrData
1312 If 8-bit MMIO register operations are not supported, then ASSERT().
1313 If StartBit is greater than 7, then ASSERT().
1314 If EndBit is greater than 7, then ASSERT().
1315 If EndBit is less than StartBit, then ASSERT().
1317 @param Address MMIO register to write.
1318 @param StartBit The ordinal of the least significant bit in the bit field.
1320 @param EndBit The ordinal of the most significant bit in the bit field.
1322 @param OrData The value to OR with read value from the MMIO register.
1324 @return The value written back to the MMIO register.
1338 BitFieldOr8 (MmioRead8 (Address
), StartBit
, EndBit
, OrData
)
1343 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1344 writes the result back to the bit field in the 8-bit MMIO register.
1346 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1347 between the read result and the value specified by AndData, and writes the
1348 result to the 8-bit MMIO register specified by Address. The value written to
1349 the MMIO register is returned. This function must guarantee that all MMIO
1350 read and write operations are serialized. Extra left bits in AndData are
1353 If 8-bit MMIO register operations are not supported, then ASSERT().
1354 If StartBit is greater than 7, then ASSERT().
1355 If EndBit is greater than 7, then ASSERT().
1356 If EndBit is less than StartBit, then ASSERT().
1358 @param Address MMIO register to write.
1359 @param StartBit The ordinal of the least significant bit in the bit field.
1361 @param EndBit The ordinal of the most significant bit in the bit field.
1363 @param AndData The value to AND with read value from the MMIO register.
1365 @return The value written back to the MMIO register.
1379 BitFieldAnd8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
)
1384 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1385 by a bitwise inclusive OR, and writes the result back to the bit field in the
1386 8-bit MMIO register.
1388 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1389 followed by a bitwise inclusive OR between the read result and the value
1390 specified by AndData, and writes the result to the 8-bit MMIO register
1391 specified by Address. The value written to the MMIO register is returned.
1392 This function must guarantee that all MMIO read and write operations are
1393 serialized. Extra left bits in both AndData and OrData are stripped.
1395 If 8-bit MMIO register operations are not supported, then ASSERT().
1396 If StartBit is greater than 7, then ASSERT().
1397 If EndBit is greater than 7, then ASSERT().
1398 If EndBit is less than StartBit, then ASSERT().
1400 @param Address MMIO register to write.
1401 @param StartBit The ordinal of the least significant bit in the bit field.
1403 @param EndBit The ordinal of the most significant bit in the bit field.
1405 @param AndData The value to AND with read value from the MMIO register.
1406 @param OrData The value to OR with the result of the AND operation.
1408 @return The value written back to the MMIO register.
1413 MmioBitFieldAndThenOr8 (
1423 BitFieldAndThenOr8 (MmioRead8 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1428 Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
1429 result back to the 16-bit MMIO register.
1431 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1432 inclusive OR between the read result and the value specified by OrData, and
1433 writes the result to the 16-bit MMIO register specified by Address. The value
1434 written to the MMIO register is returned. This function must guarantee that
1435 all MMIO read and write operations are serialized.
1437 If 16-bit MMIO register operations are not supported, then ASSERT().
1439 @param Address The MMIO register to write.
1440 @param OrData The value to OR with the read value from the MMIO register.
1442 @return The value written back to the MMIO register.
1452 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) | OrData
));
1456 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1457 back to the 16-bit MMIO register.
1459 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1460 between the read result and the value specified by AndData, and writes the
1461 result to the 16-bit MMIO register specified by Address. The value written to
1462 the MMIO register is returned. This function must guarantee that all MMIO
1463 read and write operations are serialized.
1465 If 16-bit MMIO register operations are not supported, then ASSERT().
1467 @param Address The MMIO register to write.
1468 @param AndData The value to AND with the read value from the MMIO register.
1470 @return The value written back to the MMIO register.
1480 return MmioWrite16 (Address
, (UINT16
) (MmioRead16 (Address
) & AndData
));
1484 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1485 inclusive OR, and writes the result back to the 16-bit MMIO register.
1487 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1488 between the read result and the value specified by AndData, performs a
1489 bitwise OR between the result of the AND operation and the value specified by
1490 OrData, and writes the result to the 16-bit MMIO register specified by
1491 Address. The value written to the MMIO register is returned. This function
1492 must guarantee that all MMIO read and write operations are serialized.
1494 If 16-bit MMIO register operations are not supported, then ASSERT().
1497 @param Address The MMIO register to write.
1498 @param AndData The value to AND with the read value from the MMIO register.
1499 @param OrData The value to OR with the result of the AND operation.
1501 @return The value written back to the MMIO register.
1512 return MmioWrite16 (Address
, (UINT16
) ((MmioRead16 (Address
) & AndData
) | OrData
));
1516 Reads a bit field of a MMIO register.
1518 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1519 the StartBit and the EndBit. The value of the bit field is returned.
1521 If 16-bit MMIO register operations are not supported, then ASSERT().
1522 If StartBit is greater than 15, then ASSERT().
1523 If EndBit is greater than 15, then ASSERT().
1524 If EndBit is less than StartBit, then ASSERT().
1526 @param Address MMIO register to read.
1527 @param StartBit The ordinal of the least significant bit in the bit field.
1529 @param EndBit The ordinal of the most significant bit in the bit field.
1532 @return The value read.
1537 MmioBitFieldRead16 (
1543 return BitFieldRead16 (MmioRead16 (Address
), StartBit
, EndBit
);
1547 Writes a bit field to a MMIO register.
1549 Writes Value to the bit field of the MMIO register. The bit field is
1550 specified by the StartBit and the EndBit. All other bits in the destination
1551 MMIO register are preserved. The new value of the 16-bit register is returned.
1553 If 16-bit MMIO register operations are not supported, then ASSERT().
1554 If StartBit is greater than 15, then ASSERT().
1555 If EndBit is greater than 15, then ASSERT().
1556 If EndBit is less than StartBit, then ASSERT().
1558 @param Address MMIO register to write.
1559 @param StartBit The ordinal of the least significant bit in the bit field.
1561 @param EndBit The ordinal of the most significant bit in the bit field.
1563 @param Value New value of the bit field.
1565 @return The value written back to the MMIO register.
1570 MmioBitFieldWrite16 (
1577 return MmioWrite16 (
1579 BitFieldWrite16 (MmioRead16 (Address
), StartBit
, EndBit
, Value
)
1584 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1585 writes the result back to the bit field in the 16-bit MMIO register.
1587 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1588 inclusive OR between the read result and the value specified by OrData, and
1589 writes the result to the 16-bit MMIO register specified by Address. The value
1590 written to the MMIO register is returned. This function must guarantee that
1591 all MMIO read and write operations are serialized. Extra left bits in OrData
1594 If 16-bit MMIO register operations are not supported, then ASSERT().
1595 If StartBit is greater than 15, then ASSERT().
1596 If EndBit is greater than 15, then ASSERT().
1597 If EndBit is less than StartBit, then ASSERT().
1599 @param Address MMIO register to write.
1600 @param StartBit The ordinal of the least significant bit in the bit field.
1602 @param EndBit The ordinal of the most significant bit in the bit field.
1604 @param OrData The value to OR with read value from the MMIO register.
1606 @return The value written back to the MMIO register.
1618 return MmioWrite16 (
1620 BitFieldOr16 (MmioRead16 (Address
), StartBit
, EndBit
, OrData
)
1625 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1626 writes the result back to the bit field in the 16-bit MMIO register.
1628 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1629 between the read result and the value specified by AndData, and writes the
1630 result to the 16-bit MMIO register specified by Address. The value written to
1631 the MMIO register is returned. This function must guarantee that all MMIO
1632 read and write operations are serialized. Extra left bits in AndData are
1635 If 16-bit MMIO register operations are not supported, then ASSERT().
1636 If StartBit is greater than 15, then ASSERT().
1637 If EndBit is greater than 15, then ASSERT().
1638 If EndBit is less than StartBit, then ASSERT().
1640 @param Address MMIO register to write.
1641 @param StartBit The ordinal of the least significant bit in the bit field.
1643 @param EndBit The ordinal of the most significant bit in the bit field.
1645 @param AndData The value to AND with read value from the MMIO register.
1647 @return The value written back to the MMIO register.
1659 return MmioWrite16 (
1661 BitFieldAnd16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
)
1666 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1667 by a bitwise inclusive OR, and writes the result back to the bit field in the
1668 16-bit MMIO register.
1670 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1671 followed by a bitwise inclusive OR between the read result and the value
1672 specified by AndData, and writes the result to the 16-bit MMIO register
1673 specified by Address. The value written to the MMIO register is returned.
1674 This function must guarantee that all MMIO read and write operations are
1675 serialized. Extra left bits in both AndData and OrData are stripped.
1677 If 16-bit MMIO register operations are not supported, then ASSERT().
1678 If StartBit is greater than 15, then ASSERT().
1679 If EndBit is greater than 15, then ASSERT().
1680 If EndBit is less than StartBit, then ASSERT().
1682 @param Address MMIO register to write.
1683 @param StartBit The ordinal of the least significant bit in the bit field.
1685 @param EndBit The ordinal of the most significant bit in the bit field.
1687 @param AndData The value to AND with read value from the MMIO register.
1688 @param OrData The value to OR with the result of the AND operation.
1690 @return The value written back to the MMIO register.
1695 MmioBitFieldAndThenOr16 (
1703 return MmioWrite16 (
1705 BitFieldAndThenOr16 (MmioRead16 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1710 Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
1711 result back to the 32-bit MMIO register.
1713 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1714 inclusive OR between the read result and the value specified by OrData, and
1715 writes the result to the 32-bit MMIO register specified by Address. The value
1716 written to the MMIO register is returned. This function must guarantee that
1717 all MMIO read and write operations are serialized.
1719 If 32-bit MMIO register operations are not supported, then ASSERT().
1721 @param Address The MMIO register to write.
1722 @param OrData The value to OR with the read value from the MMIO register.
1724 @return The value written back to the MMIO register.
1734 return MmioWrite32 (Address
, MmioRead32 (Address
) | OrData
);
1738 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
1739 back to the 32-bit MMIO register.
1741 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1742 between the read result and the value specified by AndData, and writes the
1743 result to the 32-bit MMIO register specified by Address. The value written to
1744 the MMIO register is returned. This function must guarantee that all MMIO
1745 read and write operations are serialized.
1747 If 32-bit MMIO register operations are not supported, then ASSERT().
1749 @param Address The MMIO register to write.
1750 @param AndData The value to AND with the read value from the MMIO register.
1752 @return The value written back to the MMIO register.
1762 return MmioWrite32 (Address
, MmioRead32 (Address
) & AndData
);
1766 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
1767 inclusive OR, and writes the result back to the 32-bit MMIO register.
1769 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1770 between the read result and the value specified by AndData, performs a
1771 bitwise OR between the result of the AND operation and the value specified by
1772 OrData, and writes the result to the 32-bit MMIO register specified by
1773 Address. The value written to the MMIO register is returned. This function
1774 must guarantee that all MMIO read and write operations are serialized.
1776 If 32-bit MMIO register operations are not supported, then ASSERT().
1779 @param Address The MMIO register to write.
1780 @param AndData The value to AND with the read value from the MMIO register.
1781 @param OrData The value to OR with the result of the AND operation.
1783 @return The value written back to the MMIO register.
1794 return MmioWrite32 (Address
, (MmioRead32 (Address
) & AndData
) | OrData
);
1798 Reads a bit field of a MMIO register.
1800 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
1801 the StartBit and the EndBit. The value of the bit field is returned.
1803 If 32-bit MMIO register operations are not supported, then ASSERT().
1804 If StartBit is greater than 31, then ASSERT().
1805 If EndBit is greater than 31, then ASSERT().
1806 If EndBit is less than StartBit, then ASSERT().
1808 @param Address MMIO register to read.
1809 @param StartBit The ordinal of the least significant bit in the bit field.
1811 @param EndBit The ordinal of the most significant bit in the bit field.
1814 @return The value read.
1819 MmioBitFieldRead32 (
1825 return BitFieldRead32 (MmioRead32 (Address
), StartBit
, EndBit
);
1829 Writes a bit field to a MMIO register.
1831 Writes Value to the bit field of the MMIO register. The bit field is
1832 specified by the StartBit and the EndBit. All other bits in the destination
1833 MMIO register are preserved. The new value of the 32-bit register is returned.
1835 If 32-bit MMIO register operations are not supported, then ASSERT().
1836 If StartBit is greater than 31, then ASSERT().
1837 If EndBit is greater than 31, then ASSERT().
1838 If EndBit is less than StartBit, then ASSERT().
1840 @param Address MMIO register to write.
1841 @param StartBit The ordinal of the least significant bit in the bit field.
1843 @param EndBit The ordinal of the most significant bit in the bit field.
1845 @param Value New value of the bit field.
1847 @return The value written back to the MMIO register.
1852 MmioBitFieldWrite32 (
1859 return MmioWrite32 (
1861 BitFieldWrite32 (MmioRead32 (Address
), StartBit
, EndBit
, Value
)
1866 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
1867 writes the result back to the bit field in the 32-bit MMIO register.
1869 Reads the 32-bit MMIO register specified by Address, performs a bitwise
1870 inclusive OR between the read result and the value specified by OrData, and
1871 writes the result to the 32-bit MMIO register specified by Address. The value
1872 written to the MMIO register is returned. This function must guarantee that
1873 all MMIO read and write operations are serialized. Extra left bits in OrData
1876 If 32-bit MMIO register operations are not supported, then ASSERT().
1877 If StartBit is greater than 31, then ASSERT().
1878 If EndBit is greater than 31, then ASSERT().
1879 If EndBit is less than StartBit, then ASSERT().
1881 @param Address MMIO register to write.
1882 @param StartBit The ordinal of the least significant bit in the bit field.
1884 @param EndBit The ordinal of the most significant bit in the bit field.
1886 @param OrData The value to OR with read value from the MMIO register.
1888 @return The value written back to the MMIO register.
1900 return MmioWrite32 (
1902 BitFieldOr32 (MmioRead32 (Address
), StartBit
, EndBit
, OrData
)
1907 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
1908 writes the result back to the bit field in the 32-bit MMIO register.
1910 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1911 between the read result and the value specified by AndData, and writes the
1912 result to the 32-bit MMIO register specified by Address. The value written to
1913 the MMIO register is returned. This function must guarantee that all MMIO
1914 read and write operations are serialized. Extra left bits in AndData are
1917 If 32-bit MMIO register operations are not supported, then ASSERT().
1918 If StartBit is greater than 31, then ASSERT().
1919 If EndBit is greater than 31, then ASSERT().
1920 If EndBit is less than StartBit, then ASSERT().
1922 @param Address MMIO register to write.
1923 @param StartBit The ordinal of the least significant bit in the bit field.
1925 @param EndBit The ordinal of the most significant bit in the bit field.
1927 @param AndData The value to AND with read value from the MMIO register.
1929 @return The value written back to the MMIO register.
1941 return MmioWrite32 (
1943 BitFieldAnd32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
)
1948 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
1949 by a bitwise inclusive OR, and writes the result back to the bit field in the
1950 32-bit MMIO register.
1952 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
1953 followed by a bitwise inclusive OR between the read result and the value
1954 specified by AndData, and writes the result to the 32-bit MMIO register
1955 specified by Address. The value written to the MMIO register is returned.
1956 This function must guarantee that all MMIO read and write operations are
1957 serialized. Extra left bits in both AndData and OrData are stripped.
1959 If 32-bit MMIO register operations are not supported, then ASSERT().
1960 If StartBit is greater than 31, then ASSERT().
1961 If EndBit is greater than 31, then ASSERT().
1962 If EndBit is less than StartBit, then ASSERT().
1964 @param Address MMIO register to write.
1965 @param StartBit The ordinal of the least significant bit in the bit field.
1967 @param EndBit The ordinal of the most significant bit in the bit field.
1969 @param AndData The value to AND with read value from the MMIO register.
1970 @param OrData The value to OR with the result of the AND operation.
1972 @return The value written back to the MMIO register.
1977 MmioBitFieldAndThenOr32 (
1985 return MmioWrite32 (
1987 BitFieldAndThenOr32 (MmioRead32 (Address
), StartBit
, EndBit
, AndData
, OrData
)
1992 Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
1993 result back to the 64-bit MMIO register.
1995 Reads the 64-bit MMIO register specified by Address, performs a bitwise
1996 inclusive OR between the read result and the value specified by OrData, and
1997 writes the result to the 64-bit MMIO register specified by Address. The value
1998 written to the MMIO register is returned. This function must guarantee that
1999 all MMIO read and write operations are serialized.
2001 If 64-bit MMIO register operations are not supported, then ASSERT().
2003 @param Address The MMIO register to write.
2004 @param OrData The value to OR with the read value from the MMIO register.
2006 @return The value written back to the MMIO register.
2016 return MmioWrite64 (Address
, MmioRead64 (Address
) | OrData
);
2020 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2021 back to the 64-bit MMIO register.
2023 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2024 between the read result and the value specified by AndData, and writes the
2025 result to the 64-bit MMIO register specified by Address. The value written to
2026 the MMIO register is returned. This function must guarantee that all MMIO
2027 read and write operations are serialized.
2029 If 64-bit MMIO register operations are not supported, then ASSERT().
2031 @param Address The MMIO register to write.
2032 @param AndData The value to AND with the read value from the MMIO register.
2034 @return The value written back to the MMIO register.
2044 return MmioWrite64 (Address
, MmioRead64 (Address
) & AndData
);
2048 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2049 inclusive OR, and writes the result back to the 64-bit MMIO register.
2051 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2052 between the read result and the value specified by AndData, performs a
2053 bitwise OR between the result of the AND operation and the value specified by
2054 OrData, and writes the result to the 64-bit MMIO register specified by
2055 Address. The value written to the MMIO register is returned. This function
2056 must guarantee that all MMIO read and write operations are serialized.
2058 If 64-bit MMIO register operations are not supported, then ASSERT().
2061 @param Address The MMIO register to write.
2062 @param AndData The value to AND with the read value from the MMIO register.
2063 @param OrData The value to OR with the result of the AND operation.
2065 @return The value written back to the MMIO register.
2076 return MmioWrite64 (Address
, (MmioRead64 (Address
) & AndData
) | OrData
);
2080 Reads a bit field of a MMIO register.
2082 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2083 the StartBit and the EndBit. The value of the bit field is returned.
2085 If 64-bit MMIO register operations are not supported, then ASSERT().
2086 If StartBit is greater than 63, then ASSERT().
2087 If EndBit is greater than 63, then ASSERT().
2088 If EndBit is less than StartBit, then ASSERT().
2090 @param Address MMIO register to read.
2091 @param StartBit The ordinal of the least significant bit in the bit field.
2093 @param EndBit The ordinal of the most significant bit in the bit field.
2096 @return The value read.
2101 MmioBitFieldRead64 (
2107 return BitFieldRead64 (MmioRead64 (Address
), StartBit
, EndBit
);
2111 Writes a bit field to a MMIO register.
2113 Writes Value to the bit field of the MMIO register. The bit field is
2114 specified by the StartBit and the EndBit. All other bits in the destination
2115 MMIO register are preserved. The new value of the 64-bit register is returned.
2117 If 64-bit MMIO register operations are not supported, then ASSERT().
2118 If StartBit is greater than 63, then ASSERT().
2119 If EndBit is greater than 63, then ASSERT().
2120 If EndBit is less than StartBit, then ASSERT().
2122 @param Address MMIO register to write.
2123 @param StartBit The ordinal of the least significant bit in the bit field.
2125 @param EndBit The ordinal of the most significant bit in the bit field.
2127 @param Value New value of the bit field.
2129 @return The value written back to the MMIO register.
2134 MmioBitFieldWrite64 (
2141 return MmioWrite64 (
2143 BitFieldWrite64 (MmioRead64 (Address
), StartBit
, EndBit
, Value
)
2148 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2149 writes the result back to the bit field in the 64-bit MMIO register.
2151 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2152 inclusive OR between the read result and the value specified by OrData, and
2153 writes the result to the 64-bit MMIO register specified by Address. The value
2154 written to the MMIO register is returned. This function must guarantee that
2155 all MMIO read and write operations are serialized. Extra left bits in OrData
2158 If 64-bit MMIO register operations are not supported, then ASSERT().
2159 If StartBit is greater than 63, then ASSERT().
2160 If EndBit is greater than 63, then ASSERT().
2161 If EndBit is less than StartBit, then ASSERT().
2163 @param Address MMIO register to write.
2164 @param StartBit The ordinal of the least significant bit in the bit field.
2166 @param EndBit The ordinal of the most significant bit in the bit field.
2168 @param OrData The value to OR with read value from the MMIO register.
2170 @return The value written back to the MMIO register.
2182 return MmioWrite64 (
2184 BitFieldOr64 (MmioRead64 (Address
), StartBit
, EndBit
, OrData
)
2189 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2190 writes the result back to the bit field in the 64-bit MMIO register.
2192 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2193 between the read result and the value specified by AndData, and writes the
2194 result to the 64-bit MMIO register specified by Address. The value written to
2195 the MMIO register is returned. This function must guarantee that all MMIO
2196 read and write operations are serialized. Extra left bits in AndData are
2199 If 64-bit MMIO register operations are not supported, then ASSERT().
2200 If StartBit is greater than 63, then ASSERT().
2201 If EndBit is greater than 63, then ASSERT().
2202 If EndBit is less than StartBit, then ASSERT().
2204 @param Address MMIO register to write.
2205 @param StartBit The ordinal of the least significant bit in the bit field.
2207 @param EndBit The ordinal of the most significant bit in the bit field.
2209 @param AndData The value to AND with read value from the MMIO register.
2211 @return The value written back to the MMIO register.
2223 return MmioWrite64 (
2225 BitFieldAnd64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
)
2230 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2231 by a bitwise inclusive OR, and writes the result back to the bit field in the
2232 64-bit MMIO register.
2234 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2235 followed by a bitwise inclusive OR between the read result and the value
2236 specified by AndData, and writes the result to the 64-bit MMIO register
2237 specified by Address. The value written to the MMIO register is returned.
2238 This function must guarantee that all MMIO read and write operations are
2239 serialized. Extra left bits in both AndData and OrData are stripped.
2241 If 64-bit MMIO register operations are not supported, then ASSERT().
2242 If StartBit is greater than 63, then ASSERT().
2243 If EndBit is greater than 63, then ASSERT().
2244 If EndBit is less than StartBit, then ASSERT().
2246 @param Address MMIO register to write.
2247 @param StartBit The ordinal of the least significant bit in the bit field.
2249 @param EndBit The ordinal of the most significant bit in the bit field.
2251 @param AndData The value to AND with read value from the MMIO register.
2252 @param OrData The value to OR with the result of the AND operation.
2254 @return The value written back to the MMIO register.
2259 MmioBitFieldAndThenOr64 (
2267 return MmioWrite64 (
2269 BitFieldAndThenOr64 (MmioRead64 (Address
), StartBit
, EndBit
, AndData
, OrData
)