]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePciExpressLib/PciLib.c
1) Sync PcdPpi guid with PCD arch spec.
[mirror_edk2.git] / MdePkg / Library / BasePciExpressLib / PciLib.c
index a3dab38ec34f43a969d769325afc3d07fda201b6..de33bf30555a5b4d89623b3d63777e26706a90ec 100644 (file)
@@ -37,8 +37,7 @@ GetPciExpressBaseAddress (
   VOID\r
   )\r
 {\r
-  /// @bug Change this to a PCD Get call to retrieve the PCI-E Base Address\r
-  return 0xc0000000;\r
+  return (UINTN)PcdGet64 (PcdPciExpressBaseAddress);\r
 }\r
 \r
 /**\r
@@ -1196,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
@@ -1279,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