]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Variable/Pei/VariableWorker.c
Add comments and DoxyGen format for these files.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / Pei / VariableWorker.c
CommitLineData
504214c4 1/** @file\r
8d3a5c82 2\r
504214c4
LG
3 Variable worker functions specific for IA32, X64 and EBC.\r
4\r
5Copyright (c) 2007 - 2008, Intel Corporation\r
8d3a5c82 6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
504214c4 14**/\r
8d3a5c82 15\r
16#include <Variable.h>\r
17\r
18/**\r
19 Get one variable by the index count.\r
20\r
21 @param IndexTable The pointer to variable index table.\r
22 @param Count The index count of variable in index table.\r
23\r
24 @return The pointer to variable header indexed by count.\r
25\r
26**/\r
27VARIABLE_HEADER *\r
28GetVariableByIndex (\r
29 IN VARIABLE_INDEX_TABLE *IndexTable,\r
30 IN UINT32 Count\r
31 )\r
32{\r
33 return (VARIABLE_HEADER *) (UINTN) (IndexTable->Index[Count] + ((UINTN) IndexTable->StartPtr & 0xFFFF0000));\r
34}\r
35\r
36/**\r
37 Record Variable in VariableIndex HOB.\r
38\r
39 Record Variable in VariableIndex HOB and update the length of variable index table.\r
40\r
41 @param IndexTable The pointer to variable index table.\r
42 @param Variable The pointer to the variable that will be recorded.\r
43\r
44 @retval VOID\r
45\r
46**/\r
47VOID\r
48VariableIndexTableUpdate (\r
49 IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r
50 IN VARIABLE_HEADER *Variable\r
51 )\r
52{\r
53 IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;\r
54\r
55 return;\r
56}\r
57\r