]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c
Add checking for start address for PCI express Read/Write Buffer
[mirror_edk2.git] / MdePkg / Library / DxeRuntimePciExpressLib / PciExpressLib.c
index 696f7bbf47773341bca2254167d3073543aa8f69..e6a3faa813ae0c9de44b06eb0ac222d8a49fab3b 100644 (file)
@@ -222,7 +222,7 @@ GetPciExpressAddress (
   }\r
 \r
   //\r
-  // Search the entire table for a phyical address match\r
+  // Search the entire table for a physical address match\r
   //\r
   for (Index = 0; Index < mDxeRuntimePciExpressLibNumberOfRuntimeRanges; Index++) {\r
     if (mDxeRuntimePciExpressLibRegistrationTable[Index].PhysicalAddress == (Address & 0x0ffff000)) {\r
@@ -1471,6 +1471,10 @@ PciExpressReadBuffer (
 {\r
   UINTN   ReturnValue;\r
 \r
+  //\r
+  // Make sure Address is valid\r
+  //\r
+  ASSERT (((StartAddress) & ~0xfffffff) == 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
 \r
   if (Size == 0) {\r
@@ -1570,6 +1574,10 @@ PciExpressWriteBuffer (
 {\r
   UINTN                             ReturnValue;\r
 \r
+  //\r
+  // Make sure Address is valid\r
+  //\r
+  ASSERT (((StartAddress) & ~0xfffffff) == 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
 \r
   if (Size == 0) {\r