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