\r
#include <Guid/HobList.h>\r
#include <Guid/FlashMapHob.h>\r
-\r
+#include <Guid/VariableFormat.h>\r
+#include <Guid/GlobalVariable.h>\r
#include <Protocol/Variable.h>\r
#include <Protocol/VariableWrite.h>\r
#include <Protocol/SimpleFileSystem.h>\r
\r
\r
#include "EfiFlashMap.h"\r
-#include "VariableFormat.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
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[256]; //Pre-allocate 256 bytes space to accommodate the PlatformlangCodes.\r
+ CHAR8 LangCodes[256]; //Pre-allocate 256 bytes space to accommodate the langCodes.\r
+ CHAR8 PlatformLang[8]; //Pre-allocate 8 bytes space to accommodate the Platformlang variable.\r
+ CHAR8 Lang[4]; //Pre-allocate 4 bytes space to accommodate the lang variable.\r
} VARIABLE_GLOBAL;\r
\r
//\r
\r
EFI_STATUS\r
EFIAPI\r
-GetVariable (\r
+DuetGetVariable (\r
IN CHAR16 *VariableName,\r
IN EFI_GUID *VendorGuid,\r
OUT UINT32 *Attributes OPTIONAL,\r