+++ /dev/null
-/*++\r
-\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
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- FSVariable.h\r
- \r
-Abstract:\r
-\r
---*/\r
-\r
-#ifndef _FS_VARIABLE_H\r
-#define _FS_VARIABLE_H\r
-\r
-//\r
-// Statements that include other header files\r
-//\r
-#include <PiDxe.h>\r
-\r
-#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
-#include <Library/UefiLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include <Guid/HobList.h>\r
-#include <Guid/FlashMapHob.h>\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
-#include <Protocol/BlockIo.h>\r
-\r
-\r
-#include "EfiFlashMap.h"\r
-#include "VariableStorage.h"\r
-\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
-typedef enum {\r
- Physical,\r
- Virtual\r
-} VARIABLE_POINTER_TYPE;\r
-\r
-typedef enum {\r
- NonVolatile,\r
- Volatile,\r
- MaxType\r
-} VARIABLE_STORAGE_TYPE;\r
-\r
-typedef struct {\r
- VARIABLE_HEADER *CurrPtr;\r
- VARIABLE_HEADER *EndPtr;\r
- VARIABLE_HEADER *StartPtr;\r
- VARIABLE_STORAGE_TYPE Type;\r
-} VARIABLE_POINTER_TRACK;\r
-\r
-#define VARIABLE_MEMBER_OFFSET(Member, StartOffset) \\r
- ( sizeof (VARIABLE_STORE_HEADER) + (StartOffset) + \\r
- (UINTN) ((UINT8 *) &((VARIABLE_HEADER*) 0)->Member - (UINT8 *) &((VARIABLE_HEADER*) 0)->StartId) \\r
- )\r
-\r
-\r
-typedef struct {\r
- EFI_EVENT_NOTIFY GoVirtualChildEvent[MaxType];\r
- VARIABLE_STORAGE *VariableStore[MaxType]; // Instance of VariableStorage\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;\r
- CHAR8 *LangCodes;\r
- CHAR8 *PlatformLang;\r
- CHAR8 Lang[ISO_639_2_ENTRY_SIZE + 1];\r
-} VARIABLE_GLOBAL;\r
-\r
-//\r
-// Functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-VariableServiceInitialize (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- );\r
-\r
-VOID\r
-EFIAPI\r
-VariableClassAddressChangeEvent (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DuetGetVariable (\r
- IN CHAR16 *VariableName,\r
- IN EFI_GUID *VendorGuid,\r
- OUT UINT32 *Attributes OPTIONAL,\r
- IN OUT UINTN *DataSize,\r
- OUT VOID *Data OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GetNextVariableName (\r
- IN OUT UINTN *VariableNameSize,\r
- IN OUT CHAR16 *VariableName,\r
- IN OUT EFI_GUID *VendorGuid\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SetVariable (\r
- IN CHAR16 *VariableName,\r
- IN EFI_GUID *VendorGuid,\r
- IN UINT32 Attributes,\r
- IN UINTN DataSize,\r
- IN VOID *Data\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-QueryVariableInfo (\r
- IN UINT32 Attributes,\r
- OUT UINT64 *MaximumVariableStorageSize,\r
- OUT UINT64 *RemainingVariableStorageSize,\r
- OUT UINT64 *MaximumVariableSize\r
- );\r
-\r
-#endif\r