summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-23 08:08:48 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-23 08:08:48 +0000
commitd908a2d6d24d7a972a449cdc9a16878e1835d87a (patch)
treebab9ef3c4228b0ac468ae330fb537f0733616ccb
parent2bf3421a0c040164470bde41849d106fcc097c32 (diff)
downloadedk2-platforms-d908a2d6d24d7a972a449cdc9a16878e1835d87a.tar.xz
Add checking for start address for PCI express Read/Write Buffer
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8160 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
index 696f7bbf47..e6a3faa813 100644
--- a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
+++ b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
@@ -222,7 +222,7 @@ GetPciExpressAddress (
}
//
- // Search the entire table for a phyical address match
+ // Search the entire table for a physical address match
//
for (Index = 0; Index < mDxeRuntimePciExpressLibNumberOfRuntimeRanges; Index++) {
if (mDxeRuntimePciExpressLibRegistrationTable[Index].PhysicalAddress == (Address & 0x0ffff000)) {
@@ -1471,6 +1471,10 @@ PciExpressReadBuffer (
{
UINTN ReturnValue;
+ //
+ // Make sure Address is valid
+ //
+ ASSERT (((StartAddress) & ~0xfffffff) == 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
if (Size == 0) {
@@ -1570,6 +1574,10 @@ PciExpressWriteBuffer (
{
UINTN ReturnValue;
+ //
+ // Make sure Address is valid
+ //
+ ASSERT (((StartAddress) & ~0xfffffff) == 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
if (Size == 0) {