]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PciExpressLib.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Library / PciExpressLib.h
index e312d575285783e73c5601998728559376fc5a86..38d2d58ecf15fb397dc111cf5caafb8b6e6c4d53 100644 (file)
@@ -1,11 +1,11 @@
 /** @file\r
   Provides services to access PCI Configuration Space using the MMIO PCI Express window.\r
-  \r
-  This library is identical to the PCI Library, except the access method for performing PCI \r
+\r
+  This library is identical to the PCI Library, except the access method for performing PCI\r
   configuration cycles must be through the 256 MB PCI Express MMIO window whose base address\r
   is defined by PcdPciExpressBaseAddress.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __PCI_EXPRESS_LIB_H__\r
 #define __PCI_EXPRESS_LIB_H__\r
 \r
+#include <IndustryStandard/PciExpress21.h>\r
+\r
 /**\r
   Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an\r
   address that can be passed to the PCI Library functions.\r
@@ -35,24 +37,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @return The encode PCI address.\r
 \r
 **/\r
-#define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) \\r
-  (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))\r
+#define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) PCI_ECAM_ADDRESS ((Bus), (Device), (Function), (Offset))\r
 \r
 /**\r
-  Registers a PCI device so PCI configuration registers may be accessed after \r
+  Registers a PCI device so PCI configuration registers may be accessed after\r
   SetVirtualAddressMap().\r
-  \r
-  Registers the PCI device specified by Address so all the PCI configuration \r
-  registers associated with that PCI device may be accessed after SetVirtualAddressMap() \r
+\r
+  Registers the PCI device specified by Address so all the PCI configuration\r
+  registers associated with that PCI device may be accessed after SetVirtualAddressMap()\r
   is called.\r
-  \r
+\r
   If Address > 0x0FFFFFFF, then ASSERT().\r
 \r
   @param  Address Address that encodes the PCI Bus, Device, Function and\r
                   Register.\r
-  \r
+\r
   @retval RETURN_SUCCESS           The PCI device was registered for runtime access.\r
-  @retval RETURN_UNSUPPORTED       An attempt was made to call this function \r
+  @retval RETURN_UNSUPPORTED       An attempt was made to call this function\r
                                    after ExitBootServices().\r
   @retval RETURN_UNSUPPORTED       The resources required to access the PCI device\r
                                    at runtime could not be mapped.\r