From f46d494a8ebe334a314879fcee80921f97d2dfae Mon Sep 17 00:00:00 2001 From: jljusten Date: Tue, 23 Mar 2010 06:43:53 +0000 Subject: 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 --- OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OvmfPkg') 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; -- cgit v1.2.3