summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-02 23:51:18 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-02 23:51:18 +0000
commit071b7221a550eba89800493e01861a1e7d72b2b4 (patch)
tree39df9692668dbd597c73e4209ffc45fff22bd5b4 /MdeModulePkg
parentd48e8b0afa9d2782418b000e17e8303097a21229 (diff)
downloadedk2-platforms-071b7221a550eba89800493e01861a1e7d72b2b4.tar.xz
Use DiskIo->WriteDisk() API to avoid alignment issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8445 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
index a54bd48ba9..c7d74eadd8 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
@@ -574,14 +574,20 @@ PartitionRestoreGptTable (
PartHdr->PartitionEntryLBA = PEntryLBA;
PartitionSetCrc ((EFI_TABLE_HEADER *) PartHdr);
- Status = BlockIo->WriteBlocks (BlockIo, BlockIo->Media->MediaId, PartHdr->MyLBA, BlockSize, PartHdr);
+ Status = DiskIo->WriteDisk (
+ DiskIo,
+ BlockIo->Media->MediaId,
+ MultU64x32 (PartHdr->MyLBA, BlockIo->Media->BlockSize),
+ BlockSize,
+ PartHdr
+ );
if (EFI_ERROR (Status)) {
goto Done;
}
Ptr = AllocatePool (PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry);
if (Ptr == NULL) {
- DEBUG ((EFI_D_ERROR, " Allocate pool effor\n"));
+ DEBUG ((EFI_D_ERROR, " Allocate pool error\n"));
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}