From 28c73f6ef7fc6cb1803d80761002ec2a7330d833 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Thu, 6 Jul 2006 10:37:49 +0000 Subject: PciLib: For PciRead/WriteBuffer(): A fix to handle boundary cases when Size is 0; DevicePathLib: For FileDevicePath(): Change to use AppendDevicePath () in place of AppendDevicePathNode(). PrintLib: For type %p, according to current MWG, it should ignore flag 0, +, space, l, & L Misc: Fix a bug in EBC interpreter for Ia32. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@796 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BasePciExpressLib/PciLib.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'MdePkg/Library/BasePciExpressLib') diff --git a/MdePkg/Library/BasePciExpressLib/PciLib.c b/MdePkg/Library/BasePciExpressLib/PciLib.c index 036994aa7b..acd3103483 100644 --- a/MdePkg/Library/BasePciExpressLib/PciLib.c +++ b/MdePkg/Library/BasePciExpressLib/PciLib.c @@ -1196,11 +1196,16 @@ PciExpressReadBuffer ( ASSERT_INVALID_PCI_ADDRESS (StartAddress); ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000); - ASSERT ((Buffer != NULL) || (Size == 0)); + + if (Size == 0) { + return 0; + } + + ASSERT (Buffer != NULL); EndAddress = StartAddress + Size; - if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) { + if ((StartAddress & 1) != 0) { // // Read a byte if StartAddress is byte aligned // @@ -1282,11 +1287,16 @@ PciExpressWriteBuffer ( ASSERT_INVALID_PCI_ADDRESS (StartAddress); ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000); - ASSERT ((Buffer != NULL) || (Size == 0)); + + if (Size == 0) { + return 0; + } + + ASSERT (Buffer != NULL); EndAddress = StartAddress + Size; - if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) { + if ((StartAddress & 1) != 0) { // // Write a byte if StartAddress is byte aligned // -- cgit v1.2.3