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
-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
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
--*/\r
{\r
UINT32 Value;\r
--*/\r
{\r
UINT32 Value;\r
UINT32 OriginalValue;\r
UINT32 Mask;\r
UINT32 OriginalValue;\r
UINT32 Mask;\r
- UINT32 Data;\r
- UINT8 Index;\r
EFI_STATUS Status;\r
\r
OriginalValue = 0;\r
Value = 0;\r
EFI_STATUS Status;\r
\r
OriginalValue = 0;\r
Value = 0;\r
\r
Status = BarExisted (\r
PciIoDevice,\r
\r
Status = BarExisted (\r
PciIoDevice,\r
//\r
// Fix the length to support some spefic 64 bit BAR\r
//\r
//\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
\r
//\r
// Calculate the size of 64bit bar\r