summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BasePciCf8Lib
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-04 13:39:18 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-04 13:39:18 +0000
commitad400b07b8ab766b5fc601b929aaebc4a60dc05d (patch)
tree3b14d5530a59ba0cb9385bba3fb7440ac9cabdb8 /MdePkg/Library/BasePciCf8Lib
parent8ea58c070785281087061b0f706b03cf873949c7 (diff)
downloadedk2-ad400b07b8ab766b5fc601b929aaebc4a60dc05d.tar.gz
edk2-ad400b07b8ab766b5fc601b929aaebc4a60dc05d.tar.bz2
edk2-ad400b07b8ab766b5fc601b929aaebc4a60dc05d.zip
Update MDE Library instances according to code review comments.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5823 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePciCf8Lib')
-rw-r--r--MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf2
-rw-r--r--MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c48
2 files changed, 24 insertions, 26 deletions
diff --git a/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf b/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
index 4e9c64aab1..13629c7418 100644
--- a/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
+++ b/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
@@ -1,5 +1,5 @@
#/** @file
-# This driver implemnets one PCI Cf8 Library instance.
+# This module implements PCI CF8 Library instance.
#
# PCI CF8 Library that uses I/O ports 0xCF8 and 0xCFC to perform PCI Configuration cycles.
# Layers on top of an I/O Library instance.
diff --git a/MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c b/MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c
index 2754d30560..995e4ab1b7 100644
--- a/MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c
+++ b/MdePkg/Library/BasePciCf8Lib/PciCf8Lib.c
@@ -27,32 +27,19 @@
#define PCI_CONFIGURATION_ADDRESS_PORT 0xCF8
#define PCI_CONFIGURATION_DATA_PORT 0xCFC
-//
-// Declare macro to convert PCI Library formatted address to CF8 formatted address
-//
-// PCI Library formatted address CF8 Formatted Address
-// ============================= ======================
-// Bits 00..11 Register Bits 00..07 Register
-// Bits 12..14 Function Bits 08..10 Function
-// Bits 15..19 Device Bits 11..15 Device
-// Bits 20..27 Bus Bits 16..23 Bus
-// Bits 28..31 Reserved(MBZ) Bits 24..30 Reserved(MBZ)
-// Bits 31..31 Must be 1
-//
-
-/**
- Assert the validity of a PCI address. A valid PCI address should contain 1's
- only in the low 28 bits.
-
- @param A The address to validate.
- @param M Additional bits to assert to be zero.
-
-**/
-#define ASSERT_INVALID_PCI_ADDRESS(A,M) \
- ASSERT (((A) & (~0xffff0ff | (M))) == 0)
-
/**
- Convert a PCI Express address to PCI CF8 address.
+ Convert a PCI Library address to PCI CF8 formatted address.
+
+ Declare macro to convert PCI Library address to PCI CF8 formatted address.
+ Bit fields of PCI Library and CF8 formatted address is as follows:
+ PCI Library formatted address CF8 Formatted Address
+ ============================= ======================
+ Bits 00..11 Register Bits 00..07 Register
+ Bits 12..14 Function Bits 08..10 Function
+ Bits 15..19 Device Bits 11..15 Device
+ Bits 20..27 Bus Bits 16..23 Bus
+ Bits 28..31 Reserved(MBZ) Bits 24..30 Reserved(MBZ)
+ Bits 31..31 Must be 1
@param A The address to convert.
@@ -63,6 +50,17 @@
((UINT32) ((((A) >> 4) & 0x00ffff00) | ((A) & 0xfc) | 0x80000000))
/**
+ Assert the validity of a PCI CF8 address. A valid PCI CF8 address should contain 1's
+ only in the low 28 bits, excluding bits 08..11.
+
+ @param A The address to validate.
+ @param M Additional bits to assert to be zero.
+
+**/
+#define ASSERT_INVALID_PCI_ADDRESS(A,M) \
+ ASSERT (((A) & (~0xffff0ff | (M))) == 0)
+
+/**
Reads an 8-bit PCI configuration register.
Reads and returns the 8-bit PCI configuration register specified by Address.