]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg EMU FVB: Add 2 functions to PlatformFvbLib
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 9 Jan 2011 03:51:16 +0000 (03:51 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 9 Jan 2011 03:51:16 +0000 (03:51 +0000)
Add PlatformFvbDataRead and PlatformFvbBlocksErased functions.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11241 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
OvmfPkg/Include/Library/PlatformFvbLib.h
OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.c
OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c

index 314dc987f94d14b4120f1bd306601dfab16d30ea..4d01ec75da777753474d61f33a13787cdb4e6a0f 100644 (file)
@@ -377,6 +377,8 @@ FvbProtocolEraseBlocks (
       EraseSize,\r
       ERASED_UINT8\r
       );\r
+    VA_START (args, This);\r
+    PlatformFvbBlocksErased (This, args);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -557,6 +559,7 @@ FvbProtocolRead (
 \r
   if (*NumBytes > 0) {\r
     CopyMem (Buffer, FvbDataPtr, *NumBytes);\r
+    PlatformFvbDataRead (This, Lba, Offset, *NumBytes, Buffer);\r
   }\r
 \r
   return EFI_SUCCESS;\r
index 03ac2fb5a35a39760f47561d6260e21c108a6d4e..d4d09b2ebd0c274a9b7a2b5f5a957a5ab645da96 100644 (file)
 \r
 /**\r
   This function will be called following a call to the\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL Write function.\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Read function.\r
 \r
-  @param[in] This     EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL instance.\r
+  @param[in] This     The EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
+  @param[in] Lba      The starting logical block index\r
+                      from which to read.\r
+  @param[in] Offset   Offset into the block at which to begin reading.\r
+  @param[in] NumBytes The number of bytes read.\r
+  @param[in] Buffer   Pointer to the buffer that was read, and will be\r
+                      returned to the caller.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbDataRead (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN        EFI_LBA                             Lba,\r
+  IN        UINTN                               Offset,\r
+  IN        UINTN                               NumBytes,\r
+  IN        UINT8                               *Buffer\r
+  );\r
+\r
+\r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Write function.\r
+\r
+  @param[in] This     EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
   @param[in] Lba      The starting logical block index to written to.\r
   @param[in] Offset   Offset into the block at which to begin writing.\r
   @param[in] NumBytes The number of bytes written.\r
@@ -39,5 +63,25 @@ PlatformFvbDataWritten (
   IN        UINT8                                *Buffer\r
   );\r
 \r
+\r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase function.\r
+\r
+  @param This   Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL\r
+                instance.\r
+  @param List   The variable argument list as documented for\r
+                the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase\r
+                function.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbBlocksErased (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN  VA_LIST       List\r
+  );\r
+\r
+\r
 #endif\r
 \r
index e3f153ed37ca4b862451a7dea2b1e7f72f700cdc..9b449a6decb048249859ac5cbc976c23b9947d6e 100644 (file)
 \r
 /**\r
   This function will be called following a call to the\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL Write function.\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Read function.\r
 \r
-  @param[in] This     EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL instance.\r
+  @param[in] This     The EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
+  @param[in] Lba      The starting logical block index\r
+                      from which to read.\r
+  @param[in] Offset   Offset into the block at which to begin reading.\r
+  @param[in] NumBytes The number of bytes read.\r
+  @param[in] Buffer   Pointer to the buffer that was read, and will be\r
+                      returned to the caller.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbDataRead (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN        EFI_LBA                             Lba,\r
+  IN        UINTN                               Offset,\r
+  IN        UINTN                               NumBytes,\r
+  IN        UINT8                               *Buffer\r
+  )\r
+{\r
+}\r
+\r
+\r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Write function.\r
+\r
+  @param[in] This     EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
   @param[in] Lba      The starting logical block index to written to.\r
   @param[in] Offset   Offset into the block at which to begin writing.\r
   @param[in] NumBytes The number of bytes written.\r
@@ -54,3 +80,24 @@ PlatformFvbDataWritten (
 }\r
 \r
 \r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase function.\r
+\r
+  @param This   Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL\r
+                instance.\r
+  @param List   The variable argument list as documented for\r
+                the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase\r
+                function.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbBlocksErased (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN  VA_LIST       List\r
+  )\r
+{\r
+}\r
+\r
+\r
index 5b151605355d7512657717428e9d294037b81b41..ea5da6e0d6aad6c7339204075b98ae1d166f0786 100644 (file)
 #include <Library/PlatformFvbLib.h>\r
 \r
 \r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Read function.\r
+\r
+  @param[in] This     The EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
+  @param[in] Lba      The starting logical block index\r
+                      from which to read.\r
+  @param[in] Offset   Offset into the block at which to begin reading.\r
+  @param[in] NumBytes The number of bytes read.\r
+  @param[in] Buffer   Pointer to the buffer that was read, and will be\r
+                      returned to the caller.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbDataRead (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN        EFI_LBA                             Lba,\r
+  IN        UINTN                               Offset,\r
+  IN        UINTN                               NumBytes,\r
+  IN        UINT8                               *Buffer\r
+  )\r
+{\r
+}\r
+\r
+\r
 /**\r
   This function will be called following a call to the\r
   EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL Write function.\r
@@ -40,3 +66,24 @@ PlatformFvbDataWritten (
 }\r
 \r
 \r
+/**\r
+  This function will be called following a call to the\r
+  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase function.\r
+\r
+  @param This   Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL\r
+                instance.\r
+  @param List   The variable argument list as documented for\r
+                the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase\r
+                function.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformFvbBlocksErased (\r
+  IN CONST  EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,\r
+  IN  VA_LIST       List\r
+  )\r
+{\r
+}\r
+\r
+\r