From: niruiyu Date: Thu, 23 Aug 2012 12:28:42 +0000 (+0000) Subject: Fix the bug in PciBusNoEnumerationDxe driver to correct parse the 64bit BAR. X-Git-Tag: edk2-stable201903~13106 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ae837d36dff63a7d5422c309d9bb29551dc66778;p=mirror_edk2.git Fix the bug in PciBusNoEnumerationDxe driver to correct parse the 64bit BAR. Signed-off-by: Ruiyu Ni Reviewed-by: Rui Sun git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13674 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c index e5d4755f75..6f3979a9c2 100644 --- a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c +++ b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2012, 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 @@ -864,16 +864,12 @@ Returns: --*/ { UINT32 Value; - //UINT64 BarValue64; UINT32 OriginalValue; UINT32 Mask; - UINT32 Data; - UINT8 Index; EFI_STATUS Status; OriginalValue = 0; Value = 0; - //BarValue64 = 0; Status = BarExisted ( PciIoDevice, @@ -991,12 +987,7 @@ Returns: // // Fix the length to support some spefic 64 bit BAR // - Data = Value; - Index = 0; - for (Data = Value; Data != 0; Data >>= 1) { - Index ++; - } - Value |= ((UINT32)(-1) << Index); + Value |= ((UINT32)(-1) << HighBitSet32 (Value)); // // Calculate the size of 64bit bar