MdeModulePkg/AtaAtapiPassThru: Correct the algo of calculating PRDT number to avoid beyond the boundary of 32 bit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian, Feng <feng.tian@intel.com>
Reviewed-by: Zeng, Star <star.zeng@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15667 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tian, Feng 2014-07-22 03:06:43 +00:00 committed by erictian
parent dcca25d17d
commit f1bc233ae1
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file
The file for AHCI mode of ATA host controller.
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -532,7 +532,7 @@ AhciBuildCommand (
//
// Filling the PRDT
//
PrdtNumber = (DataLength + EFI_AHCI_MAX_DATA_PER_PRDT - 1) / EFI_AHCI_MAX_DATA_PER_PRDT;
PrdtNumber = (UINT32)DivU64x32 (((UINT64)DataLength + EFI_AHCI_MAX_DATA_PER_PRDT - 1), EFI_AHCI_MAX_DATA_PER_PRDT);
//
// According to AHCI 1.3 spec, a PRDT entry can point to a maximum 4MB data block.