]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
GenFds: hide unnecessary warning information.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Variable.h
... / ...
CommitLineData
1/** @file\r
2\r
3 The internal header file includes the common header files, defines\r
4 internal structure and functions used by RuntimeVariable module.\r
5\r
6Copyright (c) 2006 - 2008, Intel Corporation\r
7All rights reserved. This program and the accompanying materials\r
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
15**/\r
16\r
17#ifndef _VARIABLE_H_\r
18#define _VARIABLE_H_\r
19\r
20#include <PiDxe.h>\r
21#include <Protocol/VariableWrite.h>\r
22#include <Protocol/FaultTolerantWrite.h>\r
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
31#include <Library/FvbServiceLib.h>\r
32#include <Library/UefiBootServicesTableLib.h>\r
33#include <Library/UefiLib.h>\r
34#include <Library/BaseLib.h>\r
35#include <Library/SynchronizationLib.h>\r
36#include <Library/MemoryAllocationLib.h>\r
37#include <Guid/GlobalVariable.h>\r
38#include <Guid/EventGroup.h>\r
39#include <Guid/VariableFormat.h>\r
40\r
41#define VARIABLE_RECLAIM_THRESHOLD (1024)\r
42\r
43typedef struct {\r
44 VARIABLE_HEADER *CurrPtr;\r
45 VARIABLE_HEADER *EndPtr;\r
46 VARIABLE_HEADER *StartPtr;\r
47 BOOLEAN Volatile;\r
48} VARIABLE_POINTER_TRACK;\r
49\r
50typedef struct {\r
51 EFI_PHYSICAL_ADDRESS VolatileVariableBase;\r
52 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;\r
53 EFI_LOCK VariableServicesLock;\r
54 UINT32 ReentrantState;\r
55} VARIABLE_GLOBAL;\r
56\r
57typedef struct {\r
58 VARIABLE_GLOBAL VariableGlobal;\r
59 UINTN VolatileLastVariableOffset;\r
60 UINTN NonVolatileLastVariableOffset;\r
61 UINT32 FvbInstance;\r
62} VARIABLE_MODULE_GLOBAL;\r
63\r
64typedef struct {\r
65 EFI_GUID *Guid;\r
66 CHAR16 *Name;\r
67 UINT32 Attributes;\r
68 UINTN DataSize;\r
69 VOID *Data;\r
70} VARIABLE_CACHE_ENTRY;\r
71\r
72/**\r
73 Writes a buffer to variable storage space, in the working block.\r
74\r
75 This function writes a buffer to variable storage space into firmware\r
76 volume block device. The destination is specified by parameter\r
77 VariableBase. Fault Tolerant Write protocol is used for writing.\r
78\r
79 @param VariableBase Base address of variable to write\r
80 @param Buffer Point to the data buffer\r
81 @param BufferSize The number of bytes of the data Buffer\r
82\r
83 @retval EFI_SUCCESS The function completed successfully\r
84 @retval EFI_NOT_FOUND Fail to locate Fault Tolerant Write protocol\r
85 @retval EFI_ABORTED The function could not complete successfully\r
86\r
87**/\r
88EFI_STATUS\r
89FtwVariableSpace (\r
90 IN EFI_PHYSICAL_ADDRESS VariableBase,\r
91 IN UINT8 *Buffer,\r
92 IN UINTN BufferSize\r
93 );\r
94\r
95\r
96#endif\r