51UINT8 *mVariableBuffer =
NULL;
52UINT8 *mVariableBufferPhysical =
NULL;
54UINTN mVariableBufferSize;
55UINTN mVariableBufferPayloadSize;
56BOOLEAN mVariableAuthFormat;
61BOOLEAN mIsRuntimeCacheEnabled =
FALSE;
161 OUT VOID **DataPtr OPTIONAL,
170 return EFI_INVALID_PARAMETER;
178 SmmVariableFunctionHeader->Function = Function;
179 if (DataPtr !=
NULL) {
180 *DataPtr = SmmVariableFunctionHeader->Data;
206 Status = mMmCommunication2->Communicate (
208 mVariableBufferPhysical,
216 return SmmVariableFunctionHeader->ReturnStatus;
238 IN CHAR16 *VariableName,
243 UINTN VariableNameSize;
247 if ((VariableName ==
NULL) || (VariableName[0] == 0) || (VendorGuid ==
NULL)) {
248 return EFI_INVALID_PARAMETER;
251 VariableNameSize =
StrSize (VariableName);
252 VariableToLock =
NULL;
258 return EFI_INVALID_PARAMETER;
268 Status =
InitCommunicateBuffer ((VOID **)&VariableToLock, PayloadSize, SMM_VARIABLE_FUNCTION_LOCK_VARIABLE);
269 if (EFI_ERROR (Status)) {
273 ASSERT (VariableToLock !=
NULL);
275 CopyGuid (&VariableToLock->Guid, VendorGuid);
276 VariableToLock->NameSize = VariableNameSize;
277 CopyMem (VariableToLock->Name, VariableName, VariableToLock->NameSize);
306 IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler
309 return EFI_UNSUPPORTED;
336 UINTN VariableNameSize;
340 if ((Name ==
NULL) || (Name[0] == 0) || (Guid ==
NULL)) {
341 return EFI_INVALID_PARAMETER;
344 if (VariableProperty ==
NULL) {
345 return EFI_INVALID_PARAMETER;
348 if (VariableProperty->Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) {
349 return EFI_INVALID_PARAMETER;
352 VariableNameSize =
StrSize (Name);
353 CommVariableProperty =
NULL;
359 return EFI_INVALID_PARAMETER;
369 Status =
InitCommunicateBuffer ((VOID **)&CommVariableProperty, PayloadSize, SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_SET);
370 if (EFI_ERROR (Status)) {
374 ASSERT (CommVariableProperty !=
NULL);
376 CopyGuid (&CommVariableProperty->Guid, Guid);
377 CopyMem (&CommVariableProperty->VariableProperty, VariableProperty, sizeof (*VariableProperty));
378 CommVariableProperty->NameSize = VariableNameSize;
379 CopyMem (CommVariableProperty->Name, Name, CommVariableProperty->NameSize);
412 UINTN VariableNameSize;
416 if ((Name ==
NULL) || (Name[0] == 0) || (Guid ==
NULL)) {
417 return EFI_INVALID_PARAMETER;
420 if (VariableProperty ==
NULL) {
421 return EFI_INVALID_PARAMETER;
424 VariableNameSize =
StrSize (Name);
425 CommVariableProperty =
NULL;
431 return EFI_INVALID_PARAMETER;
441 Status =
InitCommunicateBuffer ((VOID **)&CommVariableProperty, PayloadSize, SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_GET);
442 if (EFI_ERROR (Status)) {
446 ASSERT (CommVariableProperty !=
NULL);
448 CopyGuid (&CommVariableProperty->Guid, Guid);
449 CommVariableProperty->NameSize = VariableNameSize;
450 CopyMem (CommVariableProperty->Name, Name, CommVariableProperty->NameSize);
457 CopyMem (VariableProperty, &CommVariableProperty->VariableProperty, sizeof (*VariableProperty));
536 IN CHAR16 *VariableName,
538 OUT UINT32 *Attributes OPTIONAL,
540 OUT VOID *Data OPTIONAL
546 VARIABLE_STORE_TYPE StoreType;
550 Status = EFI_NOT_FOUND;
553 if ((VariableName ==
NULL) || (VendorGuid ==
NULL) || (DataSize ==
NULL)) {
554 return EFI_INVALID_PARAMETER;
557 ZeroMem (&RtPtrTrack,
sizeof (RtPtrTrack));
565 ASSERT (!(CacheInfoFlag->
ReadLock));
580 for (StoreType = (VARIABLE_STORE_TYPE)0; StoreType < VariableStoreTypeMax; StoreType++) {
581 if (VariableStoreList[StoreType] ==
NULL) {
586 RtPtrTrack.EndPtr =
GetEndPointer (VariableStoreList[StoreType]);
587 RtPtrTrack.Volatile = (BOOLEAN)(StoreType == VariableStoreTypeVolatile);
589 Status =
FindVariableEx (VariableName, VendorGuid,
FALSE, &RtPtrTrack, mVariableAuthFormat);
590 if (!EFI_ERROR (Status)) {
595 if (!EFI_ERROR (Status)) {
600 ASSERT (TempDataSize != 0);
602 if (*DataSize >= TempDataSize) {
604 Status = EFI_INVALID_PARAMETER;
609 *DataSize = TempDataSize;
616 *DataSize = TempDataSize;
617 Status = EFI_BUFFER_TOO_SMALL;
624 if ((Status ==
EFI_SUCCESS) || (Status == EFI_BUFFER_TOO_SMALL)) {
625 if ((Attributes !=
NULL) && (RtPtrTrack.CurrPtr !=
NULL)) {
655 IN CHAR16 *VariableName,
657 OUT UINT32 *Attributes OPTIONAL,
659 OUT VOID *Data OPTIONAL
666 UINTN VariableNameSize;
668 if ((VariableName ==
NULL) || (VendorGuid ==
NULL) || (DataSize ==
NULL)) {
669 return EFI_INVALID_PARAMETER;
672 TempDataSize = *DataSize;
673 VariableNameSize =
StrSize (VariableName);
674 SmmVariableHeader =
NULL;
680 return EFI_INVALID_PARAMETER;
696 Status =
InitCommunicateBuffer ((VOID **)&SmmVariableHeader, PayloadSize, SMM_VARIABLE_FUNCTION_GET_VARIABLE);
697 if (EFI_ERROR (Status)) {
701 ASSERT (SmmVariableHeader !=
NULL);
703 CopyGuid (&SmmVariableHeader->Guid, VendorGuid);
704 SmmVariableHeader->DataSize = TempDataSize;
705 SmmVariableHeader->NameSize = VariableNameSize;
706 if (Attributes ==
NULL) {
707 SmmVariableHeader->Attributes = 0;
709 SmmVariableHeader->Attributes = *Attributes;
712 CopyMem (SmmVariableHeader->Name, VariableName, SmmVariableHeader->NameSize);
722 if ((Status ==
EFI_SUCCESS) || (Status == EFI_BUFFER_TOO_SMALL)) {
727 *DataSize = SmmVariableHeader->DataSize;
730 if (Attributes !=
NULL) {
731 *Attributes = SmmVariableHeader->Attributes;
734 if (EFI_ERROR (Status)) {
739 CopyMem (Data, (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, SmmVariableHeader->DataSize);
741 Status = EFI_INVALID_PARAMETER;
779 IN CHAR16 *VariableName,
781 OUT UINT32 *Attributes OPTIONAL,
788 if ((VariableName ==
NULL) || (VendorGuid ==
NULL) || (DataSize ==
NULL)) {
789 return EFI_INVALID_PARAMETER;
792 if (VariableName[0] == 0) {
793 return EFI_NOT_FOUND;
797 if (mIsRuntimeCacheEnabled) {
800 Status =
FindVariableInSmm (VariableName, VendorGuid, Attributes, DataSize, Data);
836 IN OUT CHAR16 *VariableName,
846 Status = EFI_NOT_FOUND;
855 ASSERT (!(CacheInfoFlag->
ReadLock));
877 if (!EFI_ERROR (Status)) {
879 ASSERT (VarNameSize != 0);
880 if (VarNameSize <= *VariableNameSize) {
885 Status = EFI_BUFFER_TOO_SMALL;
888 *VariableNameSize = VarNameSize;
925 IN OUT CHAR16 *VariableName,
932 UINTN OutVariableNameSize;
933 UINTN InVariableNameSize;
935 OutVariableNameSize = *VariableNameSize;
936 InVariableNameSize =
StrSize (VariableName);
937 SmmGetNextVariableName =
NULL;
943 return EFI_INVALID_PARAMETER;
962 Status =
InitCommunicateBuffer ((VOID **)&SmmGetNextVariableName, PayloadSize, SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME);
963 if (EFI_ERROR (Status)) {
967 ASSERT (SmmGetNextVariableName !=
NULL);
972 SmmGetNextVariableName->NameSize = OutVariableNameSize;
974 CopyGuid (&SmmGetNextVariableName->Guid, VendorGuid);
978 CopyMem (SmmGetNextVariableName->Name, VariableName, InVariableNameSize);
979 if (OutVariableNameSize > InVariableNameSize) {
980 ZeroMem ((UINT8 *)SmmGetNextVariableName->Name + InVariableNameSize, OutVariableNameSize - InVariableNameSize);
991 if ((Status ==
EFI_SUCCESS) || (Status == EFI_BUFFER_TOO_SMALL)) {
996 *VariableNameSize = SmmGetNextVariableName->NameSize;
999 if (EFI_ERROR (Status)) {
1003 CopyGuid (VendorGuid, &SmmGetNextVariableName->Guid);
1004 CopyMem (VariableName, SmmGetNextVariableName->Name, SmmGetNextVariableName->NameSize);
1039 IN OUT CHAR16 *VariableName,
1046 Status = EFI_NOT_FOUND;
1048 if ((VariableNameSize ==
NULL) || (VariableName ==
NULL) || (VendorGuid ==
NULL)) {
1049 return EFI_INVALID_PARAMETER;
1055 MaxLen = *VariableNameSize /
sizeof (CHAR16);
1056 if ((MaxLen == 0) || (
StrnLenS (VariableName, MaxLen) == MaxLen)) {
1061 return EFI_INVALID_PARAMETER;
1065 if (mIsRuntimeCacheEnabled) {
1111 IN CHAR16 *VariableName,
1113 IN UINT32 Attributes,
1121 UINTN VariableNameSize;
1126 if ((VariableName ==
NULL) || (VariableName[0] == 0) || (VendorGuid ==
NULL)) {
1127 return EFI_INVALID_PARAMETER;
1130 if ((DataSize != 0) && (Data ==
NULL)) {
1131 return EFI_INVALID_PARAMETER;
1134 VariableNameSize =
StrSize (VariableName);
1135 SmmVariableHeader =
NULL;
1143 return EFI_INVALID_PARAMETER;
1153 Status =
InitCommunicateBuffer ((VOID **)&SmmVariableHeader, PayloadSize, SMM_VARIABLE_FUNCTION_SET_VARIABLE);
1154 if (EFI_ERROR (Status)) {
1158 ASSERT (SmmVariableHeader !=
NULL);
1161 SmmVariableHeader->DataSize = DataSize;
1162 SmmVariableHeader->NameSize = VariableNameSize;
1163 SmmVariableHeader->Attributes = Attributes;
1164 CopyMem (SmmVariableHeader->Name, VariableName, SmmVariableHeader->NameSize);
1165 CopyMem ((UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, Data, DataSize);
1176 if (!EFI_ERROR (Status)) {
1207 IN UINT32 Attributes,
1208 OUT UINT64 *MaximumVariableStorageSize,
1209 OUT UINT64 *RemainingVariableStorageSize,
1210 OUT UINT64 *MaximumVariableSize
1217 SmmQueryVariableInfo =
NULL;
1219 if ((MaximumVariableStorageSize ==
NULL) || (RemainingVariableStorageSize ==
NULL) || (MaximumVariableSize ==
NULL) || (Attributes == 0)) {
1220 return EFI_INVALID_PARAMETER;
1230 Status =
InitCommunicateBuffer ((VOID **)&SmmQueryVariableInfo, PayloadSize, SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO);
1231 if (EFI_ERROR (Status)) {
1235 ASSERT (SmmQueryVariableInfo !=
NULL);
1237 SmmQueryVariableInfo->Attributes = Attributes;
1243 if (EFI_ERROR (Status)) {
1250 *MaximumVariableSize = SmmQueryVariableInfo->MaximumVariableSize;
1251 *MaximumVariableStorageSize = SmmQueryVariableInfo->MaximumVariableStorageSize;
1252 *RemainingVariableStorageSize = SmmQueryVariableInfo->RemainingVariableStorageSize;
1317 if (mIsRuntimeCacheEnabled &&
FeaturePcdGet (PcdVariableCollectStatistics)) {
1318 if (mVariableAuthFormat) {
1319 gBS->InstallConfigurationTable (&gEfiAuthenticatedVariableGuid, mVariableInfo);
1321 gBS->InstallConfigurationTable (&gEfiVariableGuid, mVariableInfo);
1325 gBS->CloseEvent (Event);
1347 EfiConvertPointer (EFI_OPTIONAL_PTR, (VOID **)&mVariableRtCacheInfo.CacheInfoFlagBuffer);
1375 SmmGetPayloadSize =
NULL;
1378 if (VariablePayloadSize ==
NULL) {
1379 return EFI_INVALID_PARAMETER;
1390 if (CommBuffer ==
NULL) {
1391 Status = EFI_OUT_OF_RESOURCES;
1400 SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_PAYLOAD_SIZE;
1406 Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
1409 Status = SmmVariableFunctionHeader->ReturnStatus;
1410 if (EFI_ERROR (Status)) {
1417 *VariablePayloadSize = SmmGetPayloadSize->VariablePayloadSize;
1420 if (CommBuffer !=
NULL) {
1446 OUT UINTN *TotalVolatileStorageSize,
1447 OUT BOOLEAN *AuthenticatedVariableUsage
1457 SmmGetRuntimeCacheInfo =
NULL;
1458 CommBuffer = mVariableBuffer;
1460 if ((TotalHobStorageSize ==
NULL) || (TotalNvStorageSize ==
NULL) || (TotalVolatileStorageSize ==
NULL) || (AuthenticatedVariableUsage ==
NULL)) {
1461 return EFI_INVALID_PARAMETER;
1464 if (CommBuffer ==
NULL) {
1465 return EFI_OUT_OF_RESOURCES;
1471 ZeroMem (CommBuffer, CommSize);
1478 SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_RUNTIME_CACHE_INFO;
1484 Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
1487 Status = EFI_BAD_BUFFER_SIZE;
1491 Status = SmmVariableFunctionHeader->ReturnStatus;
1492 if (EFI_ERROR (Status)) {
1499 *TotalHobStorageSize = SmmGetRuntimeCacheInfo->TotalHobStorageSize;
1500 *TotalNvStorageSize = SmmGetRuntimeCacheInfo->TotalNvStorageSize;
1501 *TotalVolatileStorageSize = SmmGetRuntimeCacheInfo->TotalVolatileStorageSize;
1502 *AuthenticatedVariableUsage = SmmGetRuntimeCacheInfo->AuthenticatedVariableUsage;
1519 IN UINTN TotalVariableCacheSize
1522 if (TotalVariableCacheSize > 0) {
1525 SetMem32 ((VOID *)VariableCacheBuffer, TotalVariableCacheSize, (UINT32)0xFFFFFFFF);
1527 VariableCacheBuffer->Size = (UINT32)TotalVariableCacheSize;
1529 VariableCacheBuffer->State = VARIABLE_STORE_HEALTHY;
1548 UINTN ExpectedHobCacheSize;
1549 UINTN ExpectedNvCacheSize;
1550 UINTN ExpectedVolatileCacheSize;
1551 UINTN AllocatedHobCacheSize;
1552 UINTN AllocatedNvCacheSize;
1553 UINTN AllocatedVolatileCacheSize;
1560 &ExpectedHobCacheSize,
1561 &ExpectedNvCacheSize,
1562 &ExpectedVolatileCacheSize,
1563 &mVariableAuthFormat
1565 if (!EFI_ERROR (Status)) {
1566 VariableRuntimeCacheInfo = GET_GUID_HOB_DATA (RuntimeCacheInfoGuidHob);
1569 AllocatedVolatileCacheSize =
EFI_PAGES_TO_SIZE ((
UINTN)VariableRuntimeCacheInfo->RuntimeVolatileCachePages);
1572 (AllocatedHobCacheSize >= ExpectedHobCacheSize) &&
1573 (AllocatedNvCacheSize >= ExpectedNvCacheSize) &&
1574 (AllocatedVolatileCacheSize >= ExpectedVolatileCacheSize)
1607 SmmRuntimeVarCacheContext =
NULL;
1608 CommBuffer = mVariableBuffer;
1610 if (CommBuffer ==
NULL) {
1611 return EFI_OUT_OF_RESOURCES;
1621 ZeroMem (CommBuffer, CommSize);
1628 SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_INIT_RUNTIME_VARIABLE_CACHE_CONTEXT;
1634 SmmRuntimeVarCacheContext->PendingUpdate = &((
CACHE_INFO_FLAG *)(
UINTN)mVariableRtCacheInfo.CacheInfoFlagBuffer)->PendingUpdate;
1635 SmmRuntimeVarCacheContext->ReadLock = &((
CACHE_INFO_FLAG *)(
UINTN)mVariableRtCacheInfo.CacheInfoFlagBuffer)->ReadLock;
1636 SmmRuntimeVarCacheContext->HobFlushComplete = &((
CACHE_INFO_FLAG *)(
UINTN)mVariableRtCacheInfo.CacheInfoFlagBuffer)->HobFlushComplete;
1641 Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
1644 Status = EFI_BAD_BUFFER_SIZE;
1648 Status = SmmVariableFunctionHeader->ReturnStatus;
1649 if (EFI_ERROR (Status)) {
1675 Status =
gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid,
NULL, (VOID **)&mSmmVariable);
1676 if (EFI_ERROR (Status)) {
1680 Status =
gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid,
NULL, (VOID **)&mMmCommunication2);
1690 ASSERT (mVariableBuffer !=
NULL);
1695 mVariableBufferPhysical = mVariableBuffer;
1698 if (GuidHob !=
NULL) {
1699 mIsRuntimeCacheEnabled =
TRUE;
1700 DEBUG ((DEBUG_INFO,
"Variable driver runtime cache is enabled.\n"));
1703 if (!EFI_ERROR (Status)) {
1705 if (!EFI_ERROR (Status)) {
1710 if (EFI_ERROR (Status)) {
1716 DEBUG ((DEBUG_INFO,
"Variable driver runtime cache is disabled.\n"));
1727 Status =
gBS->InstallProtocolInterface (
1729 &gEfiVariableArchProtocolGuid,
1736 Status =
gBS->InstallMultipleProtocolInterfaces (
1738 &gEdkiiVariableLockProtocolGuid,
1747 Status =
gBS->InstallMultipleProtocolInterfaces (
1749 &gEdkiiVarCheckProtocolGuid,
1755 gBS->CloseEvent (Event);
1778 Status =
gBS->LocateProtocol (&gSmmVariableWriteGuid,
NULL, (VOID **)&ProtocolOps);
1779 if (EFI_ERROR (Status)) {
1789 Status =
gBS->InstallProtocolInterface (
1791 &gEfiVariableWriteArchProtocolGuid,
1797 gBS->CloseEvent (Event);
1819 VOID *SmmVariableRegistration;
1820 VOID *SmmVariableWriteRegistration;
1831 &gEfiSmmVariableProtocolGuid,
1835 &SmmVariableRegistration
1842 &gSmmVariableWriteGuid,
1846 &SmmVariableWriteRegistration
1862 gBS->CreateEventEx (
1867 &gEfiEventExitBootServicesGuid,
1868 &ExitBootServiceEvent
1885 gBS->CreateEventEx (
1890 &gEfiEventVirtualAddressChangeGuid,
1891 &mVirtualAddressChangeEvent
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
UINTN EFIAPI StrnLenS(IN CONST CHAR16 *String, IN UINTN MaxSize)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI SetMem32(OUT VOID *Buffer, IN UINTN Length, IN UINT32 Value)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateRuntimePool(IN UINTN AllocationSize)
EFI_RUNTIME_SERVICES * gRT
VOID EFIAPI SecureBootHook(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define FeaturePcdGet(TokenName)
EFI_STATUS EFIAPI Lock(IN EFI_SMM_ACCESS2_PROTOCOL *This)
#define SMM_COMMUNICATE_HEADER_SIZE
#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE
#define EFI_PAGES_TO_SIZE(Pages)
EFI_STATUS EFIAPI EfiCreateEventLegacyBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *LegacyBootEvent)
VOID EFIAPI EfiReleaseLock(IN EFI_LOCK *Lock)
VOID EFIAPI EfiAcquireLock(IN EFI_LOCK *Lock)
EFI_LOCK *EFIAPI EfiInitializeLock(IN OUT EFI_LOCK *Lock, IN EFI_TPL Priority)
EFI_STATUS EFIAPI EfiCreateEventReadyToBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *ReadyToBootEvent)
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
BOOLEAN EFIAPI EfiAtRuntime(VOID)
EFI_STATUS EFIAPI EfiConvertPointer(IN UINTN DebugDisposition, IN OUT VOID **Address)
UINTN NameSizeOfVariable(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag)
VARIABLE_HEADER * GetStartPointer(IN VARIABLE_STORE_HEADER *VarStoreHeader)
UINT8 * GetVariableDataPtr(IN VARIABLE_HEADER *Variable, IN VARIABLE_HEADER *VariableHeader, IN BOOLEAN AuthFlag)
CHAR16 * GetVariableNamePtr(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag)
VARIABLE_HEADER * GetEndPointer(IN VARIABLE_STORE_HEADER *VarStoreHeader)
UINTN DataSizeOfVariable(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag)
EFI_STATUS FindVariableEx(IN VARIABLE_STORE_INFO *StoreInfo, IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack)
EFI_GUID * GetVendorGuidPtr(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag)
EFI_STATUS EFIAPI VariableServiceGetNextVariableInternal(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN VARIABLE_STORE_HEADER **VariableStoreList, OUT VARIABLE_HEADER **VariablePtr, IN BOOLEAN AuthFormat)
VOID UpdateVariableInfo(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN BOOLEAN Volatile, IN BOOLEAN Read, IN BOOLEAN Write, IN BOOLEAN Delete, IN BOOLEAN Cache, IN OUT VARIABLE_INFO_ENTRY **VariableInfo)
EFI_STATUS SendRuntimeVariableCacheContextToSmm(VOID)
EFI_STATUS SendCommunicateBuffer(IN UINTN DataSize)
EFI_STATUS EFIAPI RuntimeServiceSetVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS GetRuntimeCacheInfo(OUT UINTN *TotalHobStorageSize, OUT UINTN *TotalNvStorageSize, OUT UINTN *TotalVolatileStorageSize, OUT BOOLEAN *AuthenticatedVariableUsage)
EFI_STATUS EFIAPI VariableSmmRuntimeInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID SyncRuntimeCache(VOID)
VOID InitVariableStoreHeader(IN VARIABLE_STORE_HEADER *VariableCacheBuffer, IN UINTN TotalVariableCacheSize)
EFI_STATUS EFIAPI VarCheckVariablePropertySet(IN CHAR16 *Name, IN EFI_GUID *Guid, IN VAR_CHECK_VARIABLE_PROPERTY *VariableProperty)
VOID CheckForRuntimeCacheSync(VOID)
EFI_STATUS EFIAPI VariablePolicySmmDxeMain(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
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 RuntimeServiceQueryVariableInfo(IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize)
EFI_STATUS EFIAPI VarCheckVariablePropertyGet(IN CHAR16 *Name, IN EFI_GUID *Guid, OUT VAR_CHECK_VARIABLE_PROPERTY *VariableProperty)
EFI_STATUS GetNextVariableNameInSmm(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
EFI_STATUS EFIAPI GetVariablePayloadSize(OUT UINTN *VariablePayloadSize)
EFI_STATUS FindVariableInSmm(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL)
VOID EFIAPI OnReadyToBoot(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI RecordSecureBootPolicyVarData(VOID)
EFI_STATUS EFIAPI RuntimeServiceGetNextVariableName(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
VOID EFIAPI VariableAddressChangeEvent(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI OnExitBootServices(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS GetNextVariableNameInRuntimeCache(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
VOID ReleaseLockOnlyAtBootTime(IN EFI_LOCK *Lock)
EFI_STATUS InitVariableCache(IN EFI_HOB_GUID_TYPE *RuntimeCacheInfoGuidHob)
VOID EFIAPI SmmVariableReady(IN EFI_EVENT Event, IN VOID *Context)
VOID AcquireLockOnlyAtBootTime(IN EFI_LOCK *Lock)
EFI_STATUS InitCommunicateBuffer(OUT VOID **DataPtr OPTIONAL, IN UINTN DataSize, IN UINTN Function)
VOID EFIAPI SmmVariableWriteReady(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS FindVariableInRuntimeCache(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_PHYSICAL_ADDRESS RuntimeHobCacheBuffer
EFI_PHYSICAL_ADDRESS RuntimeNvCacheBuffer
EFI_PHYSICAL_ADDRESS RuntimeVolatileCacheBuffer