]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
MdeModulePkg Variable: Align TPL level for (Smm)EndOfDxe callback
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / EmuRuntimeDxe / Variable.h
index cc5803dde9e89195c4b83ad71b54e67c95ac6ae9..985f56791909137dd26f8a1c53a631f90e81d468 100644 (file)
@@ -3,8 +3,8 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by EmuVariable module.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\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
@@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PcdLib.h>\r
+#include <Library/HobLib.h>\r
 #include <Guid/VariableFormat.h>\r
 #include <Guid/GlobalVariable.h>\r
 \r
@@ -38,6 +39,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define GET_VARIABLE_NAME_PTR(a)  (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))\r
 \r
+///\r
+/// The size of a 3 character ISO639 language code.\r
+///\r
+#define ISO_639_2_ENTRY_SIZE    3\r
+\r
 typedef enum {\r
   Physical,\r
   Virtual\r
@@ -62,10 +68,10 @@ typedef struct {
   UINTN           NonVolatileLastVariableOffset;\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
+  CHAR8           *PlatformLangCodes;\r
+  CHAR8           *LangCodes;\r
+  CHAR8           *PlatformLang;\r
+  CHAR8           Lang[ISO_639_2_ENTRY_SIZE + 1];\r
 } ESAL_VARIABLE_GLOBAL;\r
 \r
 ///\r
@@ -167,18 +173,23 @@ EmuGetVariable (
 \r
   This code finds the next available variable.\r
 \r
-  @param  VariableNameSize       Size of the variable.\r
+  @param  VariableNameSize       The size of the VariableName buffer. The size must be large enough to fit input\r
+                                 string supplied in VariableName buffer.\r
   @param  VariableName           On input, supplies the last VariableName that was returned by GetNextVariableName().\r
                                  On output, returns the Null-terminated Unicode string of the current variable.\r
   @param  VendorGuid             On input, supplies the last VendorGuid that was returned by GetNextVariableName().\r
-                                 On output, returns the VendorGuid of the current variable.  \r
+                                 On output, returns the VendorGuid of the current variable.\r
   @param  Global                 Pointer to VARIABLE_GLOBAL structure.\r
 \r
-  @retval EFI_SUCCESS            The function completed successfully. \r
+  @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_NOT_FOUND          The next variable was not found.\r
-  @retval EFI_BUFFER_TOO_SMALL   VariableNameSize is too small for the result. \r
+  @retval EFI_BUFFER_TOO_SMALL   The VariableNameSize is too small for the result.\r
                                  VariableNameSize has been updated with the size needed to complete the request.\r
   @retval EFI_INVALID_PARAMETER  VariableNameSize or VariableName or VendorGuid is NULL.\r
+  @retval EFI_INVALID_PARAMETER  The input values of VariableName and VendorGuid are not a name and\r
+                                 GUID of an existing variable.\r
+  @retval EFI_INVALID_PARAMETER  Null-terminator is not found in the first VariableNameSize bytes of\r
+                                 the input VariableName buffer.\r
 \r
 **/\r
 EFI_STATUS\r