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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI VarCheckHiiLibReceiveHiiBinHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI SetVariableCheckHandlerHii (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI VarCheckHiiLibConstructorStandaloneMm (IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *SystemTable)
 

Variables

VAR_CHECK_HII_VARIABLE_HEADERmMmReceivedVarCheckHiiBin = NULL
 
UINTN mMmReceivedVarCheckHiiBinSize = 0
 
EFI_GUID gVarCheckReceivedHiiBinHandlerGuid = VAR_CHECK_RECEIVED_HII_BIN_HANDLER_GUID
 

Detailed Description

Implementation functions and structures for var check services. This file provides functions and structures to register and handle variable checks in the Standalone MM environment, specifically for HII variables.

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

Definition in file VarCheckHiiLibStandaloneMm.c.

Function Documentation

◆ SetVariableCheckHandlerHii()

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

Sets the variable check handler for HII. This function registers a handler that will be invoked for variable checks in the HII environment. It allows for custom validation logic to be implemented for setting HII variables.

Parameters
[in]VariableNameName of Variable to set.
[in]VendorGuidVariable vendor GUID.
[in]AttributesAttribute value of the variable.
[in]DataSizeSize of Data to set.
[in]DataData pointer.

Definition at line 106 of file VarCheckHiiLibStandaloneMm.c.

◆ VarCheckHiiLibConstructorStandaloneMm()

EFI_STATUS EFIAPI VarCheckHiiLibConstructorStandaloneMm ( IN EFI_HANDLE  ImageHandle,
IN EFI_MM_SYSTEM_TABLE SystemTable 
)

Constructor function for variable check library in Standalone MM. This function registers a handler for variable checks and sets up the environment for variable checking in the Standalone MM environment.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI system table.
Return values
EFI_SUCCESSThe constructor executed successfully.
OthersAn error occurred during execution.

Definition at line 129 of file VarCheckHiiLibStandaloneMm.c.

◆ VarCheckHiiLibReceiveHiiBinHandler()

EFI_STATUS EFIAPI VarCheckHiiLibReceiveHiiBinHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

Registers a handler for HII variable checks in MM environment. This function is intended to be called to register a handler for checking variables in the Standalone MM environment. It allocates memory for the variable check data and copies the data from the communication buffer.

Parameters
[in]DispatchHandleThe handle of the dispatch function.
[in]ContextOptional context for the handler, not used in this implementation.
CommBufferThe buffer of data being passed in.
CommBufferSizeThe size of the data being passed in.
Return values
EFI_SUCCESSRegistration and memory allocation were successful.
EFI_INVALID_PARAMETERThe CommBuffer or CommBufferSize is NULL.
EFI_ACCESS_DENIEDThe buffer size is invalid or the buffer is in an invalid location.
EFI_OUT_OF_RESOURCESMemory allocation for the variable check data failed.

Definition at line 48 of file VarCheckHiiLibStandaloneMm.c.

Variable Documentation

◆ gVarCheckReceivedHiiBinHandlerGuid

EFI_GUID gVarCheckReceivedHiiBinHandlerGuid = VAR_CHECK_RECEIVED_HII_BIN_HANDLER_GUID

Definition at line 28 of file VarCheckHiiLibStandaloneMm.c.

◆ mMmReceivedVarCheckHiiBin

VAR_CHECK_HII_VARIABLE_HEADER* mMmReceivedVarCheckHiiBin = NULL

Definition at line 26 of file VarCheckHiiLibStandaloneMm.c.

◆ mMmReceivedVarCheckHiiBinSize

UINTN mMmReceivedVarCheckHiiBinSize = 0

Definition at line 27 of file VarCheckHiiLibStandaloneMm.c.