]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
Use DiskIo->ReadDisk() API to avoid alignment issue.
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Gpt.c
index cdace18f481a1aad3b960266b397cd27cc65765a..3f352cc318ee57e03124f8ee95baf45579ff56a3 100644 (file)
@@ -202,7 +202,7 @@ PartitionInstallGptChildHandles (
   LastBlock     = BlockIo->Media->LastBlock;\r
 \r
   DEBUG ((EFI_D_INFO, " BlockSize : %d \n", BlockSize));\r
-  DEBUG ((EFI_D_INFO, " LastBlock : %x \n", LastBlock));\r
+  DEBUG ((EFI_D_INFO, " LastBlock : %lx \n", LastBlock));\r
 \r
   GptValidStatus = EFI_NOT_FOUND;\r
 \r
@@ -217,13 +217,13 @@ PartitionInstallGptChildHandles (
   //\r
   // Read the Protective MBR from LBA #0\r
   //\r
-  Status = BlockIo->ReadBlocks (\r
-                      BlockIo,\r
-                      BlockIo->Media->MediaId,\r
-                      0,\r
-                      BlockIo->Media->BlockSize,\r
-                      ProtectiveMbr\r
-                      );\r
+  Status = DiskIo->ReadDisk (\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     0,\r
+                     BlockIo->Media->BlockSize,\r
+                     ProtectiveMbr\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     GptValidStatus = Status;\r
     goto Done;\r
@@ -304,7 +304,7 @@ PartitionInstallGptChildHandles (
                     );\r
   if (EFI_ERROR (Status)) {\r
     GptValidStatus = Status;\r
-    DEBUG ((EFI_D_ERROR, " Partition Entry ReadBlocks error\n"));\r
+    DEBUG ((EFI_D_ERROR, " Partition Entry ReadDisk error\n"));\r
     goto Done;\r
   }\r
 \r
@@ -433,13 +433,13 @@ PartitionValidGptTable (
   //\r
   // Read the EFI Partition Table Header\r
   //\r
-  Status = BlockIo->ReadBlocks (\r
-                      BlockIo,\r
-                      BlockIo->Media->MediaId,\r
-                      Lba,\r
-                      BlockSize,\r
-                      PartHdr\r
-                      );\r
+  Status = DiskIo->ReadDisk (\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     Lba,\r
+                     BlockSize,\r
+                     PartHdr\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     FreePool (PartHdr);\r
     return FALSE;\r