]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PciSegmentLib.h
synchronize the files with the MDE_Library_Spec
[mirror_edk2.git] / MdePkg / Include / Library / PciSegmentLib.h
index 82635d633db5a703fba3cd3957d4f0dfa64f4a76..2801053710761deab5256f7e51596c76a3bd58d8 100644 (file)
@@ -1,14 +1,36 @@
 /** @file\r
-  Functions accessing PCI configuration registers on any supported PCI segment\r
-\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. 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
+  Provides services to access PCI Configuration Space on a platform with multiple PCI segments.\r
+  \r
+  The PCI Segment Library function provide services to read, write, and modify the PCI configuration\r
+  registers on PCI root bridges on any supported PCI segment.  These library services take a single \r
+  address parameter that encodes the PCI Segment, PCI Bus, PCI Device, PCI Function, and PCI Register.  \r
+  The layout of this address parameter is as follows:\r
+  \r
+            PCI Register:      Bits 0..11\r
+            PCI Function       Bits 12..14\r
+            PCI Device Bits 15..19\r
+            PCI Bus    Bits 20..27\r
+            Reserved   Bits 28..31.  Must be 0.\r
+            PCI Segment        Bits 32..47\r
+            Reserved   Bits 48..63.  Must be 0.\r
+            \r
+  | Reserved (MBZ) | Segment | Reserved (MBZ) |     Bus     | Device | Function | Register |\r
+  63             48  47    32  31           28 27         20 19    15 14      12 11         0\r
+\r
+  These functions perform PCI configuration cycles using the default PCI configuration access \r
+  method.  This may use I/O ports 0xCF8 and 0xCFC to perform PCI configuration accesses, or it \r
+  may use MMIO registers relative to the PcdPciExpressBaseAddress, or it may use some alternate \r
+  access method.  Modules will typically use the PCI Segment Library for its PCI configuration \r
+  accesses when PCI Segments other than Segment #0 must be accessed.  \r
+\r
+Copyright (c) 2006 - 2008, Intel Corporation\r
+All rights reserved. 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
 \r
 **/\r
 \r
@@ -46,6 +68,7 @@
 \r
   Reads and returns the 8-bit PCI configuration register specified by Address.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
   \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
