X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FPciSegmentLib.h;h=5175e0760646aac453fcd73482f0a32a834e8672;hp=113501034e799e93c301eefda4a1bcbe0df54754;hb=2b27b557277a52998e2387333cc834e09a887c18;hpb=70830df6dc72b4fea5e5e9eef07f0039a8a77afe diff --git a/MdePkg/Include/Library/PciSegmentLib.h b/MdePkg/Include/Library/PciSegmentLib.h index 113501034e..5175e07606 100644 --- a/MdePkg/Include/Library/PciSegmentLib.h +++ b/MdePkg/Include/Library/PciSegmentLib.h @@ -23,7 +23,7 @@ access method. Modules will typically use the PCI Segment Library for its PCI configuration accesses when PCI Segments other than Segment #0 must be accessed. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, 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 @@ -56,11 +56,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #define PCI_SEGMENT_LIB_ADDRESS(Segment,Bus,Device,Function,Register) \ - ( ((Register) & 0xfff) | \ - (((Function) & 0x07) << 12) | \ - (((Device) & 0x1f) << 15) | \ - (((Bus) & 0xff) << 20) | \ - (LShiftU64((Segment) & 0xffff, 32)) \ + ((Segment != 0) ? \ + ( ((Register) & 0xfff) | \ + (((Function) & 0x07) << 12) | \ + (((Device) & 0x1f) << 15) | \ + (((Bus) & 0xff) << 20) | \ + (LShiftU64 ((Segment) & 0xffff, 32)) \ + ) : \ + ( ((Register) & 0xfff) | \ + (((Function) & 0x07) << 12) | \ + (((Device) & 0x1f) << 15) | \ + (((Bus) & 0xff) << 20) \ + ) \ ) /**