]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Variable/Pei/Variable.h
Use correct signature to fix the bug that Tiger platform cannot boot to OS.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / Pei / 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 PeiVariable module.\r
5\r
6Copyright (c) 2006 - 2008, Intel Corporation\r
8d3a5c82 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
504214c4 15**/\r
8d3a5c82 16\r
17#ifndef _PEI_VARIABLE_H\r
18#define _PEI_VARIABLE_H\r
19\r
20#include <PiPei.h>\r
21#include <Ppi/ReadOnlyVariable2.h>\r
22#include <Library/DebugLib.h>\r
23#include <Library/PeimEntryPoint.h>\r
24#include <Library/HobLib.h>\r
25#include <Library/PcdLib.h>\r
26#include <Library/BaseMemoryLib.h>\r
27#include <Library/PeiServicesTablePointerLib.h>\r
3cfb790c 28#include <VariableFormat.h>\r
8d3a5c82 29\r
30//\r
31// Define GET_PAD_SIZE to optimize compiler\r
32//\r
33#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))\r
34#define GET_PAD_SIZE(a) (0)\r
35#else\r
36#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))\r
37#endif\r
38\r
9cad030b 39#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))\r
40\r
8d3a5c82 41typedef struct {\r
42 VARIABLE_HEADER *CurrPtr;\r
43 VARIABLE_HEADER *EndPtr;\r
44 VARIABLE_HEADER *StartPtr;\r
45} VARIABLE_POINTER_TRACK;\r
46\r
47#define VARIABLE_INDEX_TABLE_VOLUME 122\r
48\r
49#define EFI_VARIABLE_INDEX_TABLE_GUID \\r
50 { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c } }\r
51\r
52typedef struct {\r
53 UINT16 Length;\r
54 UINT16 GoneThrough;\r
55 VARIABLE_HEADER *EndPtr;\r
56 VARIABLE_HEADER *StartPtr;\r
57 UINT16 Index[VARIABLE_INDEX_TABLE_VOLUME];\r
58} VARIABLE_INDEX_TABLE;\r
59\r
60\r
61//\r
62// Functions\r
63//\r
64EFI_STATUS\r
65EFIAPI\r
66PeimInitializeVariableServices (\r
67 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
68 IN EFI_PEI_SERVICES **PeiServices\r
69 )\r
70/*++\r
71\r
72Routine Description:\r
73\r
74 TODO: Add function description\r
75\r
76Arguments:\r
77\r
78 FfsHeader - TODO: add argument description\r
79 PeiServices - TODO: add argument description\r
80\r
81Returns:\r
82\r
83 TODO: add return values\r
84\r
85--*/\r
86;\r
87\r
88EFI_STATUS\r
89EFIAPI\r
90PeiGetVariable (\r
91 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
92 IN CONST CHAR16 *VariableName,\r
93 IN CONST EFI_GUID *VariableGuid,\r
94 OUT UINT32 *Attributes,\r
95 IN OUT UINTN *DataSize,\r
96 OUT VOID *Data\r
97 )\r
98/*++\r
99\r
100Routine Description:\r
101\r
102 TODO: Add function description\r
103\r
104Arguments:\r
105\r
106 PeiServices - TODO: add argument description\r
107 VariableName - TODO: add argument description\r
108 VendorGuid - TODO: add argument description\r
109 Attributes - TODO: add argument description\r
110 DataSize - TODO: add argument description\r
111 Data - TODO: add argument description\r
112\r
113Returns:\r
114\r
115 TODO: add return values\r
116\r
117--*/\r
118;\r
119\r
120EFI_STATUS\r
121EFIAPI\r
122PeiGetNextVariableName (\r
123 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,\r
124 IN OUT UINTN *VariableNameSize,\r
125 IN OUT CHAR16 *VariableName,\r
126 IN OUT EFI_GUID *VariableGuid\r
127 )\r
128/*++\r
129\r
130Routine Description:\r
131\r
132 TODO: Add function description\r
133\r
134Arguments:\r
135\r
136 PeiServices - TODO: add argument description\r
137 VariableNameSize - TODO: add argument description\r
138 VariableName - TODO: add argument description\r
139 VendorGuid - TODO: add argument description\r
140\r
141Returns:\r
142\r
143 TODO: add return values\r
144\r
145--*/\r
146;\r
147\r
148/**\r
149 Get one variable by the index count.\r
150\r
151 @param IndexTable The pointer to variable index table.\r
152 @param Count The index count of variable in index table.\r
153\r
154 @return The pointer to variable header indexed by count.\r
155\r
156**/\r
157VARIABLE_HEADER *\r
158GetVariableByIndex (\r
159 IN VARIABLE_INDEX_TABLE *IndexTable,\r
160 IN UINT32 Count\r
161 );\r
162\r
163/**\r
164 Record Variable in VariableIndex HOB.\r
165\r
166 Record Variable in VariableIndex HOB and update the length of variable index table.\r
167\r
168 @param IndexTable The pointer to variable index table.\r
169 @param Variable The pointer to the variable that will be recorded.\r
170\r
171 @retval VOID\r
172\r
173**/\r
174VOID\r
175VariableIndexTableUpdate (\r
176 IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r
177 IN VARIABLE_HEADER *Variable\r
178 );\r
179\r
180#endif // _PEI_VARIABLE_H\r