diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-22 02:52:32 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-22 02:52:32 +0000 |
commit | 96f99e1df863aea8dc8ecadb29e799545c9d1924 (patch) | |
tree | b065a741225db5abbb19d5f262520ca030c4e185 /MdeModulePkg | |
parent | 15a7c2f1fe25128994584bddfb52d4c33d474ef8 (diff) | |
download | edk2-platforms-96f99e1df863aea8dc8ecadb29e799545c9d1924.tar.xz |
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c | 28 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c | 30 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c | 29 |
3 files changed, 43 insertions, 44 deletions
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c index 444bc95d49..9229a8cbe7 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c @@ -97,13 +97,13 @@ PartitionInstallElToritoChildHandles ( break;
}
- Status = BlockIo->ReadBlocks (
- BlockIo,
- Media->MediaId,
- VolDescriptorLba,
- Media->BlockSize,
- VolDescriptor
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ Media->MediaId,
+ VolDescriptorLba,
+ Media->BlockSize,
+ VolDescriptor
+ );
if (EFI_ERROR (Status)) {
Found = Status;
break;
@@ -140,13 +140,13 @@ PartitionInstallElToritoChildHandles ( continue;
}
- Status = BlockIo->ReadBlocks (
- BlockIo,
- Media->MediaId,
- Lba,
- Media->BlockSize,
- Catalog
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ Media->MediaId,
+ Lba,
+ Media->BlockSize,
+ Catalog
+ );
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "EltCheckDevice: error reading catalog %r\n", Status));
continue;
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c index 8cb78abfc1..3f352cc318 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c @@ -217,13 +217,13 @@ PartitionInstallGptChildHandles ( //
// Read the Protective MBR from LBA #0
//
- Status = BlockIo->ReadBlocks (
- BlockIo,
- BlockIo->Media->MediaId,
- 0,
- BlockIo->Media->BlockSize,
- ProtectiveMbr
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ BlockIo->Media->MediaId,
+ 0,
+ BlockIo->Media->BlockSize,
+ ProtectiveMbr
+ );
if (EFI_ERROR (Status)) {
GptValidStatus = Status;
goto Done;
@@ -304,7 +304,7 @@ PartitionInstallGptChildHandles ( );
if (EFI_ERROR (Status)) {
GptValidStatus = Status;
- DEBUG ((EFI_D_ERROR, " Partition Entry ReadBlocks error\n"));
+ DEBUG ((EFI_D_ERROR, " Partition Entry ReadDisk error\n"));
goto Done;
}
@@ -433,13 +433,13 @@ PartitionValidGptTable ( //
// Read the EFI Partition Table Header
//
- Status = BlockIo->ReadBlocks (
- BlockIo,
- BlockIo->Media->MediaId,
- Lba,
- BlockSize,
- PartHdr
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ BlockIo->Media->MediaId,
+ Lba,
+ BlockSize,
+ PartHdr
+ );
if (EFI_ERROR (Status)) {
FreePool (PartHdr);
return FALSE;
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c index 5d544e8b77..cfa43f4fe9 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -132,7 +132,6 @@ PartitionInstallMbrChildHandles ( EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;
EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode;
- Mbr = NULL;
Found = EFI_NOT_FOUND;
Mbr = AllocatePool (BlockIo->Media->BlockSize);
@@ -140,13 +139,13 @@ PartitionInstallMbrChildHandles ( goto Done;
}
- Status = BlockIo->ReadBlocks (
- BlockIo,
- BlockIo->Media->MediaId,
- 0,
- BlockIo->Media->BlockSize,
- Mbr
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ BlockIo->Media->MediaId,
+ 0,
+ BlockIo->Media->BlockSize,
+ Mbr
+ );
if (EFI_ERROR (Status)) {
Found = Status;
goto Done;
@@ -240,13 +239,13 @@ PartitionInstallMbrChildHandles ( do {
- Status = BlockIo->ReadBlocks (
- BlockIo,
- BlockIo->Media->MediaId,
- ExtMbrStartingLba,
- BlockIo->Media->BlockSize,
- Mbr
- );
+ Status = DiskIo->ReadDisk (
+ DiskIo,
+ BlockIo->Media->MediaId,
+ ExtMbrStartingLba,
+ BlockIo->Media->BlockSize,
+ Mbr
+ );
if (EFI_ERROR (Status)) {
Found = Status;
goto Done;
|