SecurityPkg/VariableAuthenticated/EsalVariableDxeSal/Variable.h File Reference


Data Structures

struct  VARIABLE_POINTER_TRACK
struct  VARIABLE_GLOBAL
struct  ESAL_VARIABLE_GLOBAL
struct  VARIABLE_CACHE_ENTRY

Defines

#define MAX_NAME_SIZE   0x100
#define NUM_VAR_NAME   9
#define VAR_PLATFORM_LANG_CODES   0
#define VAR_LANG_CODES   1
#define VAR_PLATFORM_LANG   2
#define VAR_LANG   3
#define VAR_HW_ERR_REC   4
#define VAR_AUTH_KEY_DB   5
#define VAR_SETUP_MODE   6
#define VAR_PLATFORM_KEY   7
#define VAR_KEY_EXCHANGE_KEY   8
#define AUTHVAR_KEYDB_NAME   L"AuthVarKeyDatabase"
#define AUTHVAR_KEYDB_NAME_SIZE   38
#define MAX_KEYDB_SIZE   (FixedPcdGet32 (PcdMaxVariableSize) - sizeof (AUTHENTICATED_VARIABLE_HEADER) - AUTHVAR_KEYDB_NAME_SIZE)
#define MAX_KEY_NUM   (MAX_KEYDB_SIZE / EFI_CERT_TYPE_RSA2048_SIZE)
#define ISO_639_2_ENTRY_SIZE   3

Enumerations

enum  VARIABLE_POINTER_TYPE { Physical, Virtual }

Functions

EFI_STATUS VariableCommonInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI VariableServiceInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI VariableClassAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI EsalGetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes, IN OUT UINTN *DataSize, OUT VOID *Data, IN BOOLEAN VirtualMode, IN ESAL_VARIABLE_GLOBAL *Global)
EFI_STATUS EFIAPI EsalGetNextVariableName (IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid, IN BOOLEAN VirtualMode, IN ESAL_VARIABLE_GLOBAL *Global)
EFI_STATUS EFIAPI EsalSetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data, IN BOOLEAN VirtualMode, IN ESAL_VARIABLE_GLOBAL *Global)
EFI_STATUS EFIAPI EsalQueryVariableInfo (IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize, IN BOOLEAN VirtualMode, IN ESAL_VARIABLE_GLOBAL *Global)
EFI_STATUS FtwVariableSpace (IN EFI_PHYSICAL_ADDRESS VariableBase, IN UINT8 *Buffer, IN UINTN BufferSize)
EFI_STATUS FindVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack, IN VARIABLE_GLOBAL *Global, IN UINTN Instance)
VOID GetVariableDataPtr (IN EFI_PHYSICAL_ADDRESS VariableAddress, IN BOOLEAN Volatile, IN VARIABLE_GLOBAL *Global, IN UINTN Instance, OUT CHAR16 *VariableData)
UINTN DataSizeOfVariable (IN AUTHENTICATED_VARIABLE_HEADER *Variable)
EFI_STATUS EFIAPI UpdateVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VOID *Data, IN UINTN DataSize, IN UINT32 Attributes, IN UINT32 KeyIndex, IN UINT64 MonotonicCount, IN BOOLEAN VirtualMode, IN ESAL_VARIABLE_GLOBAL *Global, IN VARIABLE_POINTER_TRACK *Variable)
BOOLEAN IsValidVariableHeader (IN EFI_PHYSICAL_ADDRESS VariableAddress, IN BOOLEAN Volatile, IN VARIABLE_GLOBAL *Global, IN UINTN Instance, OUT AUTHENTICATED_VARIABLE_HEADER *VariableHeader)
VOID FlushHob2Nv (VOID)

Variables

ESAL_VARIABLE_GLOBALmVariableModuleGlobal

Detailed Description

Internal header file for Extended SAL variable service module.

Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define AUTHVAR_KEYDB_NAME   L"AuthVarKeyDatabase"

"AuthVarKeyDatabase" variable for the Public Key store.

#define AUTHVAR_KEYDB_NAME_SIZE   38

#define ISO_639_2_ENTRY_SIZE   3

The size of a 3 character ISO639 language code.

Referenced by AutoUpdateLangVariable(), GetIndexFromSupportedLangCodes(), and GetLangFromSupportedLangCodes().

