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>
)\r
{\r
EFI_STATUS Status;\r
)\r
{\r
EFI_STATUS Status;\r
- UINT64 BarIndex;\r
- UINT64 BarEndIndex;\r
+ UINTN BarIndex;\r
+ UINTN BarEndIndex;\r
BOOLEAN SetFlag;\r
VOID *Configuration;\r
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;\r
BOOLEAN SetFlag;\r
VOID *Configuration;\r
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;\r
- BarIndex = Ptr->AddrTranslationOffset;\r
- BarEndIndex = BarIndex;\r
-\r
- //\r
- // Update all the bars in the device\r
- // Compare against 0xFF is to keep backward compatibility.\r
- //\r
- if ((BarIndex == MAX_UINT64) || (BarIndex == 0xFF)) {\r
+ if ((Ptr->AddrTranslationOffset == MAX_UINT64) || (Ptr->AddrTranslationOffset == MAX_UINT8)) {\r
+ //\r
+ // Update all the bars in the device\r
+ // Compare against MAX_UINT8 is to keep backward compatibility.\r
+ //\r
BarIndex = 0;\r
BarEndIndex = PCI_MAX_BAR - 1;\r
BarIndex = 0;\r
BarEndIndex = PCI_MAX_BAR - 1;\r
+ } else {\r
+ BarIndex = (UINTN) Ptr->AddrTranslationOffset;\r
+ BarEndIndex = BarIndex;\r
}\r
\r
if (BarIndex >= PCI_MAX_BAR) {\r
}\r
\r
if (BarIndex >= PCI_MAX_BAR) {\r