]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Universal/Variable/Pei/Ipf/VariableWorker.c
remove unnecessary check for NULL pointer.
[mirror_edk2.git] / EdkModulePkg / Universal / Variable / Pei / Ipf / VariableWorker.c
CommitLineData
ce8bd86e 1/** @file\r
2 Variable worker functions.\r
3aaddf92 3\r
ce8bd86e 4 Copyright (c) 2006, Intel Corporation<BR>\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
3aaddf92 9\r
ce8bd86e 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
3aaddf92 12\r
ce8bd86e 13**/\r
3aaddf92 14\r
ce8bd86e 15#include <Variable.h>\r
3aaddf92 16\r
3aaddf92 17\r
ce8bd86e 18/**\r
19 Get one variable by the index count.\r
3aaddf92 20\r
ce8bd86e 21 @param IndexTable The pointer to variable index table.\r
22 @param Count The index count of variable in index table.\r
3aaddf92 23\r
ce8bd86e 24 @return The pointer to variable header indexed by count.\r
3aaddf92 25\r
ce8bd86e 26**/\r
3aaddf92 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) ((((UINT32)IndexTable->Index[Count]) << 2) + ((UINT32)(UINTN)IndexTable->StartPtr & 0xFFFC0000) );\r
34}\r
35\r
ce8bd86e 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
3aaddf92 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) (((UINT32)(UINTN) Variable) >> 2);\r
54\r
55 return;\r
56}\r
57\r