From 34ffd1bbb555857aefcfe93ab0d19719706ceec7 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Fri, 28 Nov 2008 06:14:55 +0000 Subject: [PATCH] Refine the comments in PciSegmentLib git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6773 6f19259b-4bc3-4df7-8a09-765794883524 --- .../PeiPciSegmentLibPciCfg2/PciSegmentLib.c | 43 +++++++----------- .../PciSegmentLib.c | 45 ++++++++----------- 2 files changed, 35 insertions(+), 53 deletions(-) diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c index c2f2ebbc9e..7dca08281b 100644 --- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c +++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c @@ -1198,24 +1198,20 @@ PciSegmentBitFieldAndThenOr32 ( /** Reads a range of PCI configuration registers into a caller supplied buffer. - Reads the range of PCI configuration registers specified by StartAddress and - Size into the buffer specified by Buffer. This function only allows the PCI - configuration registers from a single PCI function to be read. Size is - returned. When possible 32-bit PCI configuration read cycles are used to read - from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit - and 16-bit PCI configuration read cycles may be used at the beginning and the - end of the range. - - If StartAddress > 0x0FFFFFFF, then ASSERT(). + Reads the range of PCI configuration registers specified by StartAddress + and Size into the buffer specified by Buffer. + This function only allows the PCI configuration registers from a single PCI function to be read. + Size is returned. + + If any reserved bits in StartAddress are set, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). If Size > 0 and Buffer is NULL, then ASSERT(). - @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, - Function and Register. + @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register. @param Size Size in bytes of the transfer. @param Buffer Pointer to a buffer receiving the data read. - @return Size + @return The parameter of Size. **/ UINTN @@ -1294,23 +1290,18 @@ PciSegmentReadBuffer ( /** - Copies the data in a caller supplied buffer to a specified range of PCI - configuration space. - - Writes the range of PCI configuration registers specified by StartAddress and - Size from the buffer specified by Buffer. This function only allows the PCI - configuration registers from a single PCI function to be written. Size is - returned. When possible 32-bit PCI configuration write cycles are used to - write from StartAdress to StartAddress + Size. Due to alignment restrictions, - 8-bit and 16-bit PCI configuration write cycles may be used at the beginning - and the end of the range. - - If StartAddress > 0x0FFFFFFF, then ASSERT(). + Copies the data in a caller supplied buffer to a specified range of PCI configuration space. + + Writes the range of PCI configuration registers specified by StartAddress + and Size from the buffer specified by Buffer. + This function only allows the PCI configuration registers from a single PCI function to be written. + Size is returned. + + If any reserved bits in StartAddress are set, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). If Size > 0 and Buffer is NULL, then ASSERT(). - @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, - Function and Register. + @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register. @param Size Size in bytes of the transfer. @param Buffer Pointer to a buffer containing the data to write. diff --git a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c index cb8991e2da..7a62eee592 100644 --- a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c +++ b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.c @@ -1302,24 +1302,20 @@ PciSegmentBitFieldAndThenOr32 ( /** Reads a range of PCI configuration registers into a caller supplied buffer. - Reads the range of PCI configuration registers specified by StartAddress and - Size into the buffer specified by Buffer. This function only allows the PCI - configuration registers from a single PCI function to be read. Size is - returned. When possible 32-bit PCI configuration read cycles are used to read - from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit - and 16-bit PCI configuration read cycles may be used at the beginning and the - end of the range. - - If StartAddress > 0x0FFFFFFF, then ASSERT(). + Reads the range of PCI configuration registers specified by StartAddress + and Size into the buffer specified by Buffer. + This function only allows the PCI configuration registers from a single PCI function to be read. + Size is returned. + + If any reserved bits in StartAddress are set, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). If Size > 0 and Buffer is NULL, then ASSERT(). - @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, - Function and Register. + @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register. @param Size Size in bytes of the transfer. @param Buffer Pointer to a buffer receiving the data read. - @return Size + @return The parameter of Size. **/ UINTN @@ -1397,27 +1393,22 @@ PciSegmentReadBuffer ( } /** - Copies the data in a caller supplied buffer to a specified range of PCI - configuration space. - - Writes the range of PCI configuration registers specified by StartAddress and - Size from the buffer specified by Buffer. This function only allows the PCI - configuration registers from a single PCI function to be written. Size is - returned. When possible 32-bit PCI configuration write cycles are used to - write from StartAdress to StartAddress + Size. Due to alignment restrictions, - 8-bit and 16-bit PCI configuration write cycles may be used at the beginning - and the end of the range. - - If StartAddress > 0x0FFFFFFF, then ASSERT(). + Copies the data in a caller supplied buffer to a specified range of PCI configuration space. + + Writes the range of PCI configuration registers specified by StartAddress + and Size from the buffer specified by Buffer. + This function only allows the PCI configuration registers from a single PCI function to be written. + Size is returned. + + If any reserved bits in StartAddress are set, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT(). If Size > 0 and Buffer is NULL, then ASSERT(). - @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, - Function and Register. + @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register. @param Size Size in bytes of the transfer. @param Buffer Pointer to a buffer containing the data to write. - @return Size + @return The parameter of Size. **/ UINTN -- 2.39.2