]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
1. The original code has a bug on calculate the size of SCRATCH_SIZE. It should be...
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Variable.h
index c508d8bade0d625e6814f03379835969775608a3..85e7f70ed511e06c5ef00a44b69fdcf0a47f5a94 100644 (file)
@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <PiDxe.h>\r
 #include <Protocol/VariableWrite.h>\r
-#include <Protocol/FaultTolerantWriteLite.h>\r
+#include <Protocol/FaultTolerantWrite.h>\r
 #include <Protocol/FirmwareVolumeBlock.h>\r
 #include <Protocol/Variable.h>\r
 #include <Library/PcdLib.h>\r
@@ -28,16 +28,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
-#include <Library/FvbServiceLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/SynchronizationLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Guid/VariableInfo.h>\r
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/EventGroup.h>\r
-#include <VariableFormat.h>\r
+#include <Guid/VariableFormat.h>\r
 \r
 #define VARIABLE_RECLAIM_THRESHOLD (1024)\r
 \r
@@ -59,7 +57,9 @@ typedef struct {
   VARIABLE_GLOBAL VariableGlobal;\r
   UINTN           VolatileLastVariableOffset;\r
   UINTN           NonVolatileLastVariableOffset;\r
-  UINT32          FvbInstance;\r
+  UINTN           CommonVariableTotalSize;\r
+  UINTN           HwErrVariableTotalSize;\r
+  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbInstance;\r
 } VARIABLE_MODULE_GLOBAL;\r
 \r
 typedef struct {\r
@@ -70,4 +70,28 @@ typedef struct {
   VOID        *Data;\r
 } VARIABLE_CACHE_ENTRY;\r
 \r
+/**\r
+  Writes a buffer to variable storage space, in the working block.\r
+\r
+  This function writes a buffer to variable storage space into firmware\r
+  volume block device. The destination is specified by parameter\r
+  VariableBase. Fault Tolerant Write protocol is used for writing.\r
+\r
+  @param  VariableBase   Base address of variable to write\r
+  @param  Buffer         Point to the data buffer\r
+  @param  BufferSize     The number of bytes of the data Buffer\r
+\r
+  @retval EFI_SUCCESS    The function completed successfully\r
+  @retval EFI_NOT_FOUND  Fail to locate Fault Tolerant Write protocol\r
+  @retval EFI_ABORTED    The function could not complete successfully\r
+\r
+**/\r
+EFI_STATUS\r
+FtwVariableSpace (\r
+  IN EFI_PHYSICAL_ADDRESS   VariableBase,\r
+  IN UINT8                  *Buffer,\r
+  IN UINTN                  BufferSize\r
+  );\r
+\r
+\r
 #endif\r