]>
Commit | Line | Data |
---|---|---|
7ff7768d | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | VariableWorker.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Framework PEIM to provide the Variable functionality\r | |
19 | \r | |
20 | --*/\r | |
7ff7768d | 21 | \r |
22 | #include <Variable.h>\r | |
23 | \r | |
24 | /**\r | |
25 | Get one variable by the index count.\r | |
26 | \r | |
27 | @param IndexTable The pointer to variable index table.\r | |
28 | @param Count The index count of variable in index table.\r | |
29 | \r | |
30 | @return The pointer to variable header indexed by count.\r | |
31 | \r | |
32 | **/\r | |
33 | VARIABLE_HEADER *\r | |
34 | GetVariableByIndex (\r | |
35 | IN VARIABLE_INDEX_TABLE *IndexTable,\r | |
36 | IN UINT32 Count\r | |
37 | )\r | |
38 | {\r | |
39 | return (VARIABLE_HEADER *) (UINTN) (IndexTable->Index[Count] + ((UINTN) IndexTable->StartPtr & 0xFFFF0000));\r | |
40 | }\r | |
41 | \r | |
42 | /**\r | |
43 | Record Variable in VariableIndex HOB.\r | |
44 | \r | |
45 | Record Variable in VariableIndex HOB and update the length of variable index table.\r | |
46 | \r | |
47 | @param IndexTable The pointer to variable index table.\r | |
48 | @param Variable The pointer to the variable that will be recorded.\r | |
49 | \r | |
50 | @retval VOID\r | |
51 | \r | |
52 | **/\r | |
53 | VOID\r | |
54 | VariableIndexTableUpdate (\r | |
55 | IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r | |
56 | IN VARIABLE_HEADER *Variable\r | |
57 | )\r | |
58 | {\r | |
59 | IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;\r | |
60 | \r | |
61 | return;\r | |
62 | }\r | |
63 | \r |