2 Variable worker functions.
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 // The package level header files this module uses
20 // The protocols, PPI and GUID defintions for this module
22 #include <Ppi/ReadOnlyVariable.h>
24 // The Library classes this module consumes
26 #include <Library/DebugLib.h>
27 #include <Library/PeimEntryPoint.h>
28 #include <Library/HobLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/BaseMemoryLib.h>
36 Get one variable by the index count.
38 @param IndexTable The pointer to variable index table.
39 @param Count The index count of variable in index table.
41 @return The pointer to variable header indexed by count.
46 IN VARIABLE_INDEX_TABLE
*IndexTable
,
50 return (VARIABLE_HEADER
*) (UINTN
) ((((UINT32
)IndexTable
->Index
[Count
]) << 2) + ((UINT32
)(UINTN
)IndexTable
->StartPtr
& 0xFFFC0000) );
54 Record Variable in VariableIndex HOB.
56 Record Variable in VariableIndex HOB and update the length of variable index table.
58 @param IndexTable The pointer to variable index table.
59 @param Variable The pointer to the variable that will be recorded.
65 VariableIndexTableUpdate (
66 IN OUT VARIABLE_INDEX_TABLE
*IndexTable
,
67 IN VARIABLE_HEADER
*Variable
70 IndexTable
->Index
[IndexTable
->Length
++] = (UINT16
) (((UINT32
)(UINTN
) Variable
) >> 2);