]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
MdeModulePkg/SecurityPkg Variable: Calculate enough space for PlatformLang and Lang...
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Variable.h
index b5e6edec930d4246a14d6f8478129c92305e0172..fa78e4414b22bb8275b4e80be69dfe59e35763a9 100644 (file)
@@ -3,7 +3,7 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by Variable modules.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -39,9 +39,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/EventGroup.h>\r
 #include <Guid/VariableFormat.h>\r
 #include <Guid/SystemNvDataGuid.h>\r
+#include <Guid/FaultTolerantWrite.h>\r
 #include <Guid/HardwareErrorVariable.h>\r
 \r
-#define VARIABLE_RECLAIM_THRESHOLD (1024)\r
+#define VARIABLE_ATTRIBUTE_BS_RT        (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)\r
+#define VARIABLE_ATTRIBUTE_NV_BS_RT     (VARIABLE_ATTRIBUTE_BS_RT | EFI_VARIABLE_NON_VOLATILE)\r
+#define VARIABLE_ATTRIBUTE_NV_BS_RT_AT  (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)\r
+\r
+typedef struct {\r
+  CHAR16      *Name;\r
+  UINT32      Attributes;\r
+} GLOBAL_VARIABLE_ENTRY;\r
 \r
 ///\r
 /// The size of a 3 character ISO639 language code.\r
@@ -93,10 +101,12 @@ typedef struct {
 typedef struct {\r
   EFI_GUID    *Guid;\r
   CHAR16      *Name;\r
-  UINT32      Attributes;\r
-  UINTN       DataSize;\r
-  VOID        *Data;\r
-} VARIABLE_CACHE_ENTRY;\r
+//  UINT32      Attributes;\r
+  //\r
+  // Variable size include variable header, name and data.\r
+  //\r
+  UINTN       VariableSize;\r
+} VARIABLE_ENTRY_CONSISTENCY;\r
 \r
 typedef struct {\r
   EFI_GUID    Guid;\r
@@ -125,8 +135,7 @@ FlushHobVariableToFlash (
   VariableBase. Fault Tolerant Write protocol is used for writing.\r
 \r
   @param  VariableBase   Base address of the variable to write.\r
-  @param  Buffer         Point to the data buffer.\r
-  @param  BufferSize     The number of bytes of the data Buffer.\r
+  @param  VariableBuffer Point to the variable data buffer.\r
 \r
   @retval EFI_SUCCESS    The function completed successfully.\r
   @retval EFI_NOT_FOUND  Fail to locate Fault Tolerant Write protocol.\r
@@ -136,8 +145,7 @@ FlushHobVariableToFlash (
 EFI_STATUS\r
 FtwVariableSpace (\r
   IN EFI_PHYSICAL_ADDRESS   VariableBase,\r
-  IN UINT8                  *Buffer,\r
-  IN UINTN                  BufferSize\r
+  IN VARIABLE_STORE_HEADER  *VariableBuffer\r
   );\r
 \r
 \r
@@ -437,6 +445,31 @@ VariableServiceSetVariable (
   IN VOID                    *Data\r
   );\r
 \r
+/**\r
+\r
+  This code returns information about the EFI variables.\r
+\r
+  @param Attributes                     Attributes bitmask to specify the type of variables\r
+                                        on which to return information.\r
+  @param MaximumVariableStorageSize     Pointer to the maximum size of the storage space available\r
+                                        for the EFI variables associated with the attributes specified.\r
+  @param RemainingVariableStorageSize   Pointer to the remaining size of the storage space available\r
+                                        for EFI variables associated with the attributes specified.\r
+  @param MaximumVariableSize            Pointer to the maximum size of an individual EFI variables\r
+                                        associated with the attributes specified.\r
+\r
+  @return EFI_SUCCESS                   Query successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+VariableServiceQueryVariableInfoInternal (\r
+  IN  UINT32                 Attributes,\r
+  OUT UINT64                 *MaximumVariableStorageSize,\r
+  OUT UINT64                 *RemainingVariableStorageSize,\r
+  OUT UINT64                 *MaximumVariableSize\r
+  );\r
+\r
 /**\r
 \r
   This code returns information about the EFI variables.\r