The driver wrappers BlockMmio protocol instances to produce\r
Block I/O Protocol instances.\r
\r
- Copyright (c) 2007 - 2010, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
//\r
// BufferSize must be a multiple of the intrinsic block size of the device.\r
//\r
- if ((BufferSize % Media->BlockSize) != 0) {\r
+ if (ModU64x32 (BufferSize, Media->BlockSize) != 0) {\r
return EFI_BAD_BUFFER_SIZE;\r
}\r
\r
- TotalBlock = BufferSize / Media->BlockSize;\r
+ TotalBlock = (UINTN) DivU64x32 (BufferSize, Media->BlockSize);\r
\r
//\r
// Make sure the range to read is valid.\r
}\r
\r
Address = Private->BlockMmio->BaseAddress;\r
- Address += Media->BlockSize * Lba;\r
+ Address += MultU64x32 (Lba, Media->BlockSize);\r
\r
- Count = BufferSize / 8;\r
+ Count = BufferSize >> 3;\r
\r
if (ReadData) {\r
CpuAccessFunction = Private->CpuIo->Mem.Read;\r
BLOCK_MMIO_TO_BLOCK_IO_DEVICE *Private;\r
BLOCK_MMIO_PROTOCOL *BlockMmio;\r
\r
- Private = (BLOCK_MMIO_TO_BLOCK_IO_DEVICE*) AllocateZeroPool (sizeof (Private));\r
+ Private = (BLOCK_MMIO_TO_BLOCK_IO_DEVICE*) AllocateZeroPool (sizeof (*Private));\r
ASSERT (Private != NULL);\r
\r
Status = gBS->LocateProtocol (\r