1. Removed #ifdef SNP_DEBUG and used debug lib to output information
[mirror_edk2.git] / EdkModulePkg / Universal / Variable / Pei / VariableWorker.c
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 VariableWorker.c
15
16 Abstract:
17
18 Framework PEIM to provide the Variable functionality
19
20 --*/
21
22 #include <Variable.h>
23
24
25 VARIABLE_HEADER *
26 GetVariableByIndex (
27 IN VARIABLE_INDEX_TABLE *IndexTable,
28 IN UINT32 Count
29 )
30 {
31 return (VARIABLE_HEADER *) (UINTN) (IndexTable->Index[Count] + ((UINTN) IndexTable->StartPtr & 0xFFFF0000));
32 }
33
34 VOID
35 VariableIndexTableUpdate (
36 IN OUT VARIABLE_INDEX_TABLE *IndexTable,
37 IN VARIABLE_HEADER *Variable
38 )
39 {
40 IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;
41
42 return;
43 }
44