3 Copyright (c) 2006 - 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
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.
25 // Don't use module globals after the SetVirtualAddress map is signaled
27 extern ESAL_VARIABLE_GLOBAL
*mVariableModuleGlobal
;
31 RuntimeServiceGetVariable (
32 IN CHAR16
*VariableName
,
33 IN EFI_GUID
* VendorGuid
,
34 OUT UINT32
*Attributes OPTIONAL
,
35 IN OUT UINTN
*DataSize
,
54 &mVariableModuleGlobal
->VariableGlobal
[Physical
],
55 mVariableModuleGlobal
->FvbInstance
61 RuntimeServiceGetNextVariableName (
62 IN OUT UINTN
*VariableNameSize
,
63 IN OUT CHAR16
*VariableName
,
64 IN OUT EFI_GUID
*VendorGuid
76 return GetNextVariableName (
80 &mVariableModuleGlobal
->VariableGlobal
[Physical
],
81 mVariableModuleGlobal
->FvbInstance
87 RuntimeServiceSetVariable (
88 IN CHAR16
*VariableName
,
89 IN EFI_GUID
*VendorGuid
,
110 &mVariableModuleGlobal
->VariableGlobal
[Physical
],
111 &mVariableModuleGlobal
->VolatileLastVariableOffset
,
112 &mVariableModuleGlobal
->NonVolatileLastVariableOffset
,
113 mVariableModuleGlobal
->FvbInstance
119 RuntimeServiceQueryVariableInfo (
120 IN UINT32 Attributes
,
121 OUT UINT64
*MaximumVariableStorageSize
,
122 OUT UINT64
*RemainingVariableStorageSize
,
123 OUT UINT64
*MaximumVariableSize
135 return QueryVariableInfo (
137 MaximumVariableStorageSize
,
138 RemainingVariableStorageSize
,
140 &mVariableModuleGlobal
->VariableGlobal
[Physical
],
141 mVariableModuleGlobal
->FvbInstance
147 VariableClassAddressChangeEvent (
163 (VOID
**) &mVariableModuleGlobal
->VariableGlobal
[Physical
].NonVolatileVariableBase
167 (VOID
**) &mVariableModuleGlobal
->VariableGlobal
[Physical
].VolatileVariableBase
169 EfiConvertPointer (0x0, (VOID
**) &mVariableModuleGlobal
);
174 VariableServiceInitialize (
175 IN EFI_HANDLE ImageHandle
,
176 IN EFI_SYSTEM_TABLE
*SystemTable
188 EFI_HANDLE NewHandle
;
191 Status
= VariableCommonInitialize (ImageHandle
, SystemTable
);
192 ASSERT_EFI_ERROR (Status
);
194 SystemTable
->RuntimeServices
->GetVariable
= RuntimeServiceGetVariable
;
195 SystemTable
->RuntimeServices
->GetNextVariableName
= RuntimeServiceGetNextVariableName
;
196 SystemTable
->RuntimeServices
->SetVariable
= RuntimeServiceSetVariable
;
197 SystemTable
->RuntimeServices
->QueryVariableInfo
= RuntimeServiceQueryVariableInfo
;
200 // Now install the Variable Runtime Architectural Protocol on a new handle
203 Status
= gBS
->InstallMultipleProtocolInterfaces (
205 &gEfiVariableArchProtocolGuid
,
207 &gEfiVariableWriteArchProtocolGuid
,
211 ASSERT_EFI_ERROR (Status
);