Use DiskIo->ReadDisk() API to avoid alignment issue.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8144 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2009-04-22 02:52:32 +00:00
parent 15a7c2f1fe
commit 96f99e1df8
3 changed files with 43 additions and 44 deletions

View File

@ -97,13 +97,13 @@ PartitionInstallElToritoChildHandles (
break; break;
} }
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
Media->MediaId, Media->MediaId,
VolDescriptorLba, VolDescriptorLba,
Media->BlockSize, Media->BlockSize,
VolDescriptor VolDescriptor
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
Found = Status; Found = Status;
break; break;
@ -140,13 +140,13 @@ PartitionInstallElToritoChildHandles (
continue; continue;
} }
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
Media->MediaId, Media->MediaId,
Lba, Lba,
Media->BlockSize, Media->BlockSize,
Catalog Catalog
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "EltCheckDevice: error reading catalog %r\n", Status)); DEBUG ((EFI_D_ERROR, "EltCheckDevice: error reading catalog %r\n", Status));
continue; continue;

View File

@ -217,13 +217,13 @@ PartitionInstallGptChildHandles (
// //
// Read the Protective MBR from LBA #0 // Read the Protective MBR from LBA #0
// //
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
BlockIo->Media->MediaId, BlockIo->Media->MediaId,
0, 0,
BlockIo->Media->BlockSize, BlockIo->Media->BlockSize,
ProtectiveMbr ProtectiveMbr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
GptValidStatus = Status; GptValidStatus = Status;
goto Done; goto Done;
@ -304,7 +304,7 @@ PartitionInstallGptChildHandles (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
GptValidStatus = Status; GptValidStatus = Status;
DEBUG ((EFI_D_ERROR, " Partition Entry ReadBlocks error\n")); DEBUG ((EFI_D_ERROR, " Partition Entry ReadDisk error\n"));
goto Done; goto Done;
} }
@ -433,13 +433,13 @@ PartitionValidGptTable (
// //
// Read the EFI Partition Table Header // Read the EFI Partition Table Header
// //
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
BlockIo->Media->MediaId, BlockIo->Media->MediaId,
Lba, Lba,
BlockSize, BlockSize,
PartHdr PartHdr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreePool (PartHdr); FreePool (PartHdr);
return FALSE; return FALSE;

View File

@ -132,7 +132,6 @@ PartitionInstallMbrChildHandles (
EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;
EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode; EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode;
Mbr = NULL;
Found = EFI_NOT_FOUND; Found = EFI_NOT_FOUND;
Mbr = AllocatePool (BlockIo->Media->BlockSize); Mbr = AllocatePool (BlockIo->Media->BlockSize);
@ -140,13 +139,13 @@ PartitionInstallMbrChildHandles (
goto Done; goto Done;
} }
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
BlockIo->Media->MediaId, BlockIo->Media->MediaId,
0, 0,
BlockIo->Media->BlockSize, BlockIo->Media->BlockSize,
Mbr Mbr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
Found = Status; Found = Status;
goto Done; goto Done;
@ -240,13 +239,13 @@ PartitionInstallMbrChildHandles (
do { do {
Status = BlockIo->ReadBlocks ( Status = DiskIo->ReadDisk (
BlockIo, DiskIo,
BlockIo->Media->MediaId, BlockIo->Media->MediaId,
ExtMbrStartingLba, ExtMbrStartingLba,
BlockIo->Media->BlockSize, BlockIo->Media->BlockSize,
Mbr Mbr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
Found = Status; Found = Status;
goto Done; goto Done;