]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PciExpressLib.h
automagically convert ELF to PE/COFF (i386 only)
[mirror_edk2.git] / MdePkg / Include / Library / PciExpressLib.h
index 3c3fd18987c063473ab52ba4b4843bc4b7975050..29ff9dde8289a6337a5cd3012071d47b0549fb45 100644 (file)
@@ -1,16 +1,16 @@
 /** @file\r
-       Pci Express Library Services for PCI Segment #0\r
+  Pci Express Library Services for PCI Segment #0\r
 \r
-       Copyright (c) 2006, Intel Corporation\r
-       All rights reserved. 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
-       http://opensource.org/licenses/bsd-license.php\r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. 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
+  http://opensource.org/licenses/bsd-license.php\r
 \r
-       THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-       Module Name:    PciExpressLib.h\r
+  Module Name:  PciExpressLib.h\r
 \r
 **/\r
 \r
@@ -36,7 +36,7 @@
 \r
 **/\r
 #define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) \\r
-  PCI_LIB_ADDRESS (Bus, Device, Function, Offset)\r
+  (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))\r
 \r
 /**\r
   Reads an 8-bit PCI configuration register.\r
@@ -965,8 +965,7 @@ PciExpressBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -998,8 +997,7 @@ PciExpressReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r