From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>,
leif@nuviainc.com, ard.biesheuvel@arm.com, nd@arm.com
Subject: [PATCH v1 1/2] EmbeddedPkg: Fix build error for MmcDxe
Date: Tue, 30 Jun 2020 11:49:00 +0100 [thread overview]
Message-ID: <20200630104901.11648-2-pierre.gondois@arm.com> (raw)
In-Reply-To: <20200630104901.11648-1-pierre.gondois@arm.com>
From: Pierre Gondois <pierre.gondois@arm.com>
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>
---
The changes can be seen at: https://github.com/PierreARM/edk2/commits/831_Fix_VS2017_build_error_v1
Notes:
v1:
- Fix VS2017 build errors. [Pierre]
EmbeddedPkg/Universal/MmcDxe/Diagnostics.c | 10 +++++++---
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 20defeb8745a2eb243f316ba9d4e0d03016e260b..49b069043093544a3cbadc46fda4de483803d638 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 b508c466d9c5c52ffff7855ea32cbd427927e27b..2a5d72d4daf6045e691e51d5b82ed8e6fb721121 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);
}
}
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
next prev parent reply other threads:[~2020-06-30 10:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 10:48 [PATCH v1 0/2] Fix VS2017 build errors PierreGondois
2020-06-30 10:49 ` PierreGondois [this message]
2020-07-22 15:59 ` [PATCH v1 1/2] EmbeddedPkg: Fix build error for MmcDxe Leif Lindholm
2020-06-30 10:49 ` [PATCH v1 2/2] EmbeddedPkg: Add cast from (void*) for VS2017 build PierreGondois
2020-07-22 15:35 ` Leif Lindholm
2020-07-22 21:11 ` [edk2-devel] " Laszlo Ersek
2020-07-23 10:52 ` Leif Lindholm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200630104901.11648-2-pierre.gondois@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox