summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2017-02-16 14:01:53 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-02-17 16:59:50 +0800
commiteb470e05a3c7c251cfa50863ea119ba70e9777a3 (patch)
treee86f73191c3bf65b7420df2edfa0ebaddc8783ea /MdeModulePkg/Bus/Pci
parent958163561e9b6d8fa40ea4aac49d46cc889015ac (diff)
downloadedk2-eb470e05a3c7c251cfa50863ea119ba70e9777a3.zip
edk2-eb470e05a3c7c251cfa50863ea119ba70e9777a3.tar.gz
edk2-eb470e05a3c7c251cfa50863ea119ba70e9777a3.tar.bz2
MdeModulePkg/PciBusDxe: Fix IA32 build failure
Compiler calculates the PciBar[BarIndex] using sizeof (PciBar[0]) * BarIndex, when BarIndex is type of UINT64, the above calculation generates assembly code using _allmul. Change BarIndex to UINTN to avoid the build failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Bus/Pci')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index ecda088..d9a83be 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1340,8 +1340,8 @@ UpdatePciInfo (
)
{
EFI_STATUS Status;
- UINT64 BarIndex;
- UINT64 BarEndIndex;
+ UINTN BarIndex;
+ UINTN BarEndIndex;
BOOLEAN SetFlag;
VOID *Configuration;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
@@ -1395,16 +1395,16 @@ UpdatePciInfo (
break;
}
- BarIndex = Ptr->AddrTranslationOffset;
- BarEndIndex = BarIndex;
-
- //
- // Update all the bars in the device
- // Compare against 0xFF is to keep backward compatibility.
- //
- if ((BarIndex == MAX_UINT64) || (BarIndex == 0xFF)) {
+ if ((Ptr->AddrTranslationOffset == MAX_UINT64) || (Ptr->AddrTranslationOffset == MAX_UINT8)) {
+ //
+ // Update all the bars in the device
+ // Compare against MAX_UINT8 is to keep backward compatibility.
+ //
BarIndex = 0;
BarEndIndex = PCI_MAX_BAR - 1;
+ } else {
+ BarIndex = (UINTN) Ptr->AddrTranslationOffset;
+ BarEndIndex = BarIndex;
}
if (BarIndex >= PCI_MAX_BAR) {