]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/FatPei/FatLiteLib.c
FatPkg: Add RecoveryBlockIo2Ppi support
[mirror_edk2.git] / FatPkg / FatPei / FatLiteLib.c
index 06f031defe6924ff6870747699b258c8a6505a5f..109789a54baa0e412e52913256dc8c92fb4c0d82 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   General purpose supporting routines for FAT recovery PEIM\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
@@ -87,7 +87,17 @@ FatReadBlock (
     // Status = BlockDev->ReadFunc\r
     //  (PrivateData->PeiServices, BlockDev->PhysicalDevNo, Lba, BufferSize, Buffer);\r
     //\r
-    Status = BlockDev->BlockIo->ReadBlocks (\r
+    if (BlockDev->BlockIo2 != NULL) {\r
+      Status = BlockDev->BlockIo2->ReadBlocks (\r
+                                    (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
+                                    BlockDev->BlockIo2,\r
+                                    BlockDev->PhysicalDevNo,\r
+                                    Lba,\r
+                                    BufferSize,\r
+                                    Buffer\r
+                                    );\r
+    } else {\r
+      Status = BlockDev->BlockIo->ReadBlocks (\r
                                   (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
                                   BlockDev->BlockIo,\r
                                   BlockDev->PhysicalDevNo,\r
@@ -95,6 +105,7 @@ FatReadBlock (
                                   BufferSize,\r
                                   Buffer\r
                                   );\r
+    }\r
 \r
   } else {\r
     Status = FatReadDisk (\r