]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Variable.h
CommitLineData
504214c4 1/** @file\r
8d3a5c82 2\r
504214c4
LG
3 The internal header file includes the common header files, defines\r
4 internal structure and functions used by RuntimeVariable module.\r
5\r
e5eed7d3
HT
6Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
7This program and the accompanying materials\r
8d3a5c82 8are licensed and made available under the terms and conditions of the BSD License\r
9which accompanies this distribution. The full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
504214c4 15**/\r
8d3a5c82 16\r
7c80e839 17#ifndef _VARIABLE_H_\r
18#define _VARIABLE_H_\r
8d3a5c82 19\r
39099938 20#include <PiDxe.h>\r
8d3a5c82 21#include <Protocol/VariableWrite.h>\r
88a5561c 22#include <Protocol/FaultTolerantWrite.h>\r
8d3a5c82 23#include <Protocol/FirmwareVolumeBlock.h>\r
24#include <Protocol/Variable.h>\r
25#include <Library/PcdLib.h>\r
26#include <Library/UefiDriverEntryPoint.h>\r
27#include <Library/DxeServicesTableLib.h>\r
28#include <Library/UefiRuntimeLib.h>\r
29#include <Library/DebugLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
8d3a5c82 31#include <Library/UefiBootServicesTableLib.h>\r
32#include <Library/UefiLib.h>\r
33#include <Library/BaseLib.h>\r
4cf894eb 34#include <Library/SynchronizationLib.h>\r
8d3a5c82 35#include <Library/MemoryAllocationLib.h>\r
052ad7e1 36#include <Guid/GlobalVariable.h>\r
01a5c994 37#include <Guid/EventGroup.h>\r
3709c4cd 38#include <Guid/VariableFormat.h>\r
8d3a5c82 39\r
40#define VARIABLE_RECLAIM_THRESHOLD (1024)\r
41\r
8d3a5c82 42typedef struct {\r
43 VARIABLE_HEADER *CurrPtr;\r
44 VARIABLE_HEADER *EndPtr;\r
45 VARIABLE_HEADER *StartPtr;\r
46 BOOLEAN Volatile;\r
47} VARIABLE_POINTER_TRACK;\r
48\r
49typedef struct {\r
50 EFI_PHYSICAL_ADDRESS VolatileVariableBase;\r
51 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;\r
52 EFI_LOCK VariableServicesLock;\r
fdb7765f 53 UINT32 ReentrantState;\r
8d3a5c82 54} VARIABLE_GLOBAL;\r
55\r
56typedef struct {\r
052ad7e1 57 VARIABLE_GLOBAL VariableGlobal;\r
8d3a5c82 58 UINTN VolatileLastVariableOffset;\r
59 UINTN NonVolatileLastVariableOffset;\r
2fcdca1d 60 UINTN CommonVariableTotalSize;\r
61 UINTN HwErrVariableTotalSize;\r
72399dae 62 CHAR8 PlatformLangCodes[256]; //Pre-allocate 256 bytes space to accommodate the PlatformlangCodes.\r
63 CHAR8 LangCodes[256]; //Pre-allocate 256 bytes space to accommodate the langCodes.\r
64 CHAR8 PlatformLang[8]; //Pre-allocate 8 bytes space to accommodate the Platformlang variable.\r
65 CHAR8 Lang[4]; //Pre-allocate 4 bytes space to accommodate the lang variable.\r
8a9e0b72 66 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbInstance;\r
052ad7e1
A
67} VARIABLE_MODULE_GLOBAL;\r
68\r
69typedef struct {\r
70 EFI_GUID *Guid;\r
71 CHAR16 *Name;\r
72 UINT32 Attributes;\r
73 UINTN DataSize;\r
74 VOID *Data;\r
75} VARIABLE_CACHE_ENTRY;\r
8d3a5c82 76\r
c24b392c 77/**\r
78 Writes a buffer to variable storage space, in the working block.\r
79\r
80 This function writes a buffer to variable storage space into firmware\r
81 volume block device. The destination is specified by parameter\r
82 VariableBase. Fault Tolerant Write protocol is used for writing.\r
83\r
84 @param VariableBase Base address of variable to write\r
85 @param Buffer Point to the data buffer\r
86 @param BufferSize The number of bytes of the data Buffer\r
87\r
88 @retval EFI_SUCCESS The function completed successfully\r
89 @retval EFI_NOT_FOUND Fail to locate Fault Tolerant Write protocol\r
90 @retval EFI_ABORTED The function could not complete successfully\r
91\r
92**/\r
93EFI_STATUS\r
94FtwVariableSpace (\r
95 IN EFI_PHYSICAL_ADDRESS VariableBase,\r
96 IN UINT8 *Buffer,\r
97 IN UINTN BufferSize\r
98 );\r
99\r
100\r
8d3a5c82 101#endif\r