diff options
author | Pierre Gondois <pierre.gondois@arm.com> | 2020-06-30 11:49:00 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-07-23 12:05:44 +0000 |
commit | 7ff0459739cd164592638fddfa2621a3b7c2ad2e (patch) | |
tree | f87c137dc471585e75c027a7b20920aab05a9d63 | |
parent | d0da48f112de6ba4f9c28310565809d4c63439a1 (diff) | |
download | edk2-7ff0459739cd164592638fddfa2621a3b7c2ad2e.tar.gz edk2-7ff0459739cd164592638fddfa2621a3b7c2ad2e.tar.bz2 edk2-7ff0459739cd164592638fddfa2621a3b7c2ad2e.zip |
EmbeddedPkg: Fix build error for MmcDxe
The following command line:
build -b NOOPT -a IA32 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc
Generates the following error:
MmcDxe.lib(Diagnostics.obj) : error LNK2001:
unresolved external symbol __allshl
MmcDxe.lib(Diagnostics.obj) : error LNK2001:
unresolved external symbol __aullshr
MmcDxe.lib(MmcBlockIo.obj) : error LNK2001:
unresolved external symbol __allmul
These erros are due to the use of shift/multiply operations
on UINT64 variable on a IA32 architecture.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/Diagnostics.c | 10 | ||||
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c index 20defeb874..49b0690430 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c +++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c @@ -1,7 +1,7 @@ /** @file
Diagnostics Protocol implementation for the MMC DXE driver
- Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+ Copyright (c) 2011-2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -56,7 +56,7 @@ GenerateRandomBuffer ( UINT64* Buffer64 = (UINT64*)Buffer;
for (i = 0; i < (BufferSize >> 3); i++) {
- *Buffer64 = i | (~i << 32);
+ *Buffer64 = i | LShiftU64 (~i, 32);
Buffer64++;
}
}
@@ -227,7 +227,11 @@ MmcDriverDiagnosticsRunDiagnostics ( // LBA=10 Size=BlockSize
DiagnosticLog (L"MMC Driver Diagnostics - Test: Any Block\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, MmcHostInstance->BlockIo.Media->LastBlock >> 1, MmcHostInstance->BlockIo.Media->BlockSize);
+ Status = MmcReadWriteDataTest (
+ MmcHostInstance,
+ RShiftU64 (MmcHostInstance->BlockIo.Media->LastBlock, 1),
+ MmcHostInstance->BlockIo.Media->BlockSize
+ );
// LBA=LastBlock Size=BlockSize
DiagnosticLog (L"MMC Driver Diagnostics - Test: Last Block\n");
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c index b508c466d9..2a5d72d4da 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c @@ -1,6 +1,6 @@ /** @file
*
-* Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2020, ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -149,7 +149,7 @@ MmcTransferBlock ( if (MmcHostInstance->CardInfo.OCRData.AccessMode & SD_CARD_CAPACITY) {
CmdArg = Lba;
} else {
- CmdArg = Lba * This->Media->BlockSize;
+ CmdArg = MultU64x32 (Lba, This->Media->BlockSize);
}
} else {
//Set command argument based on the card access mode (Byte mode or Block mode)
@@ -157,7 +157,7 @@ MmcTransferBlock ( MMC_OCR_ACCESS_SECTOR) {
CmdArg = Lba;
} else {
- CmdArg = Lba * This->Media->BlockSize;
+ CmdArg = MultU64x32 (Lba, This->Media->BlockSize);
}
}
|