From 687add7035b114cbb520725d3dc1ce80b3728ecd Mon Sep 17 00:00:00 2001 From: xli24 Date: Thu, 30 Apr 2009 02:32:49 +0000 Subject: [PATCH] Fix the bug in DxeRuntimePciExpressLib that behavior of GetPciExpressAddress() in virtual mode is not correct. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8206 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c index e56675b873..4231614595 100644 --- a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c +++ b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c @@ -5,7 +5,7 @@ All assertions for I/O operations are handled in MMIO functions in the IoLib Library. - Copyright (c) 2006 - 2008, Intel Corporation
+ Copyright (c) 2006 - 2009, 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 @@ -217,7 +217,7 @@ GetPciExpressAddress ( // // See if there is a physical address match at the exact same index as the last address match // - if (mDxeRuntimePciExpressLibRegistrationTable[mDxeRuntimePciExpressLibLastRuntimeRange].PhysicalAddress == (Address & 0x0ffff000)) { + if (mDxeRuntimePciExpressLibRegistrationTable[mDxeRuntimePciExpressLibLastRuntimeRange].PhysicalAddress == (Address & (~0x00000fff))) { // // Convert the physical address to a virtual address and return the virtual address // @@ -228,7 +228,7 @@ GetPciExpressAddress ( // Search the entire table for a physical address match // for (Index = 0; Index < mDxeRuntimePciExpressLibNumberOfRuntimeRanges; Index++) { - if (mDxeRuntimePciExpressLibRegistrationTable[Index].PhysicalAddress == (Address & 0x0ffff000)) { + if (mDxeRuntimePciExpressLibRegistrationTable[Index].PhysicalAddress == (Address & (~0x00000fff))) { // // Cache the matching index value //