From f5305d5a9978a443b81202a6d5102fa702fa231b Mon Sep 17 00:00:00 2001 From: xli24 Date: Mon, 2 Mar 2009 05:51:01 +0000 Subject: [PATCH] Refine PCI Segment Library to avoid possible intrinsic function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7752 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c | 2 +- MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c index 7d59b0a380..6c327e2eb9 100644 --- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c +++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c @@ -42,7 +42,7 @@ **/ #define PCI_TO_PCICFG2_ADDRESS(A) \ - ((((A) << 4) & 0xff000000) | (((A) >> 4) & 0x00000700) | (((A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32))) + ((((UINT32)(A) << 4) & 0xff000000) | (((UINT32)(A) >> 4) & 0x00000700) | (((UINT32)(A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32))) /** Gets PCI CFG2 PPI. diff --git a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h index 00129edea6..ea9fe6665e 100644 --- a/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h +++ b/MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/PciSegmentLib.h @@ -54,6 +54,6 @@ typedef struct { **/ #define PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS(A) \ - ((((A) << 4) & 0xff000000) | (((A) >> 4) & 0x00000700) | (((A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32))) + ((((UINT32)(A) << 4) & 0xff000000) | (((UINT32)(A) >> 4) & 0x00000700) | (((UINT32)(A) << 1) & 0x001f0000) | (LShiftU64((A) & 0xfff, 32))) #endif -- 2.39.2