summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-17 09:48:05 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-17 09:48:05 +0000
commitc0d69d10f6f09bdecba70f5750c46b29795e8287 (patch)
tree3621209f61d0d55cf6b0ce49dad06f027d03dfef /IntelFrameworkModulePkg
parentfa03149c12786e4cedd8579ca7cc770f35618f72 (diff)
downloadedk2-platforms-c0d69d10f6f09bdecba70f5750c46b29795e8287.tar.xz
The ATA alignment_logic_in_phy_blocks field doesn’t directly report the lowest aligned LBA. Instead, there’s some modulo arithmetic involved.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10266 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
index c22f7a3b30..7d92065b1c 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
@@ -2563,7 +2563,8 @@ AtaEnableLongPhysicalSector (
//
if ((AtaIdentifyData->alignment_logic_in_phy_blocks & 0xc000) == 0x4000) {
IdeDev->BlkIo.Media->LowestAlignedLba =
- (EFI_LBA) (AtaIdentifyData->alignment_logic_in_phy_blocks & 0x3fff);
+ (EFI_LBA) (IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock - (AtaIdentifyData->alignment_logic_in_phy_blocks & 0x3fff)) %
+ IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock;
}
}
//