TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Protocol/VariableWrite.h>
#include <Protocol/Variable.h>
#include <Protocol/MmCommunication2.h>
#include <Protocol/SmmVariable.h>
#include <Protocol/VariableLock.h>
#include <Protocol/VarCheck.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiRuntimeLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/HobLib.h>
#include <Guid/EventGroup.h>
#include <Guid/SmmVariableCommon.h>
#include <Guid/VariableRuntimeCacheInfo.h>
#include "PrivilegePolymorphic.h"
#include "VariableParsing.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | VariablePolicySmmDxeMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
VOID EFIAPI | RecordSecureBootPolicyVarData (VOID) |
VOID | AcquireLockOnlyAtBootTime (IN EFI_LOCK *Lock) |
VOID | ReleaseLockOnlyAtBootTime (IN EFI_LOCK *Lock) |
BOOLEAN | AtRuntime (VOID) |
EFI_STATUS | InitCommunicateBuffer (OUT VOID **DataPtr OPTIONAL, IN UINTN DataSize, IN UINTN Function) |
EFI_STATUS | SendCommunicateBuffer (IN UINTN DataSize) |
EFI_STATUS EFIAPI | VariableLockRequestToLock (IN CONST EDKII_VARIABLE_LOCK_PROTOCOL *This, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid) |
=== CODE UNDER TEST =========================================================================== | |
EFI_STATUS EFIAPI | VarCheckRegisterSetVariableCheckHandler (IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler) |
EFI_STATUS EFIAPI | VarCheckVariablePropertySet (IN CHAR16 *Name, IN EFI_GUID *Guid, IN VAR_CHECK_VARIABLE_PROPERTY *VariableProperty) |
EFI_STATUS EFIAPI | VarCheckVariablePropertyGet (IN CHAR16 *Name, IN EFI_GUID *Guid, OUT VAR_CHECK_VARIABLE_PROPERTY *VariableProperty) |
VOID | SyncRuntimeCache (VOID) |
VOID | CheckForRuntimeCacheSync (VOID) |
EFI_STATUS | FindVariableInRuntimeCache (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL) |
EFI_STATUS | FindVariableInSmm (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL) |
EFI_STATUS EFIAPI | RuntimeServiceGetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data) |
EFI_STATUS | GetNextVariableNameInRuntimeCache (IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid) |
EFI_STATUS | GetNextVariableNameInSmm (IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid) |
EFI_STATUS EFIAPI | RuntimeServiceGetNextVariableName (IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid) |
EFI_STATUS EFIAPI | RuntimeServiceSetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data) |
EFI_STATUS EFIAPI | RuntimeServiceQueryVariableInfo (IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize) |
VOID EFIAPI | OnExitBootServices (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | OnReadyToBoot (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | VariableAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | GetVariablePayloadSize (OUT UINTN *VariablePayloadSize) |
EFI_STATUS | GetRuntimeCacheInfo (OUT UINTN *TotalHobStorageSize, OUT UINTN *TotalNvStorageSize, OUT UINTN *TotalVolatileStorageSize, OUT BOOLEAN *AuthenticatedVariableUsage) |
VOID | InitVariableStoreHeader (IN VARIABLE_STORE_HEADER *VariableCacheBuffer, IN UINTN TotalVariableCacheSize) |
EFI_STATUS | InitVariableCache (IN EFI_HOB_GUID_TYPE *RuntimeCacheInfoGuidHob) |
EFI_STATUS | SendRuntimeVariableCacheContextToSmm (VOID) |
VOID EFIAPI | SmmVariableReady (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | SmmVariableWriteReady (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | VariableSmmRuntimeInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Implement all four UEFI Runtime Variable services for the nonvolatile and volatile storage space and install variable architecture protocol based on SMM variable module.
Caution: This module requires additional review when modified. This driver will have external input - variable data. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.
RuntimeServiceGetVariable() and RuntimeServiceSetVariable() are external API to receive data buffer. The size should be checked carefully.
InitCommunicateBuffer() is really function to check the variable data size.
Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VariableSmmRuntimeDxe.c.
Acquires lock only at boot time. Simply returns at runtime.
This is a temperary function that will be removed when EfiAcquireLock() in UefiLib can handle the call in UEFI Runtimer driver in RT phase. It calls EfiAcquireLock() at boot time, and simply returns at runtime.
Lock | A pointer to the lock to acquire. |
Definition at line 98 of file VariableSmmRuntimeDxe.c.
BOOLEAN AtRuntime | ( | VOID | ) |
Return TRUE if ExitBootServices () has been called.
TRUE | If ExitBootServices () has been called. FALSE if ExitBootServices () has not been called. |
Definition at line 135 of file VariableSmmRuntimeDxe.c.
VOID CheckForRuntimeCacheSync | ( | VOID | ) |
Check whether a SMI must be triggered to retrieve pending cache updates.
If the variable HOB was finished being flushed since the last check for a runtime cache update, this function will prevent the HOB cache from being used for future runtime cache hits.
Definition at line 494 of file VariableSmmRuntimeDxe.c.
EFI_STATUS FindVariableInRuntimeCache | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
OUT UINT32 *Attributes | OPTIONAL, | ||
IN OUT UINTN * | DataSize, | ||
OUT VOID *Data | OPTIONAL | ||
) |
Finds the given variable in a runtime cache variable store.
Caution: This function may receive untrusted input. The data size is external input, so this function will validate it carefully to avoid buffer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[out] | Attributes | Attribute value of the variable found. |
[in,out] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[out] | Data | Data pointer. |
EFI_SUCCESS | Found the specified variable. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | The specified variable could not be found. |
Definition at line 535 of file VariableSmmRuntimeDxe.c.
EFI_STATUS FindVariableInSmm | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
OUT UINT32 *Attributes | OPTIONAL, | ||
IN OUT UINTN * | DataSize, | ||
OUT VOID *Data | OPTIONAL | ||
) |
Finds the given variable in a variable store in SMM.
Caution: This function may receive untrusted input. The data size is external input, so this function will validate it carefully to avoid buffer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[out] | Attributes | Attribute value of the variable found. |
[in,out] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[out] | Data | Data pointer. |
EFI_SUCCESS | Found the specified variable. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | The specified variable could not be found. |
Definition at line 654 of file VariableSmmRuntimeDxe.c.
EFI_STATUS GetNextVariableNameInRuntimeCache | ( | IN OUT UINTN * | VariableNameSize, |
IN OUT CHAR16 * | VariableName, | ||
IN OUT EFI_GUID * | VendorGuid | ||
) |
Finds the next available variable in a runtime cache variable store.
[in,out] | VariableNameSize | Size of the variable name. |
[in,out] | VariableName | Pointer to variable name. |
[in,out] | VendorGuid | Variable Vendor Guid. |
EFI_SUCCESS | The function completed successfully. |
EFI_NOT_FOUND | The next variable was not found. |
EFI_BUFFER_TOO_SMALL | The 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_INVALID_PARAMETER | The input values of VariableName and VendorGuid are not a name and GUID of an existing variable. |
EFI_INVALID_PARAMETER | Null-terminator is not found in the first VariableNameSize bytes of the input VariableName buffer. |
EFI_DEVICE_ERROR | The variable could not be retrieved due to a hardware error. |
EFI_UNSUPPORTED | After ExitBootServices() has been called, this return code may be returned if no variable storage is supported. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table. |
Definition at line 834 of file VariableSmmRuntimeDxe.c.
EFI_STATUS GetNextVariableNameInSmm | ( | IN OUT UINTN * | VariableNameSize, |
IN OUT CHAR16 * | VariableName, | ||
IN OUT EFI_GUID * | VendorGuid | ||
) |
Finds the next available variable in a SMM variable store.
[in,out] | VariableNameSize | Size of the variable name. |
[in,out] | VariableName | Pointer to variable name. |
[in,out] | VendorGuid | Variable Vendor Guid. |
EFI_SUCCESS | The function completed successfully. |
EFI_NOT_FOUND | The next variable was not found. |
EFI_BUFFER_TOO_SMALL | The 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_INVALID_PARAMETER | The input values of VariableName and VendorGuid are not a name and GUID of an existing variable. |
EFI_INVALID_PARAMETER | Null-terminator is not found in the first VariableNameSize bytes of the input VariableName buffer. |
EFI_DEVICE_ERROR | The variable could not be retrieved due to a hardware error. |
EFI_UNSUPPORTED | After ExitBootServices() has been called, this return code may be returned if no variable storage is supported. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table. |
Definition at line 923 of file VariableSmmRuntimeDxe.c.
EFI_STATUS GetRuntimeCacheInfo | ( | OUT UINTN * | TotalHobStorageSize, |
OUT UINTN * | TotalNvStorageSize, | ||
OUT UINTN * | TotalVolatileStorageSize, | ||
OUT BOOLEAN * | AuthenticatedVariableUsage | ||
) |
This code gets information needed from SMM for runtime cache initialization.
[out] | TotalHobStorageSize | Output pointer for the total HOB storage size in bytes. |
[out] | TotalNvStorageSize | Output pointer for the total non-volatile storage size in bytes. |
[out] | TotalVolatileStorageSize | Output pointer for the total volatile storage size in bytes. |
[out] | AuthenticatedVariableUsage | Output pointer that indicates if authenticated variables are to be used. |
EFI_SUCCESS | Retrieved the size successfully. |
EFI_INVALID_PARAMETER | TotalNvStorageSize parameter is NULL. |
EFI_OUT_OF_RESOURCES | The memory resources needed for a CommBuffer are not available. |
Others | Could not retrieve the size successfully. |
Definition at line 1443 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI GetVariablePayloadSize | ( | OUT UINTN * | VariablePayloadSize | ) |
This code gets variable payload size.
[out] | VariablePayloadSize | Output pointer to variable payload size. |
EFI_SUCCESS | Get successfully. |
Others | Get unsuccessfully. |
Definition at line 1364 of file VariableSmmRuntimeDxe.c.
EFI_STATUS InitCommunicateBuffer | ( | OUT VOID **DataPtr | OPTIONAL, |
IN UINTN | DataSize, | ||
IN UINTN | Function | ||
) |
Initialize the communicate buffer using DataSize and Function.
The communicate size is: SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + DataSize.
Caution: This function may receive untrusted input. The data size external input, so this function will validate it carefully to avoid buffer overflow.
[out] | DataPtr | Points to the data in the communicate buffer. |
[in] | DataSize | The data size to send to SMM. |
[in] | Function | The function number to initialize the communicate header. |
EFI_INVALID_PARAMETER | The data size is too big. |
EFI_SUCCESS | Find the specified variable. |
Definition at line 160 of file VariableSmmRuntimeDxe.c.
EFI_STATUS InitVariableCache | ( | IN EFI_HOB_GUID_TYPE * | RuntimeCacheInfoGuidHob | ) |
Initialize the runtime variable cache related content.
[in] | RuntimeCacheInfoGuidHob | Pointer to the gEdkiiVariableRuntimeCacheInfoHobGuid HOB. |
EFI_SUCCESS | Initialize the runtime variable cache related content successfully. |
Others | Could not initialize the runtime variable cache related content successfully. |
Definition at line 1543 of file VariableSmmRuntimeDxe.c.
VOID InitVariableStoreHeader | ( | IN VARIABLE_STORE_HEADER * | VariableCacheBuffer, |
IN UINTN | TotalVariableCacheSize | ||
) |
Initialize the variable cache buffer as an empty variable store.
[in] | VariableCacheBuffer | A pointer to pointer of a cache variable store. |
[in] | TotalVariableCacheSize | The size needed for the UEFI variable store cache buffer that is allocated. |
Definition at line 1517 of file VariableSmmRuntimeDxe.c.
Exit Boot Services Event notification handler.
Notify SMM variable driver about the event.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 1270 of file VariableSmmRuntimeDxe.c.
On Ready To Boot Services Event notification handler.
Notify SMM variable driver about the event.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
Definition at line 1298 of file VariableSmmRuntimeDxe.c.
VOID EFIAPI RecordSecureBootPolicyVarData | ( | VOID | ) |
Some Secure Boot Policy Variable may update following other variable changes(SecureBoot follows PK change, etc). Record their initial State when variable write service is ready.
Definition at line 347 of file Measurement.c.
Releases lock only at boot time. Simply returns at runtime.
This is a temperary function which will be removed when EfiReleaseLock() in UefiLib can handle the call in UEFI Runtimer driver in RT phase. It calls EfiReleaseLock() at boot time and simply returns at runtime.
Lock | A pointer to the lock to release. |
Definition at line 120 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI RuntimeServiceGetNextVariableName | ( | IN OUT UINTN * | VariableNameSize, |
IN OUT CHAR16 * | VariableName, | ||
IN OUT EFI_GUID * | VendorGuid | ||
) |
This code Finds the Next available variable.
[in,out] | VariableNameSize | Size of the variable name. |
[in,out] | VariableName | Pointer to variable name. |
[in,out] | VendorGuid | Variable Vendor Guid. |
EFI_SUCCESS | The function completed successfully. |
EFI_NOT_FOUND | The next variable was not found. |
EFI_BUFFER_TOO_SMALL | The 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_INVALID_PARAMETER | The input values of VariableName and VendorGuid are not a name and GUID of an existing variable. |
EFI_INVALID_PARAMETER | Null-terminator is not found in the first VariableNameSize bytes of the input VariableName buffer. |
EFI_DEVICE_ERROR | The variable could not be retrieved due to a hardware error. |
EFI_UNSUPPORTED | After ExitBootServices() has been called, this return code may be returned if no variable storage is supported. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table. |
Definition at line 1037 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI RuntimeServiceGetVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
OUT UINT32 *Attributes | OPTIONAL, | ||
IN OUT UINTN * | DataSize, | ||
OUT VOID * | Data | ||
) |
This code finds variable in storage blocks (Volatile or Non-Volatile).
Caution: This function may receive untrusted input. The data size is external input, so this function will validate it carefully to avoid buffer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[out] | Attributes | Attribute value of the variable found. |
[in,out] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[out] | Data | Data pointer. |
EFI_SUCCESS | The function completed successfully. |
EFI_NOT_FOUND | The variable was not found. |
EFI_BUFFER_TOO_SMALL | The DataSize is too small for the result. |
EFI_INVALID_PARAMETER | VariableName is NULL. |
EFI_INVALID_PARAMETER | VendorGuid is NULL. |
EFI_INVALID_PARAMETER | DataSize is NULL. |
EFI_INVALID_PARAMETER | The 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. |
EFI_UNSUPPORTED | After ExitBootServices() has been called, this return code may be returned if no variable storage is supported. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table. |
Definition at line 778 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI RuntimeServiceQueryVariableInfo | ( | IN UINT32 | Attributes, |
OUT UINT64 * | MaximumVariableStorageSize, | ||
OUT UINT64 * | RemainingVariableStorageSize, | ||
OUT UINT64 * | MaximumVariableSize | ||
) |
This code returns information about the EFI variables.
[in] | Attributes | Attributes bitmask to specify the type of variables on which to return information. |
[out] | MaximumVariableStorageSize | Pointer to the maximum size of the storage space available for the EFI variables associated with the attributes specified. |
[out] | RemainingVariableStorageSize | Pointer to the remaining size of the storage space available for EFI variables associated with the attributes specified. |
[out] | MaximumVariableSize | Pointer to the maximum size of an individual EFI variables associated with the attributes specified. |
EFI_INVALID_PARAMETER | An invalid combination of attribute bits was supplied. |
EFI_SUCCESS | Query successfully. |
EFI_UNSUPPORTED | The attribute is not supported on this platform. |
Definition at line 1206 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI RuntimeServiceSetVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes, | ||
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
This code sets variable in storage blocks (Volatile or Non-Volatile).
Caution: This function may receive untrusted input. The data size and data are external input, so this function will validate it carefully to avoid buffer overflow.
[in] | VariableName | Name of Variable to be found. |
[in] | VendorGuid | Variable vendor GUID. |
[in] | Attributes | Attribute value of the variable found |
[in] | DataSize | Size of Data found. If size is less than the data, this value contains the required size. |
[in] | Data | Data pointer. |
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, name, and GUID was supplied, or the DataSize exceeds the maximum allowed. |
EFI_INVALID_PARAMETER | VariableName is an empty 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 retrieved due to a hardware error. |
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 written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo does NOT pass the validation check carried out by the firmware. |
EFI_NOT_FOUND | The variable trying to be updated or deleted was not found. |
EFI_UNSUPPORTED | This call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table. |
Definition at line 1110 of file VariableSmmRuntimeDxe.c.
EFI_STATUS SendCommunicateBuffer | ( | IN UINTN | DataSize | ) |
Send the data in communicate buffer to SMM.
[in] | DataSize | This size of the function header and the data. |
EFI_SUCCESS | Success is returned from the functin in SMM. |
Others | Failure is returned from the function in SMM. |
Definition at line 196 of file VariableSmmRuntimeDxe.c.
EFI_STATUS SendRuntimeVariableCacheContextToSmm | ( | VOID | ) |
Sends the runtime variable cache context information to SMM.
EFI_SUCCESS | Retrieved the size successfully. |
EFI_INVALID_PARAMETER | TotalNvStorageSize parameter is NULL. |
EFI_OUT_OF_RESOURCES | The memory resources needed for a CommBuffer are not available. |
Others | Could not retrieve the size successfully.; |
Definition at line 1596 of file VariableSmmRuntimeDxe.c.
Initialize variable service and install Variable Architectural protocol.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 1667 of file VariableSmmRuntimeDxe.c.
SMM Non-Volatile variable write service is ready notify event handler.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 1767 of file VariableSmmRuntimeDxe.c.
VOID SyncRuntimeCache | ( | VOID | ) |
Signals SMM to synchronize any pending variable updates with the runtime cache(s).
Definition at line 470 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI VarCheckRegisterSetVariableCheckHandler | ( | IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER | Handler | ) |
Register SetVariable check handler.
[in] | Handler | Pointer to check handler. |
EFI_SUCCESS | The SetVariable check handler was registered successfully. |
EFI_INVALID_PARAMETER | Handler is NULL. |
EFI_ACCESS_DENIED | EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has already been signaled. |
EFI_OUT_OF_RESOURCES | There is not enough resource for the SetVariable check handler register request. |
EFI_UNSUPPORTED | This interface is not implemented. For example, it is unsupported in VarCheck protocol if both VarCheck and SmmVarCheck protocols are present. |
Definition at line 305 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI VarCheckVariablePropertyGet | ( | IN CHAR16 * | Name, |
IN EFI_GUID * | Guid, | ||
OUT VAR_CHECK_VARIABLE_PROPERTY * | VariableProperty | ||
) |
Variable property get.
[in] | Name | Pointer to the variable name. |
[in] | Guid | Pointer to the vendor GUID. |
[out] | VariableProperty | Pointer to the output variable property. |
EFI_SUCCESS | The property of variable specified by the Name and Guid was got successfully. |
EFI_INVALID_PARAMETER | Name, Guid or VariableProperty is NULL, or Name is an empty string. |
EFI_NOT_FOUND | The property of variable specified by the Name and Guid was not found. |
Definition at line 405 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI VarCheckVariablePropertySet | ( | IN CHAR16 * | Name, |
IN EFI_GUID * | Guid, | ||
IN VAR_CHECK_VARIABLE_PROPERTY * | VariableProperty | ||
) |
Variable property set.
[in] | Name | Pointer to the variable name. |
[in] | Guid | Pointer to the vendor GUID. |
[in] | VariableProperty | Pointer to the input variable property. |
EFI_SUCCESS | The property of variable specified by the Name and Guid was set successfully. |
EFI_INVALID_PARAMETER | Name, Guid or VariableProperty is NULL, or Name is an empty string, or the fields of VariableProperty are not valid. |
EFI_ACCESS_DENIED | EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has already been signaled. |
EFI_OUT_OF_RESOURCES | There is not enough resource for the variable property set request. |
Definition at line 329 of file VariableSmmRuntimeDxe.c.
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.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 1340 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI VariableLockRequestToLock | ( | IN CONST EDKII_VARIABLE_LOCK_PROTOCOL * | This, |
IN CHAR16 * | VariableName, | ||
IN EFI_GUID * | VendorGuid | ||
) |
=== CODE UNDER TEST ===========================================================================
Mark a variable that will become read-only after leaving the DXE phase of execution.
[in] | This | The VARIABLE_LOCK_PROTOCOL instance. |
[in] | VariableName | A pointer to the variable name that will be made read-only subsequently. |
[in] | VendorGuid | A pointer to the vendor GUID that will be made read-only subsequently. |
EFI_SUCCESS | The variable specified by the VariableName and the VendorGuid was marked as pending to be read-only. |
EFI_INVALID_PARAMETER | VariableName or VendorGuid is NULL. Or VariableName is an empty string. |
EFI_ACCESS_DENIED | EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has already been signaled. |
EFI_OUT_OF_RESOURCES | There is not enough resource to hold the lock request. |
Definition at line 236 of file VariableSmmRuntimeDxe.c.
EFI_STATUS EFIAPI VariablePolicySmmDxeMain | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The logic to initialize the VariablePolicy engine is in its own file.
The driver's entry point.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point executed successfully. |
other | Some error occured when executing this entry point. |
Definition at line 816 of file VariablePolicySmmDxe.c.
EFI_STATUS EFIAPI VariableSmmRuntimeInitialize | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Variable Driver main entry point. The Variable driver places the 4 EFI runtime services in the EFI System Table and installs arch protocols for variable read and write services being available. It also registers a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | Variable service successfully initialized. |
Definition at line 1814 of file VariableSmmRuntimeDxe.c.
EFI_HANDLE mHandle = NULL |
Handle for the Capsule Update Policy Protocol
Definition at line 47 of file VariableSmmRuntimeDxe.c.
BOOLEAN mIsRuntimeCacheEnabled = FALSE |
Definition at line 61 of file VariableSmmRuntimeDxe.c.
EFI_MM_COMMUNICATION2_PROTOCOL* mMmCommunication2 = NULL |
Definition at line 50 of file VariableSmmRuntimeDxe.c.
EFI_SMM_VARIABLE_PROTOCOL* mSmmVariable = NULL |
Definition at line 48 of file VariableSmmRuntimeDxe.c.
EDKII_VAR_CHECK_PROTOCOL mVarCheck |
Definition at line 59 of file VariableSmmRuntimeDxe.c.
BOOLEAN mVariableAuthFormat |
Definition at line 56 of file VariableSmmRuntimeDxe.c.
UINT8* mVariableBuffer = NULL |
Definition at line 51 of file VariableSmmRuntimeDxe.c.
UINTN mVariableBufferPayloadSize |
Definition at line 55 of file VariableSmmRuntimeDxe.c.
UINT8* mVariableBufferPhysical = NULL |
Definition at line 52 of file VariableSmmRuntimeDxe.c.
UINTN mVariableBufferSize |
Definition at line 54 of file VariableSmmRuntimeDxe.c.
VARIABLE_INFO_ENTRY* mVariableInfo = NULL |
Definition at line 53 of file VariableSmmRuntimeDxe.c.
EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock |
Definition at line 58 of file VariableSmmRuntimeDxe.c.
VARIABLE_RUNTIME_CACHE_INFO mVariableRtCacheInfo |
Definition at line 60 of file VariableSmmRuntimeDxe.c.
EFI_LOCK mVariableServicesLock |
Definition at line 57 of file VariableSmmRuntimeDxe.c.
Definition at line 49 of file VariableSmmRuntimeDxe.c.