--- /dev/null
+/*++\r
+\r
+Copyright (c) 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ VariableWorker.c\r
+\r
+Abstract:\r
+\r
+ Framework PEIM to provide the Variable functionality\r
+\r
+--*/\r
+\r
+#include <Variable.h>\r
+\r
+\r
+VARIABLE_HEADER *\r
+GetVariableByIndex (\r
+ IN VARIABLE_INDEX_TABLE *IndexTable,\r
+ IN UINT32 Count\r
+ )\r
+{\r
+ return (VARIABLE_HEADER *) (UINTN) ((((UINT32)IndexTable->Index[Count]) << 2) + ((UINT32)(UINTN)IndexTable->StartPtr & 0xFFFC0000) );\r
+}\r
+\r
+VOID\r
+VariableIndexTableUpdate (\r
+ IN OUT VARIABLE_INDEX_TABLE *IndexTable,\r
+ IN VARIABLE_HEADER *Variable\r
+ )\r
+{\r
+ IndexTable->Index[IndexTable->Length++] = (UINT16) (((UINT32)(UINTN) Variable) >> 2);\r
+\r
+ return;\r
+}\r
+\r