Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[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
3dbba770 12**/\r
7ba905c9 13\r
14#ifndef _PEI_VARIABLE_H\r
15#define _PEI_VARIABLE_H\r
16\r
17#include <PiPei.h>\r
18#include <Ppi/ReadOnlyVariable.h>\r
19#include <Ppi/ReadOnlyVariable2.h>\r
20#include <Library/DebugLib.h>\r
21#include <Library/PeimEntryPoint.h>\r
22#include <Library/HobLib.h>\r
23#include <Library/PcdLib.h>\r
24#include <Library/BaseMemoryLib.h>\r
25#include <Library/PeiServicesTablePointerLib.h>\r
3709c4cd 26#include <Guid/VariableFormat.h>\r
7ba905c9 27\r
7ba905c9 28typedef struct {\r
29 VARIABLE_HEADER *CurrPtr;\r
30 VARIABLE_HEADER *EndPtr;\r
31 VARIABLE_HEADER *StartPtr;\r
32} VARIABLE_POINTER_TRACK;\r
33\r
34#define VARIABLE_INDEX_TABLE_VOLUME 122\r
35\r
36#define EFI_VARIABLE_INDEX_TABLE_GUID \\r
37 { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c } }\r
38\r
39typedef struct {\r
40 UINT16 Length;\r
41 UINT16 GoneThrough;\r
42 VARIABLE_HEADER *EndPtr;\r
43 VARIABLE_HEADER *StartPtr;\r
44 UINT16 Index[VARIABLE_INDEX_TABLE_VOLUME];\r
45} VARIABLE_INDEX_TABLE;\r
46\r
7ba905c9 47//\r
48// Functions\r
49//\r
7ba905c9 50\r
51EFI_STATUS\r
52EFIAPI\r
53PeiGetVariable (\r
54 IN EFI_PEI_SERVICES **PeiServices,\r
55 IN CHAR16 *VariableName,\r
56 IN EFI_GUID * VendorGuid,\r
57 OUT UINT32 *Attributes OPTIONAL,\r
58 IN OUT UINTN *DataSize,\r
59 OUT VOID *Data\r
ed66e1bc 60 );\r
7ba905c9 61\r
62EFI_STATUS\r
63EFIAPI\r
64PeiGetVariable2 (\r
65 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
66 IN CONST CHAR16 *VariableName,\r
67 IN CONST EFI_GUID *VariableGuid,\r
68 OUT UINT32 *Attributes,\r
69 IN OUT UINTN *DataSize,\r
70 OUT VOID *Data\r
ed66e1bc 71 ); \r
7ba905c9 72 \r
73EFI_STATUS\r
74EFIAPI\r
75PeiGetNextVariableName2 (\r
76 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
77 IN OUT UINTN *VariableNameSize,\r
78 IN OUT CHAR16 *VariableName,\r
79 IN OUT EFI_GUID *VariableGuid\r
ed66e1bc 80 );\r
7ba905c9 81 \r
82EFI_STATUS\r
83EFIAPI\r
84PeiGetNextVariableName (\r
85 IN EFI_PEI_SERVICES **PeiServices,\r
86 IN OUT UINTN *VariableNameSize,\r
87 IN OUT CHAR16 *VariableName,\r
88 IN OUT EFI_GUID *VendorGuid\r
ed66e1bc 89 );\r
7ba905c9 90\r
91/**\r
92 Get one variable by the index count.\r
93\r
94 @param IndexTable The pointer to variable index table.\r
95 @param Count The index count of variable in index table.\r
96\r
97 @return The pointer to variable header indexed by count.\r
98\r
99**/\r
100VARIABLE_HEADER *\r
101GetVariableByIndex (\r
102 IN VARIABLE_INDEX_TABLE *IndexTable,\r
103 IN UINT32 Count\r
104 );\r
105\r
106/**\r
107 Record Variable in VariableIndex HOB.\r
108\r
109 Record Variable in VariableIndex HOB and update the length of variable index table.\r
110\r
111 @param IndexTable The pointer to variable index table.\r
112 @param Variable The pointer to the variable that will be recorded.\r
113\r
114 @retval VOID\r
115\r
116**/\r
117VOID\r
118VariableIndexTableUpdate (\r
119 IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r
120 IN VARIABLE_HEADER *Variable\r
121 );\r
122\r
123#endif // _PEI_VARIABLE_H\r