summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/PeiPciSegmentLibPciCfg2
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-24 05:55:41 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-24 05:55:41 +0000
commite43e4b3e8cb381cffa146ac8c0f329bbb4c4b593 (patch)
treec9a0a97fc0ba22542e50e8046c4c73ae742bb138 /MdePkg/Library/PeiPciSegmentLibPciCfg2
parent519f076a478a7da9ff4b9d5327a993b1fc2968e8 (diff)
downloadedk2-e43e4b3e8cb381cffa146ac8c0f329bbb4c4b593.tar.gz
edk2-e43e4b3e8cb381cffa146ac8c0f329bbb4c4b593.tar.bz2
edk2-e43e4b3e8cb381cffa146ac8c0f329bbb4c4b593.zip
Refine new library instances according to review comments.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6692 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiPciSegmentLibPciCfg2')
-rw-r--r--MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c14
-rw-r--r--MdePkg/Library/PeiPciSegmentLibPciCfg2/PeiPciSegmentLibPciCfg2.inf6
2 files changed, 10 insertions, 10 deletions
diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c
index 92f0846e29..54ff1cbe65 100644
--- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c
+++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c
@@ -42,7 +42,7 @@
**/
#define PCI_TO_PCICFG2_ADDRESS(A) \
- (((A) << 4) & 0xff000000) | (((A) >> 4) & 0x00000700) | (((A) << 1) & 0x001f0000) | ((UINT64)((A) & 0xFFF) << 32)
+ ((((A) << 4) & 0xff000000) | (((A) >> 4) & 0x00000700) | (((A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32)))
/**
Gets PCI CFG2 PPI.
@@ -1206,7 +1206,7 @@ PciSegmentBitFieldAndThenOr32 (
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,
+ @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.
@@ -1238,7 +1238,7 @@ PciSegmentReadBuffer (
//
ReturnValue = Size;
- if ((StartAddress & 1) != 0) {
+ if ((StartAddress & BIT0) != 0) {
//
// Read a byte if StartAddress is byte aligned
//
@@ -1248,7 +1248,7 @@ PciSegmentReadBuffer (
Buffer = (UINT8*)Buffer + 1;
}
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
+ if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
//
// Read a word if StartAddress is word aligned
//
@@ -1304,7 +1304,7 @@ PciSegmentReadBuffer (
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,
+ @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.
@@ -1336,7 +1336,7 @@ PciSegmentWriteBuffer (
//
ReturnValue = Size;
- if ((StartAddress & 1) != 0) {
+ if ((StartAddress & BIT0) != 0) {
//
// Write a byte if StartAddress is byte aligned
//
@@ -1346,7 +1346,7 @@ PciSegmentWriteBuffer (
Buffer = (UINT8*)Buffer + 1;
}
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
+ if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
//
// Write a word if StartAddress is word aligned
//
diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PeiPciSegmentLibPciCfg2.inf b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PeiPciSegmentLibPciCfg2.inf
index 85a1231511..938610b045 100644
--- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PeiPciSegmentLibPciCfg2.inf
+++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PeiPciSegmentLibPciCfg2.inf
@@ -1,5 +1,5 @@
# @file
-# This driver implements PCI Segment Lib using PCI CFG2 PPI.
+# PCI Segment Library that layers on top of the PCI CFG2 PPI.
#
# This library produces the APIs from the PCI Segment Library and
# implements these APIs by calling into the EFI_PEI_PCI CFG2 PPI. One or more
@@ -24,7 +24,7 @@
FILE_GUID = 254901AD-7DB7-45f8-93C8-93D579398D9F
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
- LIBRARY_CLASS = PciSegmentLib|PEIM
+ LIBRARY_CLASS = PciLib|PEIM SEC PEI_CORE
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
@@ -32,7 +32,7 @@
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 IPF
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
#
[Sources.common]