3 The internal header file includes the common header files, defines
4 internal structure and functions used by PeiVariable module.
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _PEI_VARIABLE_H
18 #define _PEI_VARIABLE_H
21 #include <Ppi/ReadOnlyVariable2.h>
22 #include <Library/DebugLib.h>
23 #include <Library/PeimEntryPoint.h>
24 #include <Library/HobLib.h>
25 #include <Library/PcdLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/PeiServicesTablePointerLib.h>
28 #include <VariableFormat.h>
31 // Define GET_PAD_SIZE to optimize compiler
33 #if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
34 #define GET_PAD_SIZE(a) (0)
36 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
39 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
42 VARIABLE_HEADER
*CurrPtr
;
43 VARIABLE_HEADER
*EndPtr
;
44 VARIABLE_HEADER
*StartPtr
;
45 } VARIABLE_POINTER_TRACK
;
47 #define VARIABLE_INDEX_TABLE_VOLUME 122
49 #define EFI_VARIABLE_INDEX_TABLE_GUID \
50 { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c } }
55 VARIABLE_HEADER
*EndPtr
;
56 VARIABLE_HEADER
*StartPtr
;
57 UINT16 Index
[VARIABLE_INDEX_TABLE_VOLUME
];
58 } VARIABLE_INDEX_TABLE
;
66 PeimInitializeVariableServices (
67 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
68 IN EFI_PEI_SERVICES
**PeiServices
74 TODO: Add function description
78 FfsHeader - TODO: add argument description
79 PeiServices - TODO: add argument description
83 TODO: add return values
91 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI
*This
,
92 IN CONST CHAR16
*VariableName
,
93 IN CONST EFI_GUID
*VariableGuid
,
94 OUT UINT32
*Attributes
,
95 IN OUT UINTN
*DataSize
,
102 TODO: Add function description
106 PeiServices - TODO: add argument description
107 VariableName - TODO: add argument description
108 VendorGuid - TODO: add argument description
109 Attributes - TODO: add argument description
110 DataSize - TODO: add argument description
111 Data - TODO: add argument description
115 TODO: add return values
122 PeiGetNextVariableName (
123 IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI
*This
,
124 IN OUT UINTN
*VariableNameSize
,
125 IN OUT CHAR16
*VariableName
,
126 IN OUT EFI_GUID
*VariableGuid
132 TODO: Add function description
136 PeiServices - TODO: add argument description
137 VariableNameSize - TODO: add argument description
138 VariableName - TODO: add argument description
139 VendorGuid - TODO: add argument description
143 TODO: add return values
149 Get one variable by the index count.
151 @param IndexTable The pointer to variable index table.
152 @param Count The index count of variable in index table.
154 @return The pointer to variable header indexed by count.
159 IN VARIABLE_INDEX_TABLE
*IndexTable
,
164 Record Variable in VariableIndex HOB.
166 Record Variable in VariableIndex HOB and update the length of variable index table.
168 @param IndexTable The pointer to variable index table.
169 @param Variable The pointer to the variable that will be recorded.
175 VariableIndexTableUpdate (
176 IN OUT VARIABLE_INDEX_TABLE
*IndexTable
,
177 IN VARIABLE_HEADER
*Variable
180 #endif // _PEI_VARIABLE_H