@@ -57,14 +80,14 @@ UINT8
 EFIAPI\r
 PciSegmentRead8 (\r
   IN UINT64                    Address\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes an 8-bit PCI configuration register.\r
 \r
   Writes the 8-bit PCI configuration register specified by Address with the value specified by Value.\r
   Value is returned.  This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If Address > 0x0FFFFFFF, then ASSERT().\r
 \r
   @param  Address     Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
@@ -78,8 +101,7 @@ EFIAPI
 PciSegmentWrite8 (\r
   IN UINT64                    Address,\r
   IN UINT8                     Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise inclusive OR of an 8-bit PCI configuration register with an 8-bit value.\r
@@ -89,6 +111,7 @@ PciSegmentWrite8 (
   and writes the result to the 8-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
@@ -102,8 +125,7 @@ EFIAPI
 PciSegmentOr8 (\r
   IN UINT64                    Address,\r
   IN UINT8                     OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value.\r
@@ -116,7 +138,7 @@ PciSegmentOr8 (
   If any reserved bits in Address are set, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData   The value to AND with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
 \r
@@ -126,8 +148,7 @@ EFIAPI
 PciSegmentAnd8 (\r
   IN UINT64                    Address,\r
   IN UINT8                     AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value,\r
@@ -139,10 +160,11 @@ PciSegmentAnd8 (
   and writes the result to the 8-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData    The value to AND with the PCI configuration register.\r
   @param  OrData    The value to OR with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
@@ -154,8 +176,7 @@ PciSegmentAndThenOr8 (
   IN UINT64                    Address,\r
   IN UINT8                     AndData,\r
   IN UINT8                     OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field of a PCI configuration register.\r
@@ -163,6 +184,7 @@ PciSegmentAndThenOr8 (
   Reads the bit field in an 8-bit PCI configuration register.\r
   The bit field is specified by the StartBit and the EndBit.\r
   The value of the bit field is returned.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
@@ -183,8 +205,7 @@ PciSegmentBitFieldRead8 (
   IN UINT64                    Address,\r
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes a bit field to a PCI configuration register.\r
@@ -215,13 +236,17 @@ PciSegmentBitFieldWrite8 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT8                     Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads the 8-bit PCI configuration register specified by Address,\r
   performs a bitwise inclusive OR between the read result and the value specified by OrData,\r
   and writes the result to the 8-bit PCI configuration register specified by Address. \r
+  \r
+  If any reserved bits in Address are set, 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
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
@@ -240,8 +265,7 @@ PciSegmentBitFieldOr8 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT8                     OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR,\r
@@ -253,6 +277,7 @@ PciSegmentBitFieldOr8 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in OrData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
@@ -275,8 +300,7 @@ PciSegmentBitFieldAnd8 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT8                     AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in an 8-bit PCI configuration register, performs a bitwise AND,\r
@@ -288,6 +312,7 @@ PciSegmentBitFieldAnd8 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in AndData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
@@ -312,15 +337,16 @@ PciSegmentBitFieldAndThenOr8 (
   IN UINTN                     EndBit,\r
   IN UINT8                     AndData,\r
   IN UINT8                     OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a 16-bit PCI configuration register.\r
 \r
   Reads and returns the 16-bit PCI configuration register specified by Address.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, then ASSERT().\r
   \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
 \r
@@ -331,15 +357,16 @@ UINT16
 EFIAPI\r
 PciSegmentRead16 (\r
   IN UINT64                    Address\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes a 16-bit PCI configuration register.\r
 \r
   Writes the 16-bit PCI configuration register specified by Address with the value specified by Value.\r
   Value is returned.  This function must guarantee that all PCI read and write operations are serialized.\r
-  If Address > 0x0FFFFFFF, then ASSERT().\r
+  \r
+  If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param  Address     Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  Value       The value to write.\r
@@ -352,8 +379,7 @@ EFIAPI
 PciSegmentWrite16 (\r
   IN UINT64                    Address,\r
   IN UINT16                    Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise inclusive OR of a 16-bit PCI configuration register with a 16-bit value.\r
@@ -363,7 +389,9 @@ PciSegmentWrite16 (
   and writes the result to the 16-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  OrData    The value to OR with the PCI configuration register.\r
@@ -376,8 +404,7 @@ EFIAPI
 PciSegmentOr16 (\r
   IN UINT64                    Address,\r
   IN UINT16                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value.\r
@@ -387,10 +414,12 @@ PciSegmentOr16 (
   and writes the result to the 16-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
-\r
+  If Address is not aligned on a 16-bit boundary, then ASSERT().\r
+  \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData   The value to AND with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
 \r
@@ -400,8 +429,7 @@ EFIAPI
 PciSegmentAnd16 (\r
   IN UINT64                    Address,\r
   IN UINT16                    AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value,\r
@@ -413,10 +441,12 @@ PciSegmentAnd16 (
   and writes the result to the 16-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData    The value to AND with the PCI configuration register.\r
   @param  OrData    The value to OR with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
@@ -428,8 +458,7 @@ PciSegmentAndThenOr16 (
   IN UINT64                    Address,\r
   IN UINT16                    AndData,\r
   IN UINT16                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field of a PCI configuration register.\r
@@ -437,7 +466,9 @@ PciSegmentAndThenOr16 (
   Reads the bit field in a 16-bit PCI configuration register.\r
   The bit field is specified by the StartBit and the EndBit.\r
   The value of the bit field is returned.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, 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
@@ -457,8 +488,7 @@ PciSegmentBitFieldRead16 (
   IN UINT64                    Address,\r
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes a bit field to a PCI configuration register.\r
@@ -467,7 +497,9 @@ PciSegmentBitFieldRead16 (
   The bit field is specified by the StartBit and the EndBit.\r
   All other bits in the destination PCI configuration register are preserved.\r
   The new value of the 16-bit register is returned.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, 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
@@ -489,14 +521,19 @@ PciSegmentBitFieldWrite16 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT16                    Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads the 16-bit PCI configuration register specified by Address,\r
   performs a bitwise inclusive OR between the read result and the value specified by OrData,\r
   and writes the result to the 16-bit PCI configuration register specified by Address. \r
 \r
+  If any reserved bits in Address are set, 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
+\r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     The ordinal of the least significant bit in a byte is bit 0.\r
@@ -514,8 +551,7 @@ PciSegmentBitFieldOr16 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT16                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR,\r
@@ -527,7 +563,9 @@ PciSegmentBitFieldOr16 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in OrData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, 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
@@ -549,8 +587,7 @@ PciSegmentBitFieldAnd16 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT16                    AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in a 16-bit PCI configuration register, performs a bitwise AND,\r
@@ -562,7 +599,9 @@ PciSegmentBitFieldAnd16 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in AndData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 16-bit boundary, 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
@@ -586,16 +625,17 @@ PciSegmentBitFieldAndThenOr16 (
   IN UINTN                     EndBit,\r
   IN UINT16                    AndData,\r
   IN UINT16                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a 32-bit PCI configuration register.\r
 \r
   Reads and returns the 32-bit PCI configuration register specified by Address.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
-  If any reserved bits in Address are set, then ASSERT().\r
   \r
+  If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
 \r
   @return The 32-bit PCI configuration register specified by Address.\r
@@ -605,15 +645,16 @@ UINT32
 EFIAPI\r
 PciSegmentRead32 (\r
   IN UINT64                    Address\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes a 32-bit PCI configuration register.\r
 \r
   Writes the 32-bit PCI configuration register specified by Address with the value specified by Value.\r
   Value is returned.  This function must guarantee that all PCI read and write operations are serialized.\r
-  If Address > 0x0FFFFFFF, then ASSERT().\r
+  \r
+  If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, then ASSERT().\r
 \r
   @param  Address     Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  Value       The value to write.\r
@@ -626,8 +667,7 @@ EFIAPI
 PciSegmentWrite32 (\r
   IN UINT64                    Address,\r
   IN UINT32                    Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise inclusive OR of a 32-bit PCI configuration register with a 32-bit value.\r
@@ -637,7 +677,9 @@ PciSegmentWrite32 (
   and writes the result to the 32-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  OrData    The value to OR with the PCI configuration register.\r
@@ -650,8 +692,7 @@ EFIAPI
 PciSegmentOr32 (\r
   IN UINT64                    Address,\r
   IN UINT32                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value.\r
@@ -661,10 +702,12 @@ PciSegmentOr32 (
   and writes the result to the 32-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData   The value to AND with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
 \r
@@ -674,8 +717,7 @@ EFIAPI
 PciSegmentAnd32 (\r
   IN UINT64                    Address,\r
   IN UINT32                    AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value,\r
@@ -687,10 +729,12 @@ PciSegmentAnd32 (
   and writes the result to the 32-bit PCI configuration register specified by Address.\r
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, then ASSERT().\r
 \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
-  @param  Andata    The value to AND with the PCI configuration register.\r
+  @param  AndData   The value to AND with the PCI configuration register.\r
   @param  OrData    The value to OR with the PCI configuration register.\r
 \r
   @return The value written to the PCI configuration register.\r
@@ -702,8 +746,7 @@ PciSegmentAndThenOr32 (
   IN UINT64                    Address,\r
   IN UINT32                    AndData,\r
   IN UINT32                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field of a PCI configuration register.\r
@@ -711,7 +754,9 @@ PciSegmentAndThenOr32 (
   Reads the bit field in a 32-bit PCI configuration register.\r
   The bit field is specified by the StartBit and the EndBit.\r
   The value of the bit field is returned.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, 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
@@ -731,8 +776,7 @@ PciSegmentBitFieldRead32 (
   IN UINT64                    Address,\r
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Writes a bit field to a PCI configuration register.\r
@@ -741,7 +785,9 @@ PciSegmentBitFieldRead32 (
   The bit field is specified by the StartBit and the EndBit.\r
   All other bits in the destination PCI configuration register are preserved.\r
   The new value of the 32-bit register is returned.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, 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
@@ -763,14 +809,19 @@ PciSegmentBitFieldWrite32 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT32                    Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads the 32-bit PCI configuration register specified by Address,\r
   performs a bitwise inclusive OR between the read result and the value specified by OrData,\r
   and writes the result to the 32-bit PCI configuration register specified by Address. \r
-\r
+  \r
+  If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, 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
+  \r
   @param  Address   Address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  StartBit  The ordinal of the least significant bit in the bit field.\r
                     The ordinal of the least significant bit in a byte is bit 0.\r
@@ -788,8 +839,7 @@ PciSegmentBitFieldOr32 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT32                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR,\r
@@ -801,7 +851,9 @@ PciSegmentBitFieldOr32 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in OrData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, 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
@@ -823,8 +875,7 @@ PciSegmentBitFieldAnd32 (
   IN UINTN                     StartBit,\r
   IN UINTN                     EndBit,\r
   IN UINT32                    AndData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a bit field in a 32-bit PCI configuration register, performs a bitwise AND,\r
@@ -836,7 +887,9 @@ PciSegmentBitFieldAnd32 (
   The value written to the PCI configuration register is returned.\r
   This function must guarantee that all PCI read and write operations are serialized.\r
   Extra left bits in AndData are stripped.\r
+  \r
   If any reserved bits in Address are set, then ASSERT().\r
+  If Address is not aligned on a 32-bit boundary, 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
@@ -860,8 +913,7 @@ PciSegmentBitFieldAndThenOr32 (
   IN UINTN                     EndBit,\r
   IN UINT32                    AndData,\r
   IN UINT32                    OrData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Reads a range of PCI configuration registers into a caller supplied buffer.\r
@@ -870,16 +922,17 @@ PciSegmentBitFieldAndThenOr32 (
   and Size into the buffer specified by Buffer.\r
   This function only allows the PCI configuration registers from a single PCI function to be read.\r
   Size is returned.\r
+  \r
   If any reserved bits in StartAddress are set, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
   If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Segment, Bus, Device, Function, and Register.\r
   @param  Size          Size in bytes of the transfer.\r
   @param  Buffer        Pointer to a buffer receiving the data read.\r
 \r
-  @return The paramter of Size.\r
+  @return The parameter of Size.\r
 \r
 **/\r
 UINTN\r
@@ -888,8 +941,7 @@ PciSegmentReadBuffer (
   IN  UINT64                   StartAddress,\r
   IN  UINTN                    Size,\r
   OUT VOID                     *Buffer\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Copies the data in a caller supplied buffer to a specified range of PCI configuration space.\r
@@ -898,6 +950,7 @@ PciSegmentReadBuffer (
   and Size from the buffer specified by Buffer.\r
   This function only allows the PCI configuration registers from a single PCI function to be written.\r
   Size is returned.\r
+  \r
   If any reserved bits in StartAddress are set, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
   If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
@@ -907,7 +960,7 @@ PciSegmentReadBuffer (
   @param  Size          Size in bytes of the transfer.\r
   @param  Buffer        Pointer to a buffer containing the data to write.\r
 \r
-  @return The paramter of Size.\r
+  @return The parameter of Size.\r
 \r
 **/\r
 UINTN\r
@@ -916,7 +969,6 @@ PciSegmentWriteBuffer (
   IN UINT64                    StartAddress,\r
   IN UINTN                     Size,\r
   IN VOID                      *Buffer\r
-  )\r
-;\r
+  );\r
 \r
 #endif\r