/** @file The header file for variable lock service. ;****************************************************************************** ;* Copyright (c) 2014 - 2019, Insyde Software Corp. All Rights Reserved. ;* ;* You may not reproduce, distribute, publish, display, perform, modify, adapt, ;* transmit, broadcast, present, recite, release, license or otherwise exploit ;* any part of this publication in any form, by any means, without the prior ;* written permission of Insyde Software Corporation. ;* ;****************************************************************************** */ #ifndef _VARIABLE_LOCK_H_ #define _VARIABLE_LOCK_H_ #include "Variable.h" typedef struct { LIST_ENTRY Link; EFI_GUID Guid; // CHAR16 *Name; } VARIABLE_ENTRY; /** Mark a variable that will become read-only after leaving the DXE phase of execution. @param[in] This The VARIABLE_LOCK_PROTOCOL instance. @param[in] VariableName A pointer to the variable name that will be made read-only subsequently. @param[in] VendorGuid A pointer to the vendor GUID that will be made read-only subsequently. @retval EFI_SUCCESS The variable specified by the VariableName and the VendorGuid was marked as pending to be read-only. @retval EFI_INVALID_PARAMETER VariableName or VendorGuid is NULL. Or VariableName is an empty string. @retval EFI_ACCESS_DENIED EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has already been signaled. @retval EFI_OUT_OF_RESOURCES There is not enough resource to hold the lock request. **/ EFI_STATUS EFIAPI VariableLockRequestToLock ( IN CONST EDKII_VARIABLE_LOCK_PROTOCOL *This, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid ); /** Convert all of variables in variable list to virtual address. **/ VOID ConvertVariableLockList ( VOID ); /** Function uses to check this variable is whether locked. @param[in] VariableName Name of Variable to be found. @param[in] VendorGuid Variable vendor GUID. @retval TRUE This variable is locked. @retval FALSE This variable isn't locked. **/ BOOLEAN IsVariableLocked ( IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid ); /** This function uses to send SMI to create variable lock list in SMM mode. **/ VOID CreateVariableLockListThroughSmi ( VOID ); /** This function uses to create variable lock list. @return EFI_SUCCESS Create variable lock list in SMM RAM successfully. @return Other Any error occurred while creating variable lock list in SMM RAM. **/ EFI_STATUS SmmCreateVariableLockList ( VOID ); /** 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. @param[in] Lock A pointer to the lock to acquire. **/ VOID AcquireLockOnlyAtBootTime ( IN EFI_LOCK *Lock ); /** 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. @param[in] Lock A pointer to the lock to release. **/ VOID ReleaseLockOnlyAtBootTime ( IN EFI_LOCK *Lock ); extern LIST_ENTRY mLockedVariableList; #endif