summaryrefslogtreecommitdiff
path: root/edk2/MdeModulePkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-23 12:28:22 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-23 12:28:22 +0000
commit76bdb012013f8321eb3470ae165b231531f9bcd7 (patch)
treee7765507b3648125b719ce8dc101ab2b75ed3a08 /edk2/MdeModulePkg
parentdbb40c43fcae254d7df1bcfcac7344cd1a931d17 (diff)
Fix the bug in PciBus driver to correct parse the 64bit BAR.
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@13673 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'edk2/MdeModulePkg')
-rw-r--r--edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 16f14ca2c..a1627807e 100644
--- a/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/edk2/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1473,8 +1473,6 @@ PciIovParseVfBar (
UINT32 Value;
UINT32 OriginalValue;
UINT32 Mask;
- UINT32 Data;
- UINT8 Index;
EFI_STATUS Status;
//
@@ -1592,12 +1590,7 @@ PciIovParseVfBar (
//
// 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
@@ -1672,8 +1665,6 @@ PciParseBar (
UINT32 Value;
UINT32 OriginalValue;
UINT32 Mask;
- UINT32 Data;
- UINT8 Index;
EFI_STATUS Status;
OriginalValue = 0;
@@ -1810,12 +1801,7 @@ PciParseBar (
//
// 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