3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Tiano PEIM to provide the variable functionality
22 #ifndef _PEI_VARIABLE_H
23 #define _PEI_VARIABLE_H
26 // BugBug: We need relcate the head file.
28 #include <Common/Variable.h>
29 #include <VarMachine.h>
32 // Define GET_PAD_SIZE to optimize compiler
34 #if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
35 #define GET_PAD_SIZE(a) (0)
37 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
40 #define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
42 #define GET_VARIABLE_DATA_PTR(a) \
43 (UINT8 *) ((UINTN) GET_VARIABLE_NAME_PTR (a) + (a)->NameSize + GET_PAD_SIZE ((a)->NameSize))
46 VARIABLE_HEADER
*CurrPtr
;
47 VARIABLE_HEADER
*EndPtr
;
48 VARIABLE_HEADER
*StartPtr
;
49 } VARIABLE_POINTER_TRACK
;
51 #define VARIABLE_INDEX_TABLE_VOLUME 122
53 #define EFI_VARIABLE_INDEX_TABLE_GUID \
54 { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c } }
59 VARIABLE_HEADER
*EndPtr
;
60 VARIABLE_HEADER
*StartPtr
;
61 UINT16 Index
[VARIABLE_INDEX_TABLE_VOLUME
];
62 } VARIABLE_INDEX_TABLE
;
64 extern EFI_GUID gEfiVariableIndexTableGuid
;
71 PeimInitializeVariableServices (
72 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
73 IN EFI_PEI_SERVICES
**PeiServices
79 TODO: Add function description
83 FfsHeader - TODO: add argument description
84 PeiServices - TODO: add argument description
88 TODO: add return values
96 IN EFI_PEI_SERVICES
**PeiServices
,
97 IN CHAR16
*VariableName
,
98 IN EFI_GUID
* VendorGuid
,
99 OUT UINT32
*Attributes OPTIONAL
,
100 IN OUT UINTN
*DataSize
,
107 TODO: Add function description
111 PeiServices - TODO: add argument description
112 VariableName - TODO: add argument description
113 VendorGuid - TODO: add argument description
114 Attributes - TODO: add argument description
115 DataSize - TODO: add argument description
116 Data - TODO: add argument description
120 TODO: add return values
127 PeiGetNextVariableName (
128 IN EFI_PEI_SERVICES
**PeiServices
,
129 IN OUT UINTN
*VariableNameSize
,
130 IN OUT CHAR16
*VariableName
,
131 IN OUT EFI_GUID
*VendorGuid
137 TODO: Add function description
141 PeiServices - TODO: add argument description
142 VariableNameSize - TODO: add argument description
143 VariableName - TODO: add argument description
144 VendorGuid - TODO: add argument description
148 TODO: add return values
154 Get one variable by the index count.
156 @param IndexTable The pointer to variable index table.
157 @param Count The index count of variable in index table.
159 @return The pointer to variable header indexed by count.
164 IN VARIABLE_INDEX_TABLE
*IndexTable
,
169 Record Variable in VariableIndex HOB.
171 Record Variable in VariableIndex HOB and update the length of variable index table.
173 @param IndexTable The pointer to variable index table.
174 @param Variable The pointer to the variable that will be recorded.
180 VariableIndexTableUpdate (
181 IN OUT VARIABLE_INDEX_TABLE
*IndexTable
,
182 IN VARIABLE_HEADER
*Variable
185 #endif // _PEI_VARIABLE_H