From ae837d36dff63a7d5422c309d9bb29551dc66778 Mon Sep 17 00:00:00 2001 From: niruiyu Date: Thu, 23 Aug 2012 12:28:42 +0000 Subject: 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 --- DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c index e5d4755..6f3979a 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 -- cgit v1.1