]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
remove some comments introduced by tools.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / EmuRuntimeDxe / Variable.h
CommitLineData
8d3a5c82 1/*++\r
2\r
3Copyright (c) 2006 - 2007, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 Variable.h\r
15\r
16Abstract:\r
17\r
18--*/\r
19\r
20#ifndef _VARIABLE_H\r
21#define _VARIABLE_H\r
22\r
23//\r
24// Statements that include other header files\r
25//\r
ed7748fe 26\r
8d3a5c82 27#include <PiDxe.h>\r
ed7748fe 28\r
8d3a5c82 29#include <Protocol/VariableWrite.h>\r
30#include <Protocol/Variable.h>\r
ed7748fe 31\r
8d3a5c82 32#include <Library/BaseMemoryLib.h>\r
33#include <Library/MemoryAllocationLib.h>\r
34#include <Library/DebugLib.h>\r
35#include <Library/UefiRuntimeLib.h>\r
36#include <Library/UefiDriverEntryPoint.h>\r
37#include <Library/UefiBootServicesTableLib.h>\r
38#include <Library/UefiLib.h>\r
39#include <Library/BaseLib.h>\r
40\r
41//\r
42// BugBug: We need relcate the head file.\r
43//\r
44#include <Common/Variable.h>\r
45\r
46#define VARIABLE_STORE_SIZE (64 * 1024)\r
47#define SCRATCH_SIZE (4 * 1024)\r
48\r
49//\r
50// Define GET_PAD_SIZE to optimize compiler\r
51//\r
52#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))\r
53#define GET_PAD_SIZE(a) (0)\r
54#else\r
55#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))\r
56#endif\r
57\r
58#define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))\r
59\r
60typedef enum {\r
61 Physical,\r
62 Virtual\r
63} VARIABLE_POINTER_TYPE;\r
64\r
65typedef struct {\r
66 VARIABLE_HEADER *CurrPtr;\r
67 VARIABLE_HEADER *EndPtr;\r
68 VARIABLE_HEADER *StartPtr;\r
69 BOOLEAN Volatile;\r
70} VARIABLE_POINTER_TRACK;\r
71\r
72typedef struct {\r
73 EFI_PHYSICAL_ADDRESS VolatileVariableBase;\r
74 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;\r
75 EFI_LOCK VariableServicesLock;\r
76} VARIABLE_GLOBAL;\r
77\r
78typedef struct {\r
79 VARIABLE_GLOBAL VariableGlobal[2];\r
80 UINTN VolatileLastVariableOffset;\r
81 UINTN NonVolatileLastVariableOffset;\r
82 UINT32 FvbInstance;\r
83} ESAL_VARIABLE_GLOBAL;\r
84\r
85extern ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;\r
86\r
87//\r
88// Functions\r
89//\r
90EFI_STATUS\r
91EFIAPI\r
92VariableCommonInitialize (\r
93 IN EFI_HANDLE ImageHandle,\r
94 IN EFI_SYSTEM_TABLE *SystemTable\r
95 )\r
96;\r
97\r
98EFI_STATUS\r
99EFIAPI\r
100VariableServiceInitialize (\r
101 IN EFI_HANDLE ImageHandle,\r
102 IN EFI_SYSTEM_TABLE *SystemTable\r
103 )\r
104;\r
105\r
106VOID\r
107EFIAPI\r
108VariableClassAddressChangeEvent (\r
109 IN EFI_EVENT Event,\r
110 IN VOID *Context\r
111 )\r
112;\r
113\r
114EFI_STATUS\r
115EFIAPI\r
116GetVariable (\r
117 IN CHAR16 *VariableName,\r
118 IN EFI_GUID * VendorGuid,\r
119 OUT UINT32 *Attributes OPTIONAL,\r
120 IN OUT UINTN *DataSize,\r
121 OUT VOID *Data,\r
122 IN VARIABLE_GLOBAL * Global,\r
123 IN UINT32 Instance\r
124 )\r
125;\r
126\r
127EFI_STATUS\r
128EFIAPI\r
129GetNextVariableName (\r
130 IN OUT UINTN *VariableNameSize,\r
131 IN OUT CHAR16 *VariableName,\r
132 IN OUT EFI_GUID *VendorGuid,\r
133 IN VARIABLE_GLOBAL *Global,\r
134 IN UINT32 Instance\r
135 )\r
136;\r
137\r
138EFI_STATUS\r
139EFIAPI\r
140SetVariable (\r
141 IN CHAR16 *VariableName,\r
142 IN EFI_GUID *VendorGuid,\r
143 IN UINT32 Attributes,\r
144 IN UINTN DataSize,\r
145 IN VOID *Data,\r
146 IN VARIABLE_GLOBAL *Global,\r
147 IN UINTN *VolatileOffset,\r
148 IN UINTN *NonVolatileOffset,\r
149 IN UINT32 Instance\r
150 )\r
151;\r
152\r
153EFI_STATUS\r
154EFIAPI\r
155QueryVariableInfo (\r
156 IN UINT32 Attributes,\r
157 OUT UINT64 *MaximumVariableStorageSize,\r
158 OUT UINT64 *RemainingVariableStorageSize,\r
159 OUT UINT64 *MaximumVariableSize,\r
160 IN VARIABLE_GLOBAL *Global,\r
161 IN UINT32 Instance\r
162 )\r
163;\r
164\r
165#endif\r