]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/FSVariable/FSVariable.h
DuetPkg FSVariable: Add missing change in e286e118bafa
[mirror_edk2.git] / DuetPkg / FSVariable / FSVariable.h
index 5ecba32c4fa8b1a7dd974f1732f6b119fd8e0660..cb37c29cc2a5819c5cd16010f7f8ad44bb5c2d37 100644 (file)
@@ -1,7 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Caution: This file is used for Duet platform only, do not use them in real platform.\r
+All variable code, variable metadata, and variable data used by Duet platform are on \r
+disk. They can be changed by user. BIOS is not able to protoect those.\r
+Duet trusts all meta data from disk. If variable code, variable metadata and variable\r
+data is modified in inproper way, the behavior is undefined.\r
+\r
+Copyright (c) 2006 - 2017, 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
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -28,6 +34,7 @@ Abstract:
 #include <Library/BaseLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -39,7 +46,7 @@ Abstract:
 #include <Guid/HobList.h>\r
 #include <Guid/FlashMapHob.h>\r
 #include <Guid/VariableFormat.h>\r
-\r
+#include <Guid/GlobalVariable.h>\r
 #include <Protocol/Variable.h>\r
 #include <Protocol/VariableWrite.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
@@ -49,9 +56,13 @@ Abstract:
 #include "EfiFlashMap.h"\r
 #include "VariableStorage.h"\r
 \r
-#define VOLATILE_VARIABLE_STORE_SIZE  (64 * 1024)\r
-#define VARIABLE_SCRATCH_SIZE         (4 * 1024)\r
+#define VOLATILE_VARIABLE_STORE_SIZE  FixedPcdGet32(PcdVariableStoreSize)\r
+#define VARIABLE_SCRATCH_SIZE         MAX(FixedPcdGet32(PcdMaxVariableSize), FixedPcdGet32(PcdMaxHardwareErrorVariableSize))\r
 #define VARIABLE_RECLAIM_THRESHOLD    (1024)\r
+///\r
+/// The size of a 3 character ISO639 language code.\r
+///\r
+#define ISO_639_2_ENTRY_SIZE    3\r
 \r
 #define GET_VARIABLE_NAME_PTR(a)  (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))\r
 \r
@@ -85,6 +96,12 @@ typedef struct {
   VOID               *VariableBase[MaxType];        // Start address of variable storage\r
   UINTN              LastVariableOffset[MaxType];   // The position to write new variable to (index from VariableBase)\r
   VOID               *Scratch;                      // Buffer used during reclaim\r
+  UINTN              CommonVariableTotalSize;\r
+  UINTN              HwErrVariableTotalSize;\r
+  CHAR8              *PlatformLangCodes;\r
+  CHAR8              *LangCodes;\r
+  CHAR8              *PlatformLang;\r
+  CHAR8              Lang[ISO_639_2_ENTRY_SIZE + 1];\r
 } VARIABLE_GLOBAL;\r
 \r
 //\r
@@ -112,7 +129,7 @@ DuetGetVariable (
   IN      EFI_GUID          *VendorGuid,\r
   OUT     UINT32            *Attributes OPTIONAL,\r
   IN OUT  UINTN             *DataSize,\r
-  OUT     VOID              *Data\r
+  OUT     VOID              *Data OPTIONAL\r
   );\r
 \r
 EFI_STATUS\r
@@ -133,7 +150,6 @@ SetVariable (
   IN VOID                    *Data\r
   );\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
 EFI_STATUS\r
 EFIAPI\r
 QueryVariableInfo (\r
@@ -142,6 +158,5 @@ QueryVariableInfo (
   OUT UINT64                 *RemainingVariableStorageSize,\r
   OUT UINT64                 *MaximumVariableSize\r
   );\r
-#endif // EFI_SPECIFICATION_VERSION >= 0x00020000\r
 \r
 #endif\r