#define MAX_KEY_NUM   (MAX_KEYDB_SIZE / EFI_CERT_TYPE_RSA2048_SIZE)

Referenced by AddPubKeyInStore().

#define MAX_KEYDB_SIZE   (FixedPcdGet32 (PcdMaxVariableSize) - sizeof (AUTHENTICATED_VARIABLE_HEADER) - AUTHVAR_KEYDB_NAME_SIZE)

The maximum size of the public key database, restricted by maximum individal EFI varible size, and excluding the variable header and name size.

Referenced by AutenticatedVariableServiceInitialize(), ProcessVarWithKek(), and ProcessVarWithPk().

#define MAX_NAME_SIZE   0x100

Referenced by FindVariable(), and Reclaim().

#define NUM_VAR_NAME   9

#define VAR_AUTH_KEY_DB   5

#define VAR_HW_ERR_REC   4

Referenced by EsalSetVariable().

#define VAR_KEY_EXCHANGE_KEY   8

#define VAR_LANG   3

Referenced by AutoUpdateLangVariable().

#define VAR_LANG_CODES   1

Referenced by AutoUpdateLangVariable().

#define VAR_PLATFORM_KEY   7

#define VAR_PLATFORM_LANG   2

Referenced by AutoUpdateLangVariable().

#define VAR_PLATFORM_LANG_CODES   0

Referenced by AutoUpdateLangVariable().

#define VAR_SETUP_MODE   6


Enumeration Type Documentation

Enumerator:
Physical 
Virtual 


Function Documentation

UINTN DataSizeOfVariable ( IN AUTHENTICATED_VARIABLE_HEADER *  Variable  ) 

Gets the size of variable data area.

This function gets the size of variable data area. The variable is specified by its variable header. If variable header contains raw data, just return 0.

Parameters:
[in] Variable Pointer to the variable header.
Returns:
Size of variable data area in bytes.

References UINTN().

Referenced by AutenticatedVariableServiceInitialize(), EsalGetVariable(), GetNextVariablePtr(), and UpdateVariable().

EFI_STATUS EFIAPI EsalGetNextVariableName ( IN OUT UINTN *  VariableNameSize,
IN OUT CHAR16 *  VariableName,
IN OUT EFI_GUID *  VendorGuid,
IN BOOLEAN  VirtualMode,
IN ESAL_VARIABLE_GLOBAL Global 
)

Implements EsalGetNextVariableName function of Extended SAL Variable Services Class.

This function implements EsalGetNextVariableName function of Extended SAL Variable Services Class. It is equivalent in functionality to the EFI Runtime Service GetNextVariableName().

Parameters:
[in,out] VariableNameSize Size of the variable
[in,out] VariableName On input, supplies the last VariableName that was returned by GetNextVariableName(). On output, returns the Null-terminated Unicode string of the current variable.
[in,out] VendorGuid On input, supplies the last VendorGuid that was returned by GetNextVariableName(). On output, returns the VendorGuid of the current variable.
[in] VirtualMode Current calling mode for this function.
[in] Global Context of this Extended SAL Variable Services Class call.
Return values:
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND The next variable was not found.
EFI_BUFFER_TOO_SMALL VariableNameSize is too small for the result. VariableNameSize has been updated with the size needed to complete the request.
EFI_INVALID_PARAMETER VariableNameSize is NULL.
EFI_INVALID_PARAMETER VariableName is NULL.
EFI_INVALID_PARAMETER VendorGuid is NULL.
EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.

References AcquireLockOnlyAtBootTime(), BOOLEAN(), VARIABLE_POINTER_TRACK::CurrPtr, EFI_STATUS(), VARIABLE_POINTER_TRACK::EndPtr, FindVariable(), GetEndPointer(), GetNextVariablePtr(), GetStartPointer(), GetVariableNamePtr(), IsValidVariableHeader(), NameSizeOfVariable(), VARIABLE_GLOBAL::NonVolatileVariableBase, ReleaseLockOnlyAtBootTime(), VARIABLE_POINTER_TRACK::StartPtr, TRUE, UINTN(), VARIABLE_GLOBAL::VariableServicesLock, and VARIABLE_POINTER_TRACK::Volatile.

Referenced by EsalVariableCommonEntry().

