From f1bc233ae1255d64ce65948a208ab4b7810b01d4 Mon Sep 17 00:00:00 2001 From: "Tian, Feng" Date: Tue, 22 Jul 2014 03:06:43 +0000 Subject: 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 Reviewed-by: Zeng, Star git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15667 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg/Bus/Ata') diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c index df22d517fd..7fc7a28126 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -1,7 +1,7 @@ /** @file The file for AHCI mode of ATA host controller. - Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
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. -- cgit v1.2.3