]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the bug in PciBusNoEnumerationDxe driver to correct parse the 64bit BAR.
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 23 Aug 2012 12:28:42 +0000 (12:28 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 23 Aug 2012 12:28:42 +0000 (12:28 +0000)
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Rui Sun<rui.sun@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13674 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c

index e5d4755f75b71751301f0054008c164797d1fcfd..6f3979a9c26141d4b6cce281a70499c19378e8f9 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -864,16 +864,12 @@ Returns:
 --*/\r
 {\r
   UINT32      Value;\r
-  //UINT64      BarValue64;\r
   UINT32      OriginalValue;\r
   UINT32      Mask;\r
-  UINT32      Data;\r
-  UINT8       Index;\r
   EFI_STATUS  Status;\r
 \r
   OriginalValue = 0;\r
   Value         = 0;\r
-  //BarValue64    = 0;\r
 \r
   Status = BarExisted (\r
             PciIoDevice,\r
@@ -991,12 +987,7 @@ Returns:
       //\r
       // Fix the length to support some spefic 64 bit BAR\r
       //\r
-      Data  = Value;\r
-      Index = 0;\r
-      for (Data = Value; Data != 0; Data >>= 1) {\r
-        Index ++;\r
-      }\r
-      Value |= ((UINT32)(-1) << Index); \r
+      Value |= ((UINT32)(-1) << HighBitSet32 (Value)); \r
 \r
       //\r
       // Calculate the size of 64bit bar\r