]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/VariablePei/Variable.h
Modify all file header to follow doxygen format
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / VariablePei / Variable.h
CommitLineData
3dbba770 1/** @file\r
7ba905c9 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 Tiano PEIM to provide the variable functionality\r
19\r
3dbba770 20**/\r
7ba905c9 21\r
22#ifndef _PEI_VARIABLE_H\r
23#define _PEI_VARIABLE_H\r
24\r
25#include <PiPei.h>\r
26#include <Ppi/ReadOnlyVariable.h>\r
27#include <Ppi/ReadOnlyVariable2.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/PeimEntryPoint.h>\r
30#include <Library/HobLib.h>\r
31#include <Library/PcdLib.h>\r
32#include <Library/BaseMemoryLib.h>\r
33#include <Library/PeiServicesTablePointerLib.h>\r
34#include <VariableFormat.h>\r
35\r
36//\r
37// Define GET_PAD_SIZE to optimize compiler\r
38//\r
39#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))\r
40#define GET_PAD_SIZE(a) (0)\r
41#else\r
42#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))\r
43#endif\r
44\r
9cad030b 45#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))\r
46\r
7ba905c9 47typedef struct {\r
48 VARIABLE_HEADER *CurrPtr;\r
49 VARIABLE_HEADER *EndPtr;\r
50 VARIABLE_HEADER *StartPtr;\r
51} VARIABLE_POINTER_TRACK;\r
52\r
53#define VARIABLE_INDEX_TABLE_VOLUME 122\r
54\r
55#define EFI_VARIABLE_INDEX_TABLE_GUID \\r
56 { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c } }\r
57\r
58typedef struct {\r
59 UINT16 Length;\r
60 UINT16 GoneThrough;\r
61 VARIABLE_HEADER *EndPtr;\r
62 VARIABLE_HEADER *StartPtr;\r
63 UINT16 Index[VARIABLE_INDEX_TABLE_VOLUME];\r
64} VARIABLE_INDEX_TABLE;\r
65\r
66\r
67//\r
68// Functions\r
69//\r
70EFI_STATUS\r
71EFIAPI\r
72PeimInitializeVariableServices (\r
73 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
74 IN EFI_PEI_SERVICES **PeiServices\r
75 )\r
76/*++\r
77\r
78Routine Description:\r
79\r
80 TODO: Add function description\r
81\r
82Arguments:\r
83\r
84 FfsHeader - TODO: add argument description\r
85 PeiServices - TODO: add argument description\r
86\r
87Returns:\r
88\r
89 TODO: add return values\r
90\r
91--*/\r
92;\r
93\r
94EFI_STATUS\r
95EFIAPI\r
96PeiGetVariable (\r
97 IN EFI_PEI_SERVICES **PeiServices,\r
98 IN CHAR16 *VariableName,\r
99 IN EFI_GUID * VendorGuid,\r
100 OUT UINT32 *Attributes OPTIONAL,\r
101 IN OUT UINTN *DataSize,\r
102 OUT VOID *Data\r
103 )\r
104/*++\r
105\r
106Routine Description:\r
107\r
108 TODO: Add function description\r
109\r
110Arguments:\r
111\r
112 PeiServices - TODO: add argument description\r
113 VariableName - TODO: add argument description\r
114 VendorGuid - TODO: add argument description\r
115 Attributes - TODO: add argument description\r
116 DataSize - TODO: add argument description\r
117 Data - TODO: add argument description\r
118\r
119Returns:\r
120\r
121 TODO: add return values\r
122\r
123--*/\r
124;\r
125\r
126EFI_STATUS\r
127EFIAPI\r
128PeiGetVariable2 (\r
129 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
130 IN CONST CHAR16 *VariableName,\r
131 IN CONST EFI_GUID *VariableGuid,\r
132 OUT UINT32 *Attributes,\r
133 IN OUT UINTN *DataSize,\r
134 OUT VOID *Data\r
135 )\r
136/*++\r
137\r
138Routine Description:\r
139\r
140 Provide the read variable functionality of the variable services.\r
141\r
142Arguments:\r
143\r
144 PeiServices - General purpose services available to every PEIM.\r
145\r
146 VariableName - The variable name\r
147\r
148 VendorGuid - The vendor's GUID\r
149\r
150 Attributes - Pointer to the attribute\r
151\r
152 DataSize - Size of data\r
153\r
154 Data - Pointer to data\r
155\r
156Returns:\r
157\r
158 EFI_SUCCESS - The interface could be successfully installed\r
159\r
160 EFI_NOT_FOUND - The variable could not be discovered\r
161\r
162 EFI_BUFFER_TOO_SMALL - The caller buffer is not large enough\r
163\r
164--*/\r
165; \r
166 \r
167EFI_STATUS\r
168EFIAPI\r
169PeiGetNextVariableName2 (\r
170 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
171 IN OUT UINTN *VariableNameSize,\r
172 IN OUT CHAR16 *VariableName,\r
173 IN OUT EFI_GUID *VariableGuid\r
174 )\r
175/*++\r
176\r
177Routine Description:\r
178\r
179 Provide the get next variable functionality of the variable services.\r
180\r
181Arguments:\r
182\r
183 PeiServices - General purpose services available to every PEIM.\r
184 VariabvleNameSize - The variable name's size.\r
185 VariableName - A pointer to the variable's name.\r
186 VariableGuid - A pointer to the EFI_GUID structure.\r
187\r
188 VariableNameSize - Size of the variable name\r
189\r
190 VariableName - The variable name\r
191\r
192 VendorGuid - The vendor's GUID\r
193\r
194Returns:\r
195\r
196 EFI_SUCCESS - The interface could be successfully installed\r
197\r
198 EFI_NOT_FOUND - The variable could not be discovered\r
199\r
200--*/\r
201;\r
202 \r
203EFI_STATUS\r
204EFIAPI\r
205PeiGetNextVariableName (\r
206 IN EFI_PEI_SERVICES **PeiServices,\r
207 IN OUT UINTN *VariableNameSize,\r
208 IN OUT CHAR16 *VariableName,\r
209 IN OUT EFI_GUID *VendorGuid\r
210 )\r
211/*++\r
212\r
213Routine Description:\r
214\r
215 TODO: Add function description\r
216\r
217Arguments:\r
218\r
219 PeiServices - TODO: add argument description\r
220 VariableNameSize - TODO: add argument description\r
221 VariableName - TODO: add argument description\r
222 VendorGuid - TODO: add argument description\r
223\r
224Returns:\r
225\r
226 TODO: add return values\r
227\r
228--*/\r
229;\r
230\r
231/**\r
232 Get one variable by the index count.\r
233\r
234 @param IndexTable The pointer to variable index table.\r
235 @param Count The index count of variable in index table.\r
236\r
237 @return The pointer to variable header indexed by count.\r
238\r
239**/\r
240VARIABLE_HEADER *\r
241GetVariableByIndex (\r
242 IN VARIABLE_INDEX_TABLE *IndexTable,\r
243 IN UINT32 Count\r
244 );\r
245\r
246/**\r
247 Record Variable in VariableIndex HOB.\r
248\r
249 Record Variable in VariableIndex HOB and update the length of variable index table.\r
250\r
251 @param IndexTable The pointer to variable index table.\r
252 @param Variable The pointer to the variable that will be recorded.\r
253\r
254 @retval VOID\r
255\r
256**/\r
257VOID\r
258VariableIndexTableUpdate (\r
259 IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r
260 IN VARIABLE_HEADER *Variable\r
261 );\r
262\r
263#endif // _PEI_VARIABLE_H\r