]>
Commit | Line | Data |
---|---|---|
504214c4 | 1 | /** @file\r |
8d3a5c82 | 2 | \r |
504214c4 LG |
3 | Variable worker functions specific for IA32, X64 and EBC.\r |
4 | \r | |
5 | Copyright (c) 2007 - 2008, Intel Corporation\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 | |
504214c4 | 14 | **/\r |
8d3a5c82 | 15 | \r |
23837df2 | 16 | #include "Variable.h"\r |
8d3a5c82 | 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 | |
27 | VARIABLE_HEADER *\r | |
28 | GetVariableByIndex (\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 | |
8d3a5c82 | 44 | **/\r |
45 | VOID\r | |
46 | VariableIndexTableUpdate (\r | |
47 | IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r | |
48 | IN VARIABLE_HEADER *Variable\r | |
49 | )\r | |
50 | {\r | |
51 | IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;\r | |
52 | \r | |
53 | return;\r | |
54 | }\r | |
55 | \r |