TianoCore EDK2 master
Loading...
Searching...
No Matches
TcgMorLock.h File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI InternalGetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data)
 
EFI_STATUS EFIAPI InternalSetVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI SetVariableCheckHandlerMor (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI MorLockDriverInit (VOID)
 

Detailed Description

TCG MOR (Memory Overwrite Request) Lock Control Driver header file.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TcgMorLock.h.

Function Documentation

◆ InternalGetVariable()

EFI_STATUS EFIAPI InternalGetVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
OUT UINT32 *Attributes  OPTIONAL,
IN OUT UINTN DataSize,
OUT VOID *  Data 
)

This service is a wrapper for the UEFI Runtime Service GetVariable().

Parameters
VariableNamethe name of the vendor's variable, it's a Null-Terminated Unicode String
VendorGuidUnify identifier for vendor.
AttributesPoint to memory location to return the attributes of variable. If the point is NULL, the parameter would be ignored.
DataSizeAs input, point to the maximum size of return Data-Buffer. As output, point to the actual size of the returned Data-Buffer.
DataPoint to return Data-Buffer.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_NOT_FOUNDThe variable was not found.
EFI_BUFFER_TOO_SMALLThe DataSize is too small for the result. DataSize has been updated with the size needed to complete the request.
EFI_INVALID_PARAMETERVariableName is NULL.
EFI_INVALID_PARAMETERVendorGuid is NULL.
EFI_INVALID_PARAMETERDataSize is NULL.
EFI_INVALID_PARAMETERThe DataSize is not too small and Data is NULL.
EFI_DEVICE_ERRORThe variable could not be retrieved due to a hardware error.
EFI_SECURITY_VIOLATIONThe variable could not be retrieved due to an authentication failure.

Definition at line 42 of file TcgMorLockSmm.c.

◆ InternalSetVariable()

EFI_STATUS EFIAPI InternalSetVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
IN UINT32  Attributes,
IN UINTN  DataSize,
IN VOID *  Data 
)

This service is a wrapper for the UEFI Runtime Service SetVariable()

Parameters
VariableNamethe name of the vendor's variable, as a Null-Terminated Unicode String
VendorGuidUnify identifier for vendor.
AttributesPoint to memory location to return the attributes of variable. If the point is NULL, the parameter would be ignored.
DataSizeThe size in bytes of Data-Buffer.
DataPoint to the content of the variable.
Return values
EFI_SUCCESSThe firmware has successfully stored the variable and its data as defined by the Attributes.
EFI_INVALID_PARAMETERAn invalid combination of attribute bits was supplied, or the DataSize exceeds the maximum allowed.
EFI_INVALID_PARAMETERVariableName is an empty Unicode string.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved due to a hardware failure.
EFI_WRITE_PROTECTEDThe variable in question is read-only.
EFI_WRITE_PROTECTEDThe variable in question cannot be deleted.
EFI_SECURITY_VIOLATIONThe variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set but the AuthInfo does NOT pass the validation check carried out by the firmware.
EFI_NOT_FOUNDThe variable trying to be updated or deleted was not found.

Definition at line 87 of file TcgMorLockSmm.c.

◆ MorLockDriverInit()

EFI_STATUS EFIAPI MorLockDriverInit ( VOID  )

Entry Point for MOR Lock Control driver.

Parameters
[in]ImageHandleImage handle of this driver.
[in]SystemTableA Pointer to the EFI System Table.
Return values
EFI_SUCCESS
Returns
Others Some error occurs.

Definition at line 180 of file TcgMorLock.c.

◆ SetVariableCheckHandlerMor()

EFI_STATUS EFIAPI SetVariableCheckHandlerMor ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
IN UINT32  Attributes,
IN UINTN  DataSize,
IN VOID *  Data 
)

This service is a checker handler for the UEFI Runtime Service SetVariable()

Parameters
VariableNamethe name of the vendor's variable, as a Null-Terminated Unicode String
VendorGuidUnify identifier for vendor.
AttributesPoint to memory location to return the attributes of variable. If the point is NULL, the parameter would be ignored.
DataSizeThe size in bytes of Data-Buffer.
DataPoint to the content of the variable.
Return values
EFI_SUCCESSThe firmware has successfully stored the variable and its data as defined by the Attributes.
EFI_INVALID_PARAMETERAn invalid combination of attribute bits was supplied, or the DataSize exceeds the maximum allowed.
EFI_INVALID_PARAMETERVariableName is an empty Unicode string.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved due to a hardware failure.
EFI_WRITE_PROTECTEDThe variable in question is read-only.
EFI_WRITE_PROTECTEDThe variable in question cannot be deleted.
EFI_SECURITY_VIOLATIONThe variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set but the AuthInfo does NOT pass the validation check carried out by the firmware.
EFI_NOT_FOUNDThe variable trying to be updated or deleted was not found.

This service is an MOR/MorLock checker handler for the SetVariable().

Parameters
[in]VariableNamethe name of the vendor's variable, as a Null-Terminated Unicode String
[in]VendorGuidUnify identifier for vendor.
[in]AttributesAttributes bitmask to set for the variable.
[in]DataSizeThe size in bytes of Data-Buffer.
[in]DataPoint to the content of the variable.
Return values
EFI_SUCCESSThe MOR/MorLock check pass, and Variable driver can store the variable data.
EFI_INVALID_PARAMETERThe MOR/MorLock data or data size or attributes is not allowed for MOR variable.
EFI_ACCESS_DENIEDThe MOR/MorLock is locked.
EFI_ALREADY_STARTEDThe MorLock variable is handled inside this function. Variable driver can just return EFI_SUCCESS.

Definition at line 44 of file TcgMorLockDxe.c.