summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiPciLibPciCfg2
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/PeiPciLibPciCfg2
parent519f076a478a7da9ff4b9d5327a993b1fc2968e8 (diff)
downloadedk2-platforms-e43e4b3e8cb381cffa146ac8c0f329bbb4c4b593.tar.xz
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/PeiPciLibPciCfg2')
-rw-r--r--MdePkg/Library/PeiPciLibPciCfg2/PciLib.c14
-rw-r--r--MdePkg/Library/PeiPciLibPciCfg2/PeiPciLibPciCfg2.inf8
2 files changed, 11 insertions, 11 deletions
diff --git a/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c b/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c
index d3d96790c5..63b1b9fc17 100644
--- a/MdePkg/Library/PeiPciLibPciCfg2/PciLib.c
+++ b/MdePkg/Library/PeiPciLibPciCfg2/PciLib.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)))
/**
Internal worker function to read a PCI configuration register.
@@ -1210,7 +1210,7 @@ PciReadBuffer (
UINTN ReturnValue;
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
if (Size == 0) {
return Size;
@@ -1223,7 +1223,7 @@ PciReadBuffer (
//
ReturnValue = Size;
- if ((StartAddress & 1) != 0) {
+ if ((StartAddress & BIT0) != 0) {
//
// Read a byte if StartAddress is byte aligned
//
@@ -1233,7 +1233,7 @@ PciReadBuffer (
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
//
@@ -1308,7 +1308,7 @@ PciWriteBuffer (
UINTN ReturnValue;
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
if (Size == 0) {
return 0;
@@ -1321,7 +1321,7 @@ PciWriteBuffer (
//
ReturnValue = Size;
- if ((StartAddress & 1) != 0) {
+ if ((StartAddress & BIT0) != 0) {
//
// Write a byte if StartAddress is byte aligned
//
@@ -1331,7 +1331,7 @@ PciWriteBuffer (
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/PeiPciLibPciCfg2/PeiPciLibPciCfg2.inf b/MdePkg/Library/PeiPciLibPciCfg2/PeiPciLibPciCfg2.inf
index 3fce912cf7..5abfff9f46 100644
--- a/MdePkg/Library/PeiPciLibPciCfg2/PeiPciLibPciCfg2.inf
+++ b/MdePkg/Library/PeiPciLibPciCfg2/PeiPciLibPciCfg2.inf
@@ -1,5 +1,5 @@
# @file
-# Component description file for PCI Lib using PCI CFG2 PPI
+# PCI Library that layers on top of the PCI CFG2 PPI.
#
# This library produces the APIs from the PCI Library and implements
# these APIs by calling into the EFI_PEI_PCI CFG2 PPI. One or more EFI_PEI_PCI CFG2
@@ -7,7 +7,7 @@
# the first PPI found, so this library instance should only be used platforms
# with a single PCI segment.
#
-# Copyright (c) 2007, Intel Corporation.
+# Copyright (c) 2007 - 2008, Intel Corporation.
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -25,7 +25,7 @@
FILE_GUID = FA3AD693-D58A-4619-960B-8EE85C914870
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
- LIBRARY_CLASS = PciLib|PEIM
+ LIBRARY_CLASS = PciLib|PEIM SEC PEI_CORE
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
@@ -33,7 +33,7 @@
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
#
[Sources.common]