summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2026-09-13 05:39:02 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-09-29 04:36:19 +0300
commitd9934e9178e71779e27c2e62e1c63dc3747ca8c9 (patch)
tree96c189419e98fb049bd2c2c2515f7ebd6eb84c19 /MdeModulePkg
parent42e083c60dd3515263ef24678b67c4feddb543f8 (diff)
downloadedk2-master.tar.xz
MdeModulePkg/SdMmcPciHcDxe: Use UINTN for ADMA descriptor table indexingHEADmaster
In BuildAdmaDescTable(), Index and Entries were UINT64. Using a 64-bit Index for array subscripting `Trb->Adma32Desc[Index]`, `Trb->Adma64V3Desc[Index]`, and `Trb->Adma64V4Desc[Index]` generates 64-bit multiplication on 32-bit architectures (IA32). Change Index and Entries to UINTN so array indexing and table size calculations use native integer math. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 4b95028e4a..49adf63a7c 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -1475,8 +1475,8 @@ BuildAdmaDescTable (
{
EFI_PHYSICAL_ADDRESS Data;
UINT64 DataLen;
- UINT64 Entries;
- UINT64 Index;
+ UINTN Entries;
+ UINTN Index;
UINT64 Remaining;
UINT64 Address;
UINTN TableSize;
@@ -1539,8 +1539,8 @@ BuildAdmaDescTable (
AdmaMaxDataPerLine = ADMA_MAX_DATA_PER_LINE_26B;
}
- Entries = DivU64x32 ((DataLen + AdmaMaxDataPerLine - 1), AdmaMaxDataPerLine);
- TableSize = (UINTN)MultU64x32 (Entries, DescSize);
+ Entries = (UINTN)DivU64x32 ((DataLen + AdmaMaxDataPerLine - 1), AdmaMaxDataPerLine);
+ TableSize = Entries * DescSize;
Trb->AdmaPages = (UINT32)EFI_SIZE_TO_PAGES (TableSize);
Status = PciIo->AllocateBuffer (
PciIo,