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

Go to the source code of this file.

Data Structures

struct  VARIABLE_TYPE
 

Functions

BOOLEAN IsAnyMorVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
 
BOOLEAN IsMorLockVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
 
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)
 

Variables

VARIABLE_TYPE mMorVariableType []
 

Detailed Description

TCG MOR (Memory Overwrite Request) Lock Control Driver.

This driver initializes MemoryOverwriteRequestControlLock variable. This module will add Variable Hook and allow MemoryOverwriteRequestControlLock variable set only once.

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

Definition in file TcgMorLock.c.

Function Documentation

◆ IsAnyMorVariable()

BOOLEAN IsAnyMorVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid 
)

Returns if this is MOR related variable.

Parameters
VariableNamethe name of the vendor's variable, it's a Null-Terminated Unicode String
VendorGuidUnify identifier for vendor.
Return values
TRUEThe variable is MOR related.
FALSEThe variable is NOT MOR related.

Definition at line 40 of file TcgMorLock.c.

◆ IsMorLockVariable()

BOOLEAN IsMorLockVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid 
)

Returns if this is MOR lock variable.

Parameters
VariableNamethe name of the vendor's variable, it's a Null-Terminated Unicode String
VendorGuidUnify identifier for vendor.
Return values
TRUEThe variable is MOR lock variable.
FALSEThe variable is NOT MOR lock variable.

Definition at line 68 of file TcgMorLock.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.

Definition at line 110 of file TcgMorLock.c.

Variable Documentation

◆ mMorVariableType

VARIABLE_TYPE mMorVariableType[]
Initial value:
= {
{ MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, &gEfiMemoryOverwriteControlDataGuid },
{ MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, &gEfiMemoryOverwriteRequestControlLockGuid },
}
#define MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME

Definition at line 25 of file TcgMorLock.c.