From fa03149c12786e4cedd8579ca7cc770f35618f72 Mon Sep 17 00:00:00 2001 From: erictian Date: Wed, 17 Mar 2010 09:46:53 +0000 Subject: =?UTF-8?q?The=20ATA=20alignment=5Flogic=5Fin=5Fphy=5Fblocks=20fie?= =?UTF-8?q?ld=20doesn=E2=80=99t=20directly=20report=20the=20lowest=20align?= =?UTF-8?q?ed=20LBA.=20=20Instead,=20there=E2=80=99s=20some=20modulo=20ari?= =?UTF-8?q?thmetic=20involved.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10265 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c index 8df584506e..d11ebd9df0 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c @@ -304,7 +304,8 @@ IdentifyAtaDevice ( // Check lowest alignment of logical blocks within physical block // if ((IdentifyData->alignment_logic_in_phy_blocks & (BIT14 | BIT15)) == BIT14) { - BlockMedia->LowestAlignedLba = (EFI_LBA) (IdentifyData->alignment_logic_in_phy_blocks & 0x3fff); + BlockMedia->LowestAlignedLba = (EFI_LBA) (BlockMedia->LogicalBlocksPerPhysicalBlock - (IdentifyData->alignment_logic_in_phy_blocks & 0x3fff)) % + BlockMedia->LogicalBlocksPerPhysicalBlock; } } // -- cgit v1.2.3