summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BasePciCf8Lib
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-05 04:17:04 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-05 04:17:04 +0000
commitadd13dc21720eff1a37fdea34c0fef190e2ad37d (patch)
tree0d58a4edded2175903f98276e3fe67f802ab44ce /MdePkg/Library/BasePciCf8Lib
parentc16ade35ca4b293255fea78aaf33783501f90f9f (diff)
downloadedk2-add13dc21720eff1a37fdea34c0fef190e2ad37d.tar.gz
edk2-add13dc21720eff1a37fdea34c0fef190e2ad37d.tar.bz2
edk2-add13dc21720eff1a37fdea34c0fef190e2ad37d.zip
DebugLib:
Fix a bug in PeiDxeDebugLibReportStatusCode: it should use gReportStatusCodeDebugType so that report status code infrastructure can correctly extract debug info. Fix functional and coding style issues in the three instances in EdkModulePkg, namely: EdkDxeDebugLibReportStatusCode, EdkUefiDebugLibStderr, EdkUefiDebugLibConout. DevicePathLib: Sync with MWG 0.57 and add new interface of CreateDevicePathNode(). All the function headers have been updated. PeiServicesLib: Adjust coding style and fix a minor comment error. PciLib: Adjust assert() condition to sync with MWG 0.57 BaseMemoryLib: Adjust assert() for ScanMemXX (), ScanGuid() Rename UefiMemoryLib to DxeMemoryLib PrintLib: Change the return value of all print services to exclude the NULL-terminator. Misc: Slightly adjust the coding style in hob.c in PeiCore module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@757 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePciCf8Lib')
-rw-r--r--MdePkg/Library/BasePciCf8Lib/PciLib.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/MdePkg/Library/BasePciCf8Lib/PciLib.c b/MdePkg/Library/BasePciCf8Lib/PciLib.c
index 89cf0db2b7..a3897bfaa4 100644
--- a/MdePkg/Library/BasePciCf8Lib/PciLib.c
+++ b/MdePkg/Library/BasePciCf8Lib/PciLib.c
@@ -1277,8 +1277,7 @@ PciCf8BitFieldAndThenOr32(
If StartAddress > 0x0FFFFFFF, then ASSERT().
If the register specified by StartAddress >= 0x100, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
- If Buffer is NULL, then ASSERT().
+ If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.
@@ -1300,11 +1299,11 @@ PciCf8ReadBuffer (
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
- ASSERT (Buffer != NULL);
+ ASSERT ((Buffer != NULL) || (Size == 0));
EndAddress = StartAddress + Size;
- if (StartAddress < EndAddress && (StartAddress & 1)) {
+ if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) {
//
// Read a byte if StartAddress is byte aligned
//
@@ -1313,7 +1312,7 @@ PciCf8ReadBuffer (
Buffer = (UINT8*)Buffer + 1;
}
- if (StartAddress < EndAddress && (StartAddress & 2)) {
+ if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {
//
// Read a word if StartAddress is word aligned
//
@@ -1322,7 +1321,7 @@ PciCf8ReadBuffer (
Buffer = (UINT16*)Buffer + 1;
}
- while (EndAddress - StartAddress >= 4) {
+ while ((EndAddress - StartAddress) >= 4) {
//
// Read as many double words as possible
//
@@ -1340,7 +1339,7 @@ PciCf8ReadBuffer (
Buffer = (UINT16*)Buffer + 1;
}
- if (EndAddress & 1) {
+ if ((EndAddress & 1) != 0) {
//
// Read the last remaining byte if exist
//
@@ -1365,8 +1364,7 @@ PciCf8ReadBuffer (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If the register specified by StartAddress >= 0x100, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
- If Buffer is NULL, then ASSERT().
+ If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.
@@ -1388,7 +1386,7 @@ PciCf8WriteBuffer (
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
- ASSERT (Buffer != NULL);
+ ASSERT ((Buffer != NULL) || (Size == 0));
EndAddress = StartAddress + Size;
@@ -1401,7 +1399,7 @@ PciCf8WriteBuffer (
Buffer = (UINT8*)Buffer + 1;
}
- if (StartAddress < EndAddress && (StartAddress & 2)) {
+ if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {
//
// Write a word if StartAddress is word aligned
//
@@ -1410,7 +1408,7 @@ PciCf8WriteBuffer (
Buffer = (UINT16*)Buffer + 1;
}
- while (EndAddress - StartAddress >= 4) {
+ while ((EndAddress - StartAddress) >= 4) {
//
// Write as many double words as possible
//
@@ -1419,7 +1417,7 @@ PciCf8WriteBuffer (
Buffer = (UINT32*)Buffer + 1;
}
- if (EndAddress & 2) {
+ if ((EndAddress & 2) != 0) {
//
// Write the last remaining word if exist
//
@@ -1428,7 +1426,7 @@ PciCf8WriteBuffer (
Buffer = (UINT16*)Buffer + 1;
}
- if (EndAddress & 1) {
+ if ((EndAddress & 1) != 0) {
//
// Write the last remaining byte if exist
//