]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePciExpressLib/PciLib.c
UefiLib:
[mirror_edk2.git] / MdePkg / Library / BasePciExpressLib / PciLib.c
index 3003613486a9bce2906c1de844a80d543890e8ca..de33bf30555a5b4d89623b3d63777e26706a90ec 100644 (file)
@@ -1195,6 +1195,11 @@ PciExpressReadBuffer (
 {\r
   UINTN                             EndAddress;\r
 \r
+  ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
+  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
+  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
+  ASSERT (Buffer != NULL);\r
+\r
   EndAddress = StartAddress + Size;\r
 \r
   if (StartAddress < EndAddress && (StartAddress & 1)) {\r
@@ -1278,6 +1283,11 @@ PciExpressWriteBuffer (
 {\r
   UINTN                             EndAddress;\r
 \r
+  ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
+  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
+  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
+  ASSERT (Buffer != NULL);\r
+\r
   EndAddress = StartAddress + Size;\r
 \r
   if ((StartAddress < EndAddress) && ((StartAddress & 1)!= 0)) {\r