EFI_STATUS EFIAPI EsalGetVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID *  VendorGuid,
OUT UINT32 *  Attributes,
IN OUT UINTN *  DataSize,
OUT VOID *  Data,
IN BOOLEAN  VirtualMode,
IN ESAL_VARIABLE_GLOBAL Global 
)

Implements EsalGetVariable function of Extended SAL Variable Services Class.

This function implements EsalGetVariable function of Extended SAL Variable Services Class. It is equivalent in functionality to the EFI Runtime Service GetVariable().

Parameters:
[in] VariableName A Null-terminated Unicode string that is the name of the vendor's variable.
[in] VendorGuid A unique identifier for the vendor.
[out] Attributes If not NULL, a pointer to the memory location to return the attributes bitmask for the variable.
[in,out] DataSize Size of Data found. If size is less than the data, this value contains the required size.
[out] Data On input, the size in bytes of the return Data buffer. On output, the size of data returned in Data.
[in] VirtualMode Current calling mode for this function.
[in] Global Context of this Extended SAL Variable Services Class call.
Return values:
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND The variable was not found.
EFI_BUFFER_TOO_SMALL DataSize is too small for the result. DataSize has been updated with the size needed to complete the request.
EFI_INVALID_PARAMETER VariableName is NULL.
EFI_INVALID_PARAMETER VendorGuid is NULL.
EFI_INVALID_PARAMETER DataSize is NULL.
EFI_INVALID_PARAMETER DataSize is not too small and Data is NULL.
EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.

References AcquireLockOnlyAtBootTime(), BOOLEAN(), VARIABLE_POINTER_TRACK::CurrPtr, DataSizeOfVariable(), EFI_STATUS(), FindVariable(), FindVariableInCache(), GetVariableDataPtr(), IsValidVariableHeader(), ReleaseLockOnlyAtBootTime(), TRUE, UINTN(), UpdateVariableCache(), UpdateVariableInfo(), VARIABLE_GLOBAL::VariableServicesLock, and VARIABLE_POINTER_TRACK::Volatile.

Referenced by EsalVariableCommonEntry().

EFI_STATUS EFIAPI EsalQueryVariableInfo ( IN UINT32  Attributes,
OUT UINT64 *  MaximumVariableStorageSize,
OUT UINT64 *  RemainingVariableStorageSize,
OUT UINT64 *  MaximumVariableSize,
IN BOOLEAN  VirtualMode,
IN ESAL_VARIABLE_GLOBAL Global 
)

Implements EsalQueryVariableInfo function of Extended SAL Variable Services Class.

This function implements EsalQueryVariableInfo function of Extended SAL Variable Services Class. It is equivalent in functionality to the EFI Runtime Service QueryVariableInfo().

Parameters:
[in] Attributes Attributes bitmask to specify the type of variables on which to return information.
[out] MaximumVariableStorageSize On output the maximum size of the storage space available for the EFI variables associated with the attributes specified.
[out] RemainingVariableStorageSize Returns the remaining size of the storage space available for EFI variables associated with the attributes specified.
[out] MaximumVariableSize Returns the maximum size of an individual EFI variable associated with the attributes specified.
[in] VirtualMode Current calling mode for this function
[in] Global Context of this Extended SAL Variable Services Class call
Return values:
EFI_SUCCESS Valid answer returned.
EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.
EFI_UNSUPPORTED The attribute is not supported on this platform, and the MaximumVariableStorageSize, RemainingVariableStorageSize, MaximumVariableSize are undefined.

References AcquireLockOnlyAtBootTime(), BOOLEAN(), GetEndPointer(), GetNextVariablePtr(), GetStartPointer(), GetVarStoreHeader(), IsValidVariableHeader(), VARIABLE_GLOBAL::NonVolatileVariableBase, ReleaseLockOnlyAtBootTime(), TRUE, VARIABLE_GLOBAL::VariableServicesLock, and VARIABLE_GLOBAL::VolatileVariableBase.

Referenced by EsalVariableCommonEntry().

EFI_STATUS EFIAPI EsalSetVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID *  VendorGuid,
IN UINT32  Attributes,
IN UINTN  DataSize,
IN VOID *  Data,
IN BOOLEAN  VirtualMode,
IN ESAL_VARIABLE_GLOBAL Global 
)

Implements EsalSetVariable function of Extended SAL Variable Services Class.

This function implements EsalSetVariable function of Extended SAL Variable Services Class. It is equivalent in functionality to the EFI Runtime Service SetVariable().

