X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FPciCf8Lib.h;h=1f6ec13ffdd18f550bee29c45fbb30583c19369d;hb=98a1fa1f349476533c626020a7196f08c1ef2dba;hp=3898abe7cf88e2f023f4ffc0e55f987f56999fc4;hpb=0ffa12863e9e60cfd1900e3a83b21f32f89afdf2;p=mirror_edk2.git diff --git a/MdePkg/Include/Library/PciCf8Lib.h b/MdePkg/Include/Library/PciCf8Lib.h index 3898abe7cf..1f6ec13ffd 100644 --- a/MdePkg/Include/Library/PciCf8Lib.h +++ b/MdePkg/Include/Library/PciCf8Lib.h @@ -1,23 +1,20 @@ /** @file - PCI CF8 Library Services for PCI Segment #0 + PCI CF8 Library Services for PCI Segment #0 - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: PciCf8Lib.h + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef __PCI_CF8_LIB_H__ #define __PCI_CF8_LIB_H__ -#include /** Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an @@ -36,7 +33,7 @@ **/ #define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \ - PCI_LIB_ADDRESS (Bus, Device, Function, Offset) + (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20)) /** Reads an 8-bit PCI configuration register. @@ -996,8 +993,7 @@ PciCf8BitFieldAndThenOr32 ( If StartAddress > 0x0FFFFFFF, then ASSERT(). If the register specified by StartAddress >= 0x100, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT(). - If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT(). - If Buffer is NULL, then ASSERT(). + If Size > 0 and Buffer is NULL, then ASSERT(). @param StartAddress Starting address that encodes the PCI Bus, Device, Function and Register. @@ -1030,8 +1026,7 @@ PciCf8ReadBuffer ( If StartAddress > 0x0FFFFFFF, then ASSERT(). If the register specified by StartAddress >= 0x100, then ASSERT(). If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT(). - If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT(). - If Buffer is NULL, then ASSERT(). + If Size > 0 and Buffer is NULL, then ASSERT(). @param StartAddress Starting address that encodes the PCI Bus, Device, Function and Register.