30#include <Library/VariablePolicyLib.h>
39BOOLEAN mAtRuntime =
FALSE;
40UINT8 *mVariableBufferPayload =
NULL;
41UINTN mVariableBufferPayloadSize;
53 IN CHAR16 *VariableName,
81 IN CHAR16 *VariableName,
106 VariableServiceGetVariable,
206 OUT VOID **FtwProtocol
214 Status = gMmst->MmLocateProtocol (
215 &gEfiSmmFaultTolerantWriteProtocolGuid,
243 return gMmst->MmHandleProtocol (
245 &gEfiSmmFirmwareVolumeBlockProtocolGuid,
274 if ((NumberHandles ==
NULL) || (Buffer ==
NULL)) {
275 return EFI_INVALID_PARAMETER;
281 Status = gMmst->MmLocateHandle (
283 &gEfiSmmFirmwareVolumeBlockProtocolGuid,
288 if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
289 return EFI_NOT_FOUND;
293 if (*Buffer ==
NULL) {
294 return EFI_OUT_OF_RESOURCES;
297 Status = gMmst->MmLocateHandle (
299 &gEfiSmmFirmwareVolumeBlockProtocolGuid,
305 *NumberHandles = BufferSize /
sizeof (
EFI_HANDLE);
306 if (EFI_ERROR (Status)) {
343 UINTN StatisticsInfoSize;
345 UINTN InfoNameMaxSize;
348 if (InfoEntry ==
NULL) {
349 return EFI_INVALID_PARAMETER;
353 if (VariableInfo ==
NULL) {
354 return EFI_UNSUPPORTED;
358 if (*InfoSize < StatisticsInfoSize) {
359 *InfoSize = StatisticsInfoSize;
360 return EFI_BUFFER_TOO_SMALL;
363 InfoName = (CHAR16 *)(InfoEntry + 1);
366 CopyGuid (&VendorGuid, &InfoEntry->VendorGuid);
374 if (*InfoSize < StatisticsInfoSize) {
375 *InfoSize = StatisticsInfoSize;
376 return EFI_BUFFER_TOO_SMALL;
381 *InfoSize = StatisticsInfoSize;
388 while (VariableInfo !=
NULL) {
391 if (NameSize <= InfoNameMaxSize) {
396 VariableInfo = VariableInfo->
Next;
402 VariableInfo = VariableInfo->
Next;
405 if (VariableInfo ==
NULL) {
415 if (*InfoSize < StatisticsInfoSize) {
416 *InfoSize = StatisticsInfoSize;
417 return EFI_BUFFER_TOO_SMALL;
422 *InfoSize = StatisticsInfoSize;
457 IN CONST VOID *RegisterContext,
458 IN OUT VOID *CommBuffer,
476 UINTN NameBufferSize;
477 UINTN CommBufferPayloadSize;
478 UINTN TempCommBufferSize;
483 if ((CommBuffer ==
NULL) || (CommBufferSize ==
NULL)) {
487 TempCommBufferSize = *CommBufferSize;
490 DEBUG ((DEBUG_ERROR,
"SmmVariableHandler: SMM communication buffer size invalid!\n"));
495 if (CommBufferPayloadSize > mVariableBufferPayloadSize) {
496 DEBUG ((DEBUG_ERROR,
"SmmVariableHandler: SMM communication buffer payload size invalid!\n"));
501 DEBUG ((DEBUG_ERROR,
"SmmVariableHandler: SMM Primary Buffer (CommBuffer) is not valid!\n"));
506 switch (SmmVariableFunctionHeader->Function) {
507 case SMM_VARIABLE_FUNCTION_GET_VARIABLE:
509 DEBUG ((DEBUG_ERROR,
"GetVariable: SMM communication buffer size invalid!\n"));
516 CopyMem (mVariableBufferPayload, SmmVariableFunctionHeader->Data, CommBufferPayloadSize);
524 Status = EFI_ACCESS_DENIED;
529 + SmmVariableHeader->DataSize + SmmVariableHeader->NameSize;
534 if (InfoSize > CommBufferPayloadSize) {
535 DEBUG ((DEBUG_ERROR,
"GetVariable: Data size exceed communication buffer size limit!\n"));
536 Status = EFI_ACCESS_DENIED;
546 if ((SmmVariableHeader->NameSize < sizeof (CHAR16)) || (SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L
'\0')) {
550 Status = EFI_ACCESS_DENIED;
554 Status = VariableServiceGetVariable (
555 SmmVariableHeader->Name,
556 &SmmVariableHeader->Guid,
557 &SmmVariableHeader->Attributes,
558 &SmmVariableHeader->DataSize,
559 (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize
561 CopyMem (SmmVariableFunctionHeader->Data, mVariableBufferPayload, CommBufferPayloadSize);
564 case SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME:
566 DEBUG ((DEBUG_ERROR,
"GetNextVariableName: SMM communication buffer size invalid!\n"));
573 CopyMem (mVariableBufferPayload, SmmVariableFunctionHeader->Data, CommBufferPayloadSize);
579 Status = EFI_ACCESS_DENIED;
588 if (InfoSize > CommBufferPayloadSize) {
589 DEBUG ((DEBUG_ERROR,
"GetNextVariableName: Data size exceed communication buffer size limit!\n"));
590 Status = EFI_ACCESS_DENIED;
595 if ((NameBufferSize <
sizeof (CHAR16)) || (GetNextVariableName->Name[NameBufferSize/sizeof (CHAR16) - 1] != L
'\0')) {
599 Status = EFI_ACCESS_DENIED;
604 &GetNextVariableName->NameSize,
605 GetNextVariableName->Name,
606 &GetNextVariableName->Guid
608 CopyMem (SmmVariableFunctionHeader->Data, mVariableBufferPayload, CommBufferPayloadSize);
611 case SMM_VARIABLE_FUNCTION_SET_VARIABLE:
613 DEBUG ((DEBUG_ERROR,
"SetVariable: SMM communication buffer size invalid!\n"));
620 CopyMem (mVariableBufferPayload, SmmVariableFunctionHeader->Data, CommBufferPayloadSize);
628 Status = EFI_ACCESS_DENIED;
633 + SmmVariableHeader->DataSize + SmmVariableHeader->NameSize;
639 if (InfoSize > CommBufferPayloadSize) {
640 DEBUG ((DEBUG_ERROR,
"SetVariable: Data size exceed communication buffer size limit!\n"));
641 Status = EFI_ACCESS_DENIED;
651 if ((SmmVariableHeader->NameSize < sizeof (CHAR16)) || (SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L
'\0')) {
655 Status = EFI_ACCESS_DENIED;
660 SmmVariableHeader->Name,
661 &SmmVariableHeader->Guid,
662 SmmVariableHeader->Attributes,
663 SmmVariableHeader->DataSize,
664 (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize
668 case SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO:
670 DEBUG ((DEBUG_ERROR,
"QueryVariableInfo: SMM communication buffer size invalid!\n"));
677 QueryVariableInfo->Attributes,
678 &QueryVariableInfo->MaximumVariableStorageSize,
679 &QueryVariableInfo->RemainingVariableStorageSize,
680 &QueryVariableInfo->MaximumVariableSize
684 case SMM_VARIABLE_FUNCTION_GET_PAYLOAD_SIZE:
686 DEBUG ((DEBUG_ERROR,
"GetPayloadSize: SMM communication buffer size invalid!\n"));
691 GetPayloadSize->VariablePayloadSize = mVariableBufferPayloadSize;
695 case SMM_VARIABLE_FUNCTION_READY_TO_BOOT:
697 Status = EFI_UNSUPPORTED;
703 Status = LockVariablePolicy ();
717 case SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE:
722 case SMM_VARIABLE_FUNCTION_GET_STATISTICS:
740 case SMM_VARIABLE_FUNCTION_LOCK_VARIABLE:
742 Status = EFI_ACCESS_DENIED;
747 VariableToLock->Name,
748 &VariableToLock->Guid
753 case SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_SET:
755 Status = EFI_ACCESS_DENIED;
759 CommVariableProperty->Name,
760 &CommVariableProperty->Guid,
761 &CommVariableProperty->VariableProperty
766 case SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_GET:
768 DEBUG ((DEBUG_ERROR,
"VarCheckVariablePropertyGet: SMM communication buffer size invalid!\n"));
775 CopyMem (mVariableBufferPayload, SmmVariableFunctionHeader->Data, CommBufferPayloadSize);
781 Status = EFI_ACCESS_DENIED;
790 if (InfoSize > CommBufferPayloadSize) {
791 DEBUG ((DEBUG_ERROR,
"VarCheckVariablePropertyGet: Data size exceed communication buffer size limit!\n"));
792 Status = EFI_ACCESS_DENIED;
802 if ((CommVariableProperty->NameSize < sizeof (CHAR16)) || (CommVariableProperty->Name[CommVariableProperty->NameSize/sizeof (CHAR16) - 1] != L
'\0')) {
806 Status = EFI_ACCESS_DENIED;
811 CommVariableProperty->Name,
812 &CommVariableProperty->Guid,
813 &CommVariableProperty->VariableProperty
815 CopyMem (SmmVariableFunctionHeader->Data, mVariableBufferPayload, CommBufferPayloadSize);
817 case SMM_VARIABLE_FUNCTION_INIT_RUNTIME_VARIABLE_CACHE_CONTEXT:
819 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: SMM communication buffer size invalid!\n"));
820 Status = EFI_ACCESS_DENIED;
825 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Cannot init context after end of DXE!\n"));
826 Status = EFI_ACCESS_DENIED;
833 CopyMem (mVariableBufferPayload, SmmVariableFunctionHeader->Data, CommBufferPayloadSize);
839 if ((RuntimeVariableCacheContext->RuntimeVolatileCache ==
NULL) ||
840 (RuntimeVariableCacheContext->RuntimeNvCache ==
NULL) ||
841 (RuntimeVariableCacheContext->PendingUpdate ==
NULL) ||
842 (RuntimeVariableCacheContext->ReadLock ==
NULL) ||
843 (RuntimeVariableCacheContext->HobFlushComplete ==
NULL))
845 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Required runtime cache buffer is NULL!\n"));
846 Status = EFI_ACCESS_DENIED;
853 if (((RuntimeVariableCacheContext->RuntimeHobCache !=
NULL) &&
858 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: A runtime cache buffer size is invalid!\n"));
859 Status = EFI_ACCESS_DENIED;
866 if ((RuntimeVariableCacheContext->RuntimeHobCache !=
NULL) &&
868 (
UINTN)RuntimeVariableCacheContext->RuntimeHobCache,
869 (
UINTN)RuntimeVariableCacheContext->RuntimeHobCache->
Size
872 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime HOB cache buffer in SMRAM or overflow!\n"));
873 Status = EFI_ACCESS_DENIED;
878 (
UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache,
879 (
UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache->
Size
882 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime volatile cache buffer in SMRAM or overflow!\n"));
883 Status = EFI_ACCESS_DENIED;
888 (
UINTN)RuntimeVariableCacheContext->RuntimeNvCache,
889 (
UINTN)RuntimeVariableCacheContext->RuntimeNvCache->
Size
892 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime non-volatile cache buffer in SMRAM or overflow!\n"));
893 Status = EFI_ACCESS_DENIED;
898 (
UINTN)RuntimeVariableCacheContext->PendingUpdate,
899 sizeof (*(RuntimeVariableCacheContext->PendingUpdate))
902 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime cache pending update buffer in SMRAM or overflow!\n"));
903 Status = EFI_ACCESS_DENIED;
908 (
UINTN)RuntimeVariableCacheContext->ReadLock,
909 sizeof (*(RuntimeVariableCacheContext->ReadLock))
912 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime cache read lock buffer in SMRAM or overflow!\n"));
913 Status = EFI_ACCESS_DENIED;
918 (
UINTN)RuntimeVariableCacheContext->HobFlushComplete,
919 sizeof (*(RuntimeVariableCacheContext->HobFlushComplete))
922 DEBUG ((DEBUG_ERROR,
"InitRuntimeVariableCacheContext: Runtime cache HOB flush complete buffer in SMRAM or overflow!\n"));
923 Status = EFI_ACCESS_DENIED;
927 VariableCacheContext = &mVariableModuleGlobal->VariableGlobal.VariableRuntimeCacheContext;
928 VariableCacheContext->VariableRuntimeHobCache.Store = RuntimeVariableCacheContext->RuntimeHobCache;
929 VariableCacheContext->VariableRuntimeVolatileCache.Store = RuntimeVariableCacheContext->RuntimeVolatileCache;
930 VariableCacheContext->VariableRuntimeNvCache.Store = RuntimeVariableCacheContext->RuntimeNvCache;
931 VariableCacheContext->PendingUpdate = RuntimeVariableCacheContext->PendingUpdate;
932 VariableCacheContext->ReadLock = RuntimeVariableCacheContext->ReadLock;
933 VariableCacheContext->HobFlushComplete = RuntimeVariableCacheContext->HobFlushComplete;
936 VariableCacheContext->VariableRuntimeHobCache.PendingUpdateOffset = 0;
937 VariableCacheContext->VariableRuntimeHobCache.PendingUpdateLength = 0;
938 if ((mVariableModuleGlobal->VariableGlobal.HobVariableBase > 0) &&
939 (VariableCacheContext->VariableRuntimeHobCache.Store !=
NULL))
942 VariableCacheContext->VariableRuntimeHobCache.PendingUpdateLength = (UINT32)((
UINTN)
GetEndPointer (VariableCache) - (
UINTN)VariableCache);
947 VariableCacheContext->VariableRuntimeVolatileCache.PendingUpdateOffset = 0;
948 VariableCacheContext->VariableRuntimeVolatileCache.PendingUpdateLength = (UINT32)((
UINTN)
GetEndPointer (VariableCache) - (
UINTN)VariableCache);
952 VariableCacheContext->VariableRuntimeNvCache.PendingUpdateOffset = 0;
953 VariableCacheContext->VariableRuntimeNvCache.PendingUpdateLength = (UINT32)((
UINTN)
GetEndPointer (VariableCache) - (
UINTN)VariableCache);
956 *(VariableCacheContext->PendingUpdate) =
TRUE;
957 *(VariableCacheContext->ReadLock) =
FALSE;
958 *(VariableCacheContext->HobFlushComplete) =
FALSE;
962 case SMM_VARIABLE_FUNCTION_SYNC_RUNTIME_CACHE:
965 case SMM_VARIABLE_FUNCTION_GET_RUNTIME_CACHE_INFO:
967 DEBUG ((DEBUG_ERROR,
"GetRuntimeCacheInfo: SMM communication buffer size invalid!\n"));
973 if (mVariableModuleGlobal->VariableGlobal.HobVariableBase > 0) {
984 GetRuntimeCacheInfo->AuthenticatedVariableUsage = mVariableModuleGlobal->VariableGlobal.AuthFormat;
990 Status = EFI_UNSUPPORTED;
995 SmmVariableFunctionHeader->ReturnStatus = Status;
1020 DEBUG ((DEBUG_INFO,
"[Variable]SMM_END_OF_DXE is signaled\n"));
1022 Status = LockVariablePolicy ();
1030 if (
PcdGetBool (PcdReclaimVariableSpaceAtEndOfDxe)) {
1049 if (EFI_ERROR (Status)) {
1050 DEBUG ((DEBUG_ERROR,
"Variable write service initialization failed. Status = %r\n", Status));
1086 UINTN FtwMaxBlockSize;
1087 UINT32 NvStorageVariableSize;
1088 UINT64 NvStorageVariableSize64;
1090 if (mVariableModuleGlobal->FvbInstance !=
NULL) {
1098 if (EFI_ERROR (Status)) {
1109 ASSERT (NvStorageVariableBase != 0);
1112 Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);
1113 if (!EFI_ERROR (Status)) {
1114 ASSERT (NvStorageVariableSize <= FtwMaxBlockSize);
1120 mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase = VariableStoreBase;
1126 if (EFI_ERROR (Status)) {
1127 return EFI_NOT_FOUND;
1130 mVariableModuleGlobal->FvbInstance = FvbProtocol;
1157 VOID *SmmFtwRegistration;
1158 VOID *SmmEndOfDxeRegistration;
1169 VariableHandle =
NULL;
1172 &gEfiSmmVariableProtocolGuid,
1180 &gEdkiiSmmVarCheckProtocolGuid,
1192 mVariableBufferPayloadSize,
1193 (VOID **)&mVariableBufferPayload
1200 VariableHandle =
NULL;
1201 Status = gMmst->MmiHandlerRegister (
SmmVariableHandler, &gEfiSmmVariableProtocolGuid, &VariableHandle);
1212 Status = gMmst->MmRegisterProtocolNotify (
1213 &gEfiMmEndOfDxeProtocolGuid,
1215 &SmmEndOfDxeRegistration
1219 if (!
PcdGetBool (PcdEmuVariableNvModeEnable)) {
1223 Status = gMmst->MmRegisterProtocolNotify (
1224 &gEfiSmmFaultTolerantWriteProtocolGuid,
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define PcdGetBool(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
BOOLEAN VariableSmmIsPrimaryBufferValid(IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
VOID MorLockInitAtEndOfDxe(VOID)
VOID VariableNotifySmmReady(VOID)
BOOLEAN VariableSmmIsNonPrimaryBufferValid(IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
VOID VariableNotifySmmWriteReady(VOID)
VOID VariableSpeculationBarrier(VOID)
RETURN_STATUS EFIAPI SafeUint64ToUint32(IN UINT64 Operand, OUT UINT32 *Result)
EFI_STATUS EFIAPI Lock(IN EFI_SMM_ACCESS2_PROTOCOL *This)
#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE
UINT64 EFI_PHYSICAL_ADDRESS
VARIABLE_HEADER * GetEndPointer(IN VARIABLE_STORE_HEADER *VarStoreHeader)
UINTN GetVariableHeaderSize(IN BOOLEAN AuthFlag)
EFI_FIRMWARE_VOLUME_HEADER * mNvFvHeaderCache
VARIABLE_INFO_ENTRY * gVariableInfo
UINTN GetMaxVariableSize(VOID)
VOID InitializeVariableQuota(VOID)
EFI_STATUS VariableWriteServiceInitialize(VOID)
EFI_STATUS VariableCommonInitialize(VOID)
EFI_STATUS EFIAPI VariableServiceGetNextVariableName(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
VAR_CHECK_REQUEST_SOURCE mRequestSource
EFI_STATUS EFIAPI VariableServiceQueryVariableInfo(IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize)
EFI_STATUS GetFvbInfoByAddress(IN EFI_PHYSICAL_ADDRESS Address, OUT EFI_HANDLE *FvbHandle OPTIONAL, OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvbProtocol OPTIONAL)
EFI_STATUS EFIAPI VariableServiceSetVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI VarCheckVariablePropertySet(IN CHAR16 *Name, IN EFI_GUID *Guid, IN VAR_CHECK_VARIABLE_PROPERTY *VariableProperty)
EFI_STATUS EFIAPI VarCheckRegisterSetVariableCheckHandler(IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler)
EFI_STATUS EFIAPI VarCheckVariablePropertyGet(IN CHAR16 *Name, IN EFI_GUID *Guid, OUT VAR_CHECK_VARIABLE_PROPERTY *VariableProperty)
VOID ***EFIAPI VarCheckLibInitializeAtEndOfDxe(IN OUT UINTN *AddressPointerCount OPTIONAL)
EFI_STATUS EFIAPI GetVariableFlashNvStorageInfo(OUT EFI_PHYSICAL_ADDRESS *BaseAddress, OUT UINT64 *Length)
EFI_STATUS EFIAPI VariableLockRequestToLock(IN CONST EDKII_VARIABLE_LOCK_PROTOCOL *This, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
=== CODE UNDER TEST ===========================================================================
EFI_STATUS FlushPendingRuntimeVariableCacheUpdates(VOID)
EFI_STATUS EFIAPI SmmEndOfDxeCallback(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
VOID EFIAPI SecureBootHook(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
EFI_STATUS GetFvbByHandle(IN EFI_HANDLE FvBlockHandle, OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock)
EFI_LOCK * InitializeLock(IN OUT EFI_LOCK *Lock, IN EFI_TPL Priority)
EFI_STATUS EFIAPI MmVariableServiceInitialize(VOID)
VARIABLE_STORE_HEADER * mNvVariableCache
EFI_STATUS EFIAPI SmmFtwNotificationEvent(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
EFI_STATUS EFIAPI SmmVariableHandler(IN EFI_HANDLE DispatchHandle, IN CONST VOID *RegisterContext, IN OUT VOID *CommBuffer, IN OUT UINTN *CommBufferSize)
VOID ReleaseLockOnlyAtBootTime(IN EFI_LOCK *Lock)
VOID AcquireLockOnlyAtBootTime(IN EFI_LOCK *Lock)
VOID VariableWriteServiceInitializeSmm(VOID)
EFI_STATUS EFIAPI SmmVariableSetVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS GetFtwProtocol(OUT VOID **FtwProtocol)
EFI_STATUS GetFvbCountAndBuffer(OUT UINTN *NumberHandles, OUT EFI_HANDLE **Buffer)
EFI_STATUS SmmVariableGetStatistics(IN OUT VARIABLE_INFO_ENTRY *InfoEntry, IN OUT UINTN *InfoSize)
EFI_STATUS GetRuntimeCacheInfo(OUT UINTN *TotalHobStorageSize, OUT UINTN *TotalNvStorageSize, OUT UINTN *TotalVolatileStorageSize, OUT BOOLEAN *AuthenticatedVariableUsage)
EFI_INSTALL_PROTOCOL_INTERFACE MmInstallProtocolInterface
EFI_ALLOCATE_POOL MmAllocatePool
VARIABLE_INFO_ENTRY * Next
Pointer to next entry.
CHAR16 * Name
Name of Variable.
EFI_GUID VendorGuid
Guid of Variable.