]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseIoLibIntrinsic / IoHighLevel.c
index 63549a58286ade3ddcafd56d32f458a1598ff0d0..559f5693187a179cf0b0059808aee8cb8f6b7431 100644 (file)
@@ -4,14 +4,8 @@
   All assertions for bit field operations are handled bit field functions in the\r
   Base Library.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   The following IoLib instances contain the same copy of this file:\r
 \r
@@ -80,7 +74,7 @@ IoAnd8 (
 }\r
 \r
 /**\r
-  Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise \r
+  Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 8-bit I/O port.\r
 \r
   Reads the 8-bit I/O port specified by Port, performs a bitwise AND between\r
@@ -146,19 +140,20 @@ IoBitFieldRead8 (
 \r
   Writes Value to the bit field of the I/O register. The bit field is specified\r
   by the StartBit and the EndBit. All other bits in the destination I/O\r
-  register are preserved. The value written to the I/O port is returned. \r
+  register are preserved. The value written to the I/O port is returned.\r
 \r
   If 8-bit I/O port operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..7.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the I/O port.\r
 \r
@@ -186,12 +181,13 @@ IoBitFieldWrite8 (
   between the read result and the value specified by OrData, and writes the\r
   result to the 8-bit I/O port specified by Port. The value written to the I/O\r
   port is returned. This function must guarantee that all I/O read and write\r
-  operations are serialized. Extra left bits in OrData are stripped.\r
+  operations are serialized. Extra bits left in OrData are stripped.\r
 \r
   If 8-bit I/O port operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -226,12 +222,13 @@ IoBitFieldOr8 (
   the read result and the value specified by AndData, and writes the result to\r
   the 8-bit I/O port specified by Port. The value written to the I/O port is\r
   returned. This function must guarantee that all I/O read and write operations\r
-  are serialized. Extra left bits in AndData are stripped.\r
+  are serialized. Extra bits left in AndData are stripped.\r
 \r
   If 8-bit I/O port operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -267,13 +264,15 @@ IoBitFieldAnd8 (
   by a bitwise OR between the read result and the value specified by\r
   AndData, and writes the result to the 8-bit I/O port specified by Port. The\r
   value written to the I/O port is returned. This function must guarantee that\r
-  all I/O read and write operations are serialized. Extra left bits in both\r
+  all I/O read and write operations are serialized. Extra bits left in both\r
   AndData and OrData are stripped.\r
 \r
   If 8-bit I/O port operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -343,7 +342,7 @@ IoOr16 (
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 16-bit boundary, then ASSERT().\r
-  \r
+\r
   @param  Port    The I/O port to write.\r
   @param  AndData The value to AND with the read value from the I/O port.\r
 \r
@@ -361,7 +360,7 @@ IoAnd16 (
 }\r
 \r
 /**\r
-  Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise \r
+  Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 16-bit I/O port.\r
 \r
   Reads the 16-bit I/O port specified by Port, performs a bitwise AND between\r
@@ -373,7 +372,7 @@ IoAnd16 (
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 16-bit boundary, then ASSERT().\r
-  \r
+\r
   @param  Port    The I/O port to write.\r
   @param  AndData The value to AND with the read value from the I/O port.\r
   @param  OrData  The value to OR with the result of the AND operation.\r
@@ -430,20 +429,21 @@ IoBitFieldRead16 (
   Writes Value to the bit field of the I/O register. The bit field is specified\r
   by the StartBit and the EndBit. All other bits in the destination I/O\r
   register are preserved. The value written to the I/O port is returned. Extra\r
-  left bits in Value are stripped.\r
+  bits left in Value are stripped.\r
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 16-bit boundary, then ASSERT().\r
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..15.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the I/O port.\r
 \r
@@ -471,13 +471,14 @@ IoBitFieldWrite16 (
   between the read result and the value specified by OrData, and writes the\r
   result to the 16-bit I/O port specified by Port. The value written to the I/O\r
   port is returned. This function must guarantee that all I/O read and write\r
-  operations are serialized. Extra left bits in OrData are stripped.\r
+  operations are serialized. Extra bits left in OrData are stripped.\r
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 16-bit boundary, then ASSERT().\r
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -512,13 +513,14 @@ IoBitFieldOr16 (
   the read result and the value specified by AndData, and writes the result to\r
   the 16-bit I/O port specified by Port. The value written to the I/O port is\r
   returned. This function must guarantee that all I/O read and write operations\r
-  are serialized. Extra left bits in AndData are stripped.\r
+  are serialized. Extra bits left in AndData are stripped.\r
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 16-bit boundary, then ASSERT().\r
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -554,7 +556,7 @@ IoBitFieldAnd16 (
   by a bitwise OR between the read result and the value specified by\r
   AndData, and writes the result to the 16-bit I/O port specified by Port. The\r
   value written to the I/O port is returned. This function must guarantee that\r
-  all I/O read and write operations are serialized. Extra left bits in both\r
+  all I/O read and write operations are serialized. Extra bits left in both\r
   AndData and OrData are stripped.\r
 \r
   If 16-bit I/O port operations are not supported, then ASSERT().\r
@@ -562,6 +564,8 @@ IoBitFieldAnd16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -649,7 +653,7 @@ IoAnd32 (
 }\r
 \r
 /**\r
-  Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise \r
+  Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 32-bit I/O port.\r
 \r
   Reads the 32-bit I/O port specified by Port, performs a bitwise AND between\r
@@ -718,20 +722,21 @@ IoBitFieldRead32 (
   Writes Value to the bit field of the I/O register. The bit field is specified\r
   by the StartBit and the EndBit. All other bits in the destination I/O\r
   register are preserved. The value written to the I/O port is returned. Extra\r
-  left bits in Value are stripped.\r
+  bits left in Value are stripped.\r
 \r
   If 32-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 32-bit boundary, then ASSERT().\r
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..31.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the I/O port.\r
 \r
@@ -759,13 +764,14 @@ IoBitFieldWrite32 (
   between the read result and the value specified by OrData, and writes the\r
   result to the 32-bit I/O port specified by Port. The value written to the I/O\r
   port is returned. This function must guarantee that all I/O read and write\r
-  operations are serialized. Extra left bits in OrData are stripped.\r
+  operations are serialized. Extra bits left in OrData are stripped.\r
 \r
   If 32-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 32-bit boundary, then ASSERT().\r
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -800,13 +806,14 @@ IoBitFieldOr32 (
   the read result and the value specified by AndData, and writes the result to\r
   the 32-bit I/O port specified by Port. The value written to the I/O port is\r
   returned. This function must guarantee that all I/O read and write operations\r
-  are serialized. Extra left bits in AndData are stripped.\r
+  are serialized. Extra bits left in AndData are stripped.\r
 \r
   If 32-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 32-bit boundary, then ASSERT().\r
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -842,7 +849,7 @@ IoBitFieldAnd32 (
   by a bitwise OR between the read result and the value specified by\r
   AndData, and writes the result to the 32-bit I/O port specified by Port. The\r
   value written to the I/O port is returned. This function must guarantee that\r
-  all I/O read and write operations are serialized. Extra left bits in both\r
+  all I/O read and write operations are serialized. Extra bits left in both\r
   AndData and OrData are stripped.\r
 \r
   If 32-bit I/O port operations are not supported, then ASSERT().\r
@@ -850,6 +857,8 @@ IoBitFieldAnd32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -937,7 +946,7 @@ IoAnd64 (
 }\r
 \r
 /**\r
-  Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise \r
+  Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 64-bit I/O port.\r
 \r
   Reads the 64-bit I/O port specified by Port, performs a bitwise AND between\r
@@ -1006,20 +1015,21 @@ IoBitFieldRead64 (
   Writes Value to the bit field of the I/O register. The bit field is specified\r
   by the StartBit and the EndBit. All other bits in the destination I/O\r
   register are preserved. The value written to the I/O port is returned. Extra\r
-  left bits in Value are stripped.\r
+  bits left in Value are stripped.\r
 \r
   If 64-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 64-bit boundary, then ASSERT().\r
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..63.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the I/O port.\r
 \r
@@ -1047,13 +1057,14 @@ IoBitFieldWrite64 (
   between the read result and the value specified by OrData, and writes the\r
   result to the 64-bit I/O port specified by Port. The value written to the I/O\r
   port is returned. This function must guarantee that all I/O read and write\r
-  operations are serialized. Extra left bits in OrData are stripped.\r
+  operations are serialized. Extra bits left in OrData are stripped.\r
 \r
   If 64-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 64-bit boundary, then ASSERT().\r
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -1088,13 +1099,14 @@ IoBitFieldOr64 (
   the read result and the value specified by AndData, and writes the result to\r
   the 64-bit I/O port specified by Port. The value written to the I/O port is\r
   returned. This function must guarantee that all I/O read and write operations\r
-  are serialized. Extra left bits in AndData are stripped.\r
+  are serialized. Extra bits left in AndData are stripped.\r
 \r
   If 64-bit I/O port operations are not supported, then ASSERT().\r
   If Port is not aligned on a 64-bit boundary, then ASSERT().\r
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -1130,7 +1142,7 @@ IoBitFieldAnd64 (
   by a bitwise OR between the read result and the value specified by\r
   AndData, and writes the result to the 64-bit I/O port specified by Port. The\r
   value written to the I/O port is returned. This function must guarantee that\r
-  all I/O read and write operations are serialized. Extra left bits in both\r
+  all I/O read and write operations are serialized. Extra bits left in both\r
   AndData and OrData are stripped.\r
 \r
   If 64-bit I/O port operations are not supported, then ASSERT().\r
@@ -1138,6 +1150,8 @@ IoBitFieldAnd64 (
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param  Port      The I/O port to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -1170,7 +1184,7 @@ IoBitFieldAndThenOr64 (
   Reads an 8-bit MMIO register, performs a bitwise OR, and writes the\r
   result back to the 8-bit MMIO register.\r
 \r
-  Reads the 8-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 8-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
@@ -1223,7 +1237,7 @@ MmioAnd8 (
 }\r
 \r
 /**\r
-  Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise \r
+  Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 8-bit MMIO register.\r
 \r
   Reads the 8-bit MMIO register specified by Address, performs a bitwise AND\r
@@ -1265,7 +1279,7 @@ MmioAndThenOr8 (
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to read.\r
+  @param  Address   The MMIO register to read.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1296,13 +1310,14 @@ MmioBitFieldRead8 (
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..7.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the MMIO register.\r
 \r
@@ -1326,19 +1341,20 @@ MmioBitFieldWrite8 (
   Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and\r
   writes the result back to the bit field in the 8-bit MMIO register.\r
 \r
-  Reads the 8-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 8-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
-  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  all MMIO read and write operations are serialized. Extra bits left in OrData\r
   are stripped.\r
 \r
   If 8-bit MMIO register operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1371,15 +1387,16 @@ MmioBitFieldOr8 (
   between the read result and the value specified by AndData, and writes the\r
   result to the 8-bit MMIO register specified by Address. The value written to\r
   the MMIO register is returned. This function must guarantee that all MMIO\r
-  read and write operations are serialized. Extra left bits in AndData are\r
+  read and write operations are serialized. Extra bits left in AndData are\r
   stripped.\r
 \r
   If 8-bit MMIO register operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1414,14 +1431,16 @@ MmioBitFieldAnd8 (
   specified by AndData, and writes the result to the 8-bit MMIO register\r
   specified by Address. The value written to the MMIO register is returned.\r
   This function must guarantee that all MMIO read and write operations are\r
-  serialized. Extra left bits in both AndData and OrData are stripped.\r
+  serialized. Extra bits left in both AndData and OrData are stripped.\r
 \r
   If 8-bit MMIO register operations are not supported, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..7.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1452,7 +1471,7 @@ MmioBitFieldAndThenOr8 (
   Reads a 16-bit MMIO register, performs a bitwise OR, and writes the\r
   result back to the 16-bit MMIO register.\r
 \r
-  Reads the 16-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 16-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
@@ -1507,7 +1526,7 @@ MmioAnd16 (
 }\r
 \r
 /**\r
-  Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise \r
+  Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 16-bit MMIO register.\r
 \r
   Reads the 16-bit MMIO register specified by Address, performs a bitwise AND\r
@@ -1550,7 +1569,7 @@ MmioAndThenOr16 (
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to read.\r
+  @param  Address   The MMIO register to read.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1582,13 +1601,14 @@ MmioBitFieldRead16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..15.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the MMIO register.\r
 \r
@@ -1612,11 +1632,11 @@ MmioBitFieldWrite16 (
   Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and\r
   writes the result back to the bit field in the 16-bit MMIO register.\r
 \r
-  Reads the 16-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 16-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
-  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  all MMIO read and write operations are serialized. Extra bits left in OrData\r
   are stripped.\r
 \r
   If 16-bit MMIO register operations are not supported, then ASSERT().\r
@@ -1624,8 +1644,9 @@ MmioBitFieldWrite16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1658,7 +1679,7 @@ MmioBitFieldOr16 (
   between the read result and the value specified by AndData, and writes the\r
   result to the 16-bit MMIO register specified by Address. The value written to\r
   the MMIO register is returned. This function must guarantee that all MMIO\r
-  read and write operations are serialized. Extra left bits in AndData are\r
+  read and write operations are serialized. Extra bits left in AndData are\r
   stripped.\r
 \r
   If 16-bit MMIO register operations are not supported, then ASSERT().\r
@@ -1666,8 +1687,9 @@ MmioBitFieldOr16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1702,15 +1724,17 @@ MmioBitFieldAnd16 (
   specified by AndData, and writes the result to the 16-bit MMIO register\r
   specified by Address. The value written to the MMIO register is returned.\r
   This function must guarantee that all MMIO read and write operations are\r
-  serialized. Extra left bits in both AndData and OrData are stripped.\r
+  serialized. Extra bits left in both AndData and OrData are stripped.\r
 \r
   If 16-bit MMIO register operations are not supported, then ASSERT().\r
   If Address is not aligned on a 16-bit boundary, then ASSERT().\r
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..15.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1741,7 +1765,7 @@ MmioBitFieldAndThenOr16 (
   Reads a 32-bit MMIO register, performs a bitwise OR, and writes the\r
   result back to the 32-bit MMIO register.\r
 \r
-  Reads the 32-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 32-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
@@ -1796,7 +1820,7 @@ MmioAnd32 (
 }\r
 \r
 /**\r
-  Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise \r
+  Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 32-bit MMIO register.\r
 \r
   Reads the 32-bit MMIO register specified by Address, performs a bitwise AND\r
@@ -1839,7 +1863,7 @@ MmioAndThenOr32 (
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to read.\r
+  @param  Address   The MMIO register to read.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1871,13 +1895,14 @@ MmioBitFieldRead32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..31.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the MMIO register.\r
 \r
@@ -1901,11 +1926,11 @@ MmioBitFieldWrite32 (
   Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and\r
   writes the result back to the bit field in the 32-bit MMIO register.\r
 \r
-  Reads the 32-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 32-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
-  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  all MMIO read and write operations are serialized. Extra bits left in OrData\r
   are stripped.\r
 \r
   If 32-bit MMIO register operations are not supported, then ASSERT().\r
@@ -1913,8 +1938,9 @@ MmioBitFieldWrite32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1947,7 +1973,7 @@ MmioBitFieldOr32 (
   between the read result and the value specified by AndData, and writes the\r
   result to the 32-bit MMIO register specified by Address. The value written to\r
   the MMIO register is returned. This function must guarantee that all MMIO\r
-  read and write operations are serialized. Extra left bits in AndData are\r
+  read and write operations are serialized. Extra bits left in AndData are\r
   stripped.\r
 \r
   If 32-bit MMIO register operations are not supported, then ASSERT().\r
@@ -1955,8 +1981,9 @@ MmioBitFieldOr32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -1991,15 +2018,17 @@ MmioBitFieldAnd32 (
   specified by AndData, and writes the result to the 32-bit MMIO register\r
   specified by Address. The value written to the MMIO register is returned.\r
   This function must guarantee that all MMIO read and write operations are\r
-  serialized. Extra left bits in both AndData and OrData are stripped.\r
+  serialized. Extra bits left in both AndData and OrData are stripped.\r
 \r
   If 32-bit MMIO register operations are not supported, then ASSERT().\r
   If Address is not aligned on a 32-bit boundary, then ASSERT().\r
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..31.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -2030,7 +2059,7 @@ MmioBitFieldAndThenOr32 (
   Reads a 64-bit MMIO register, performs a bitwise OR, and writes the\r
   result back to the 64-bit MMIO register.\r
 \r
-  Reads the 64-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 64-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
@@ -2085,7 +2114,7 @@ MmioAnd64 (
 }\r
 \r
 /**\r
-  Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise \r
+  Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise\r
   OR, and writes the result back to the 64-bit MMIO register.\r
 \r
   Reads the 64-bit MMIO register specified by Address, performs a bitwise AND\r
@@ -2128,7 +2157,7 @@ MmioAndThenOr64 (
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to read.\r
+  @param  Address   The MMIO register to read.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -2160,13 +2189,14 @@ MmioBitFieldRead64 (
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..63.\r
-  @param  Value     New value of the bit field.\r
+  @param  Value     The new value of the bit field.\r
 \r
   @return The value written back to the MMIO register.\r
 \r
@@ -2190,11 +2220,11 @@ MmioBitFieldWrite64 (
   Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and\r
   writes the result back to the bit field in the 64-bit MMIO register.\r
 \r
-  Reads the 64-bit MMIO register specified by Address, performs a bitwise \r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise\r
   OR between the read result and the value specified by OrData, and\r
   writes the result to the 64-bit MMIO register specified by Address. The value\r
   written to the MMIO register is returned. This function must guarantee that\r
-  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  all MMIO read and write operations are serialized. Extra bits left in OrData\r
   are stripped.\r
 \r
   If 64-bit MMIO register operations are not supported, then ASSERT().\r
@@ -2202,8 +2232,9 @@ MmioBitFieldWrite64 (
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -2236,7 +2267,7 @@ MmioBitFieldOr64 (
   between the read result and the value specified by AndData, and writes the\r
   result to the 64-bit MMIO register specified by Address. The value written to\r
   the MMIO register is returned. This function must guarantee that all MMIO\r
-  read and write operations are serialized. Extra left bits in AndData are\r
+  read and write operations are serialized. Extra bits left in AndData are\r
   stripped.\r
 \r
   If 64-bit MMIO register operations are not supported, then ASSERT().\r
@@ -2244,8 +2275,9 @@ MmioBitFieldOr64 (
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
@@ -2280,15 +2312,17 @@ MmioBitFieldAnd64 (
   specified by AndData, and writes the result to the 64-bit MMIO register\r
   specified by Address. The value written to the MMIO register is returned.\r
   This function must guarantee that all MMIO read and write operations are\r
-  serialized. Extra left bits in both AndData and OrData are stripped.\r
+  serialized. Extra bits left in both AndData and OrData are stripped.\r
 \r
   If 64-bit MMIO register operations are not supported, then ASSERT().\r
   If Address is not aligned on a 64-bit boundary, then ASSERT().\r
   If StartBit is greater than 63, then ASSERT().\r
   If EndBit is greater than 63, then ASSERT().\r
   If EndBit is less than StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
-  @param  Address   MMIO register to write.\r
+  @param  Address   The MMIO register to write.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     Range 0..63.\r
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r