summaryrefslogtreecommitdiff
path: root/OvmfPkg/BlockMmioToBlockIoDxe
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-23 06:43:53 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-23 06:43:53 +0000
commitf46d494a8ebe334a314879fcee80921f97d2dfae (patch)
tree322f5814a5c758e338db4e340e7b26efc9d9ecce /OvmfPkg/BlockMmioToBlockIoDxe
parent571f4f52d4234d2eab556e8d26cc9095651558c2 (diff)
downloadedk2-platforms-f46d494a8ebe334a314879fcee80921f97d2dfae.tar.xz
OVMF BlockMmioToBlockIoDxe: Fix build error for VS2005
The previous code would generate compiler intrinsic function calls. Patch provided by Scott Wang. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10305 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/BlockMmioToBlockIoDxe')
-rw-r--r--OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c b/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c
index bdd1402cc1..cf68ceaae9 100644
--- a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c
+++ b/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c
@@ -109,11 +109,11 @@ ReadOrWriteBlocks (
//
// BufferSize must be a multiple of the intrinsic block size of the device.
//
- if ((BufferSize % Media->BlockSize) != 0) {
+ if (ModU64x32 (BufferSize, Media->BlockSize) != 0) {
return EFI_BAD_BUFFER_SIZE;
}
- TotalBlock = BufferSize / Media->BlockSize;
+ TotalBlock = (UINTN) DivU64x32 (BufferSize, Media->BlockSize);
//
// Make sure the range to read is valid.
@@ -131,9 +131,9 @@ ReadOrWriteBlocks (
}
Address = Private->BlockMmio->BaseAddress;
- Address += Media->BlockSize * Lba;
+ Address += MultU64x32 (Lba, Media->BlockSize);
- Count = BufferSize / 8;
+ Count = BufferSize >> 3;
if (ReadData) {
CpuAccessFunction = Private->CpuIo->Mem.Read;