Parameters:
[in] VariableName A Null-terminated Unicode string that is the name of the vendor's variable. Each VariableName is unique for each VendorGuid. VariableName must contain 1 or more Unicode characters. If VariableName is an empty Unicode string, then EFI_INVALID_PARAMETER is returned.
[in] VendorGuid A unique identifier for the vendor.
[in] Attributes Attributes bitmask to set for the variable.
[in] DataSize The size in bytes of the Data buffer. A size of zero causes the variable to be deleted.
[in] Data The contents for the variable.
[in] VirtualMode Current calling mode for this function.
[in] Global Context of this Extended SAL Variable Services Class call.
Return values:
EFI_SUCCESS The firmware has successfully stored the variable and its data as defined by the Attributes.
EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the DataSize exceeds the maximum allowed.
EFI_INVALID_PARAMETER VariableName is an empty Unicode string.
EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
EFI_WRITE_PROTECTED The variable in question is read-only.
EFI_WRITE_PROTECTED The variable in question cannot be deleted.
EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
EFI_NOT_FOUND The variable trying to be updated or deleted was not found.

References AcquireLockOnlyAtBootTime(), AUTHINFO_SIZE, AutoUpdateLangVariable(), EFI_STATUS(), FindVariable(), GetNextVariablePtr(), GetStartPointer(), IsValidVariableHeader(), VARIABLE_GLOBAL::NonVolatileVariableBase, ProcessVarWithKek(), ProcessVarWithPk(), ReleaseLockOnlyAtBootTime(), TRUE, UINTN(), UpdateVariable(), VAR_HW_ERR_REC, VAR_KEY_EXCHANGE_KEY, VAR_PLATFORM_KEY, VARIABLE_GLOBAL::VariableServicesLock, and VerifyVariable().

Referenced by EsalVariableCommonEntry(), and FlushHob2Nv().

EFI_STATUS FindVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID *  VendorGuid,
OUT VARIABLE_POINTER_TRACK PtrTrack,
IN VARIABLE_GLOBAL Global,
IN UINTN  Instance 
)

Finds variable in volatile and non-volatile storage areas.

This code finds variable in volatile and non-volatile storage areas. If VariableName is an empty string, then we just return the first qualified variable without comparing VariableName and VendorGuid. Otherwise, VariableName and VendorGuid are compared.

Parameters:
[in] VariableName Name of the variable to be found.
[in] VendorGuid Vendor GUID to be found.
[out] PtrTrack VARIABLE_POINTER_TRACK structure for output, including the range searched and the target position.
[in] Global Pointer to VARIABLE_GLOBAL structure, including base of volatile variable storage area, base of NV variable storage area, and a lock.
[in] Instance Instance of FV Block services.
Return values:
EFI_INVALID_PARAMETER If VariableName is not an empty string, while VendorGuid is NULL.
EFI_SUCCESS Variable successfully found.
EFI_INVALID_PARAMETER Variable not found.

References BOOLEAN(), GetEndPointer(), GetNextVariablePtr(), GetStartPointer(), GetVariableNamePtr(), IsValidVariableHeader(), MAX_NAME_SIZE, NameSizeOfVariable(), TRUE, and UINTN().

Referenced by AddPubKeyInStore(), AutenticatedVariableServiceInitialize(), AutoUpdateLangVariable(), EsalGetNextVariableName(), EsalGetVariable(), EsalSetVariable(), ProcessVarWithKek(), ProcessVarWithPk(), and UpdatePlatformMode().

VOID FlushHob2Nv ( VOID   ) 

Flush the HOB variable to NV variable storage.

References EFI_STATUS(), EsalSetVariable(), Physical, and UINTN().

Referenced by VariableServiceInitialize().

EFI_STATUS FtwVariableSpace ( IN EFI_PHYSICAL_ADDRESS  VariableBase,
IN UINT8 *  Buffer,
IN UINTN  BufferSize 
)

Writes a buffer to variable storage space.

This function writes a buffer to variable storage space into firmware volume block device. The destination is specified by parameter VariableBase. Fault Tolerant Write protocol is used for writing.

Parameters:
[in] VariableBase The base address of the variable to write.
[in] Buffer Points to the data buffer.
[in] BufferSize The number of bytes of the data Buffer.
Return values:
EFI_SUCCESS The function completed successfully.
EFI_NOT_FOUND Fail to locate Fault Tolerant Write protocol.
Other The function could not complete successfully.

References EFI_STATUS(), GetFvbHandleByAddress(), GetLbaAndOffsetByAddress(), and UINTN().

Referenced by Reclaim().

VOID GetVariableDataPtr ( IN EFI_PHYSICAL_ADDRESS  VariableAddress,
IN BOOLEAN  Volatile,
IN VARIABLE_GLOBAL Global,
IN UINTN  Instance,
OUT CHAR16 *  VariableData 
)

Gets the pointer to variable data area.

This function gets the pointer to variable data area. The variable is specified by its variable header.

Parameters:
[in] VariableAddress Start address of variable header.
[in] Volatile TRUE - Variable is volatile. FALSE - Variable is non-volatile.
[in] Global Pointer to VARAIBLE_GLOBAL structure.
[in] Instance Instance of FV Block services.
[out] VariableData Buffer to hold variable data for output.

References AccessVariableStore(), BOOLEAN(), EFI_STATUS(), IsValidVariableHeader(), and NameSizeOfVariable().

Referenced by AutenticatedVariableServiceInitialize(), AutoUpdateLangVariable(), EsalGetVariable(), ProcessVarWithKek(), ProcessVarWithPk(), and UpdateVariable().

BOOLEAN IsValidVariableHeader ( IN EFI_PHYSICAL_ADDRESS  VariableAddress,
IN BOOLEAN  Volatile,
IN VARIABLE_GLOBAL Global,
IN UINTN  Instance,
OUT AUTHENTICATED_VARIABLE_HEADER *  VariableHeader 
)

Checks variable header.

This function checks if variable header is valid or not.

Parameters:
[in] VariableAddress Start address of variable header.
[in] Volatile TRUE - Variable is volatile. FALSE - Variable is non-volatile.
[in] Global Pointer to VARAIBLE_GLOBAL structure.
[in] Instance Instance of FV Block services.
[out] VariableHeader Pointer to AUTHENTICATED_VARIABLE_HEADER for output.
Return values:
TRUE Variable header is valid.
FALSE Variable header is not valid.

References AccessVariableStore(), EFI_STATUS(), and TRUE.

Referenced by AutenticatedVariableServiceInitialize(), EsalGetNextVariableName(), EsalGetVariable(), EsalQueryVariableInfo(), EsalSetVariable(), FindVariable(), GetNextVariablePtr(), GetVariableDataPtr(), GetVariableNamePtr(), ProcessVarWithKek(), ProcessVarWithPk(), Reclaim(), UpdateVariable(), VariableCommonInitialize(), and VerifyVariable().

EFI_STATUS EFIAPI UpdateVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID *  VendorGuid,
IN VOID *  Data,
IN UINTN  DataSize,
IN UINT32  Attributes,
IN UINT32  KeyIndex,
IN UINT64  MonotonicCount,
IN BOOLEAN  VirtualMode,
IN ESAL_VARIABLE_GLOBAL Global,
IN VARIABLE_POINTER_TRACK Variable 
)

Update the variable region with Variable information. These are the same arguments as the EFI Variable services.

Parameters:
[in] VariableName Name of variable.
[in] VendorGuid Guid of variable.
[in] Data Variable data.
[in] DataSize Size of data. 0 means delete.
[in] Attributes Attributes of the variable.
[in] KeyIndex Index of associated public key.
[in] MonotonicCount Value of associated monotonic count.
[in] VirtualMode Current calling mode for this function.
[in] Global Context of this Extended SAL Variable Services Class call.
[in] Variable The variable information which is used to keep track of variable usage.
Return values:
EFI_SUCCESS The update operation is success.
EFI_OUT_OF_RESOURCES Variable region is full, can not write other data into this region.

References AccessVariableStore(), BOOLEAN(), DataSizeOfVariable(), EFI_STATUS(), GetEndPointer(), GetVariableDataPtr(), GetVarStoreHeader(), IsValidVariableHeader(), VARIABLE_GLOBAL::NonVolatileVariableBase, Reclaim(), TRUE, UINTN(), UpdateVariableCache(), UpdateVariableInfo(), and VARIABLE_GLOBAL::VolatileVariableBase.

Referenced by AddPubKeyInStore(), AutenticatedVariableServiceInitialize(), AutoUpdateLangVariable(), EsalSetVariable(), ProcessVarWithKek(), ProcessVarWithPk(), and UpdatePlatformMode().

VOID EFIAPI VariableClassAddressChangeEvent ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.

This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. It convers pointer to new virtual address.

Parameters:
[in] Event The event whose notification function is being invoked.
[in] Context The pointer to the notification function's context.

References ESAL_VARIABLE_GLOBAL::AuthenticatedVariableGuid, ESAL_VARIABLE_GLOBAL::CertRsa2048Sha256Guid, ESAL_VARIABLE_GLOBAL::GlobalVariableGuid, ESAL_VARIABLE_GLOBAL::HashContext, ESAL_VARIABLE_GLOBAL::ImageSecurityDatabaseGuid, ESAL_VARIABLE_GLOBAL::LangCodes, mVariableModuleGlobal, VARIABLE_GLOBAL::NonVolatileVariableBase, NUM_VAR_NAME, Physical, ESAL_VARIABLE_GLOBAL::PlatformLang, ESAL_VARIABLE_GLOBAL::PlatformLangCodes, UINTN(), ESAL_VARIABLE_GLOBAL::VariableGlobal, ESAL_VARIABLE_GLOBAL::VariableName, Virtual, and VARIABLE_GLOBAL::VolatileVariableBase.

Referenced by VariableServiceInitialize().

EFI_STATUS VariableCommonInitialize ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE *  SystemTable 
)

Initializes variable store area for non-volatile and volatile variable.

This function allocates and initializes memory space for global context of ESAL variable service and variable store area for non-volatile and volatile variable.

Parameters:
[in] ImageHandle The Image handle of this driver.
[in] SystemTable The pointer of EFI_SYSTEM_TABLE.
Return values:
EFI_SUCCESS Function successfully executed.
EFI_OUT_OF_RESOURCES Failed to allocate enough memory resource.
Initializes variable store area for non-volatile and volatile variable.

This function allocates and initializes memory space for global context of ESAL variable service and variable store area for non-volatile and volatile variable.

Parameters:
[in] ImageHandle The Image handle of this driver.
[in] SystemTable The pointer of EFI_SYSTEM_TABLE.
Return values:
EFI_SUCCESS Function successfully executed.
EFI_OUT_OF_RESOURCES Fail to allocate enough memory resource.

References AccessVariableStore(), ESAL_VARIABLE_GLOBAL::CommonVariableTotalSize, EFI_STATUS(), ESAL_VARIABLE_GLOBAL::FvbInstance, GetNextVariablePtr(), GetStartPointer(), GetVariableStoreStatus(), ESAL_VARIABLE_GLOBAL::GlobalVariableGuid, ESAL_VARIABLE_GLOBAL::HwErrVariableTotalSize, IsValidVariableHeader(), mVariableName, ESAL_VARIABLE_GLOBAL::NonVolatileLastVariableOffset, VARIABLE_GLOBAL::NonVolatileVariableBase, Physical, Reclaim(), ReclaimForOS(), TRUE, UINTN(), ESAL_VARIABLE_GLOBAL::VariableGlobal, ESAL_VARIABLE_GLOBAL::VariableName, VARIABLE_GLOBAL::VariableServicesLock, ESAL_VARIABLE_GLOBAL::VolatileLastVariableOffset, and VARIABLE_GLOBAL::VolatileVariableBase.

Referenced by VariableServiceInitialize().

EFI_STATUS EFIAPI VariableServiceInitialize ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE *  SystemTable 
)

Entry point of Extended SAL Variable service module.

This function is the entry point of Extended SAL Variable service module. It registers all functions of Extended SAL Variable class, initializes variable store for non-volatile and volatile variables, and registers notification function for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.

Parameters:
[in] ImageHandle The Image handle of this driver.
[in] SystemTable The pointer of EFI_SYSTEM_TABLE.
Return values:
EFI_SUCCESS Extended SAL Variable Services Class successfully registered.

References AutenticatedVariableServiceInitialize(), EFI_STATUS(), EsalVariableCommonEntry(), FlushHob2Nv(), mEfiVirtualNotifyEvent, mVariableModuleGlobal, VariableClassAddressChangeEvent(), and VariableCommonInitialize().


Variable Documentation


Generated on Thu Sep 24 23:44:25 2015 for SecurityPkg[ALL] by  doxygen 1.5.7.1