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

Go to the source code of this file.

Data Structures

struct  UEFI_DEFINED_VARIABLE_ENTRY
 

Typedefs

typedef EFI_STATUS(EFIAPI * INTERNAL_VAR_CHECK_FUNCTION) (IN VAR_CHECK_VARIABLE_PROPERTY *Propery, IN UINTN DataSize, IN VOID *Data)
 

Functions

EFI_STATUS EFIAPI InternalVarCheckLoadOption (IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI InternalVarCheckKeyOption (IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI InternalVarCheckDevicePath (IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI InternalVarCheckAsciiString (IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery, IN UINTN DataSize, IN VOID *Data)
 
EFI_STATUS EFIAPI InternalVarCheckSizeArray (IN VAR_CHECK_VARIABLE_PROPERTY *VariablePropery, IN UINTN DataSize, IN VOID *Data)
 
BOOLEAN EFIAPI VarCheckUefiIsHexaDecimalDigitCharacter (IN CHAR16 Char)
 
BOOLEAN EFIAPI IsHwErrRecVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid)
 
INTERNAL_VAR_CHECK_FUNCTION GetUefiDefinedVarCheckFunction (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT VAR_CHECK_VARIABLE_PROPERTY **VariableProperty)
 
EFI_STATUS EFIAPI SetVariableCheckHandlerUefiDefined (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
 
VOID VariablePropertySetUefiDefined (VOID)
 
RETURN_STATUS EFIAPI VarCheckUefiLibNullClassConstructor (VOID)
 

Variables

UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList []
 
UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2 []
 
UEFI_DEFINED_VARIABLE_ENTRY mImageSecurityVariableList []
 
UEFI_DEFINED_VARIABLE_ENTRY mHwErrRecVariable
 
EFI_GUIDmUefiDefinedGuid []
 

Detailed Description

Implementation functions and structures for var check uefi library.

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

Definition in file VarCheckUefiLibNullClass.c.

Typedef Documentation

◆ INTERNAL_VAR_CHECK_FUNCTION

typedef EFI_STATUS(EFIAPI * INTERNAL_VAR_CHECK_FUNCTION) (IN VAR_CHECK_VARIABLE_PROPERTY *Propery, IN UINTN DataSize, IN VOID *Data)

Definition at line 23 of file VarCheckUefiLibNullClass.c.

Function Documentation

◆ GetUefiDefinedVarCheckFunction()

INTERNAL_VAR_CHECK_FUNCTION GetUefiDefinedVarCheckFunction ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
OUT VAR_CHECK_VARIABLE_PROPERTY **  VariableProperty 
)

Get UEFI defined var check function.

Parameters
[in]VariableNamePointer to variable name.
[in]VendorGuidPointer to variable vendor GUID.
[out]VariablePropertyPointer to variable property.
Returns
Internal var check function, NULL if no specific check function.

Definition at line 756 of file VarCheckUefiLibNullClass.c.

◆ InternalVarCheckAsciiString()

EFI_STATUS EFIAPI InternalVarCheckAsciiString ( IN VAR_CHECK_VARIABLE_PROPERTY VariablePropery,
IN UINTN  DataSize,
IN VOID *  Data 
)

Internal check for ASCII string.

Parameters
[in]VariableProperyPointer to variable property.
[in]DataSizeData size.
[in]DataPointer to data buffer.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERThe data buffer is not a Null-terminated ASCII string.

Definition at line 167 of file VarCheckUefiLibNullClass.c.

◆ InternalVarCheckDevicePath()

EFI_STATUS EFIAPI InternalVarCheckDevicePath ( IN VAR_CHECK_VARIABLE_PROPERTY VariablePropery,
IN UINTN  DataSize,
IN VOID *  Data 
)

Internal check for device path.

Parameters
[in]VariableProperyPointer to variable property.
[in]DataSizeData size.
[in]DataPointer to data buffer.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERThe data buffer is not a valid device path.

Definition at line 141 of file VarCheckUefiLibNullClass.c.

◆ InternalVarCheckKeyOption()

EFI_STATUS EFIAPI InternalVarCheckKeyOption ( IN VAR_CHECK_VARIABLE_PROPERTY VariablePropery,
IN UINTN  DataSize,
IN VOID *  Data 
)

Internal check for key option.

Parameters
[in]VariableProperyPointer to variable property.
[in]DataSizeData size.
[in]DataPointer to data buffer.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERThe data buffer is not a valid key option.

Definition at line 115 of file VarCheckUefiLibNullClass.c.

◆ InternalVarCheckLoadOption()

EFI_STATUS EFIAPI InternalVarCheckLoadOption ( IN VAR_CHECK_VARIABLE_PROPERTY VariablePropery,
IN UINTN  DataSize,
IN VOID *  Data 
)

Internal check for load option.

Parameters
[in]VariableProperyPointer to variable property.
[in]DataSizeData size.
[in]DataPointer to data buffer.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERThe data buffer is not a valid load option.

Definition at line 49 of file VarCheckUefiLibNullClass.c.

◆ InternalVarCheckSizeArray()

EFI_STATUS EFIAPI InternalVarCheckSizeArray ( IN VAR_CHECK_VARIABLE_PROPERTY VariablePropery,
IN UINTN  DataSize,
IN VOID *  Data 
)

Internal check for size array.

Parameters
[in]VariableProperyPointer to variable property.
[in]DataSizeData size.
[in]DataPointer to data buffer.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERThe DataSize is not size array.

Definition at line 204 of file VarCheckUefiLibNullClass.c.

◆ IsHwErrRecVariable()

BOOLEAN EFIAPI IsHwErrRecVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid 
)

This code checks if variable is hardware error record variable or not.

According to UEFI spec, hardware error record variable should use the EFI_HARDWARE_ERROR_VARIABLE VendorGuid and have the L"HwErrRec####" name convention, #### is a printed hex value and no 0x or h is included in the hex value.

Parameters
[in]VariableNamePointer to variable name.
[in]VendorGuidVariable Vendor Guid.
Return values
TRUEVariable is hardware error record variable.
FALSEVariable is not hardware error record variable.

Definition at line 726 of file VarCheckUefiLibNullClass.c.

◆ SetVariableCheckHandlerUefiDefined()

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

SetVariable check handler UEFI defined.

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.
Return values
EFI_SUCCESSThe SetVariable check result was success.
EFI_INVALID_PARAMETERAn invalid combination of attribute bits, name, GUID, DataSize and Data value was supplied.
EFI_WRITE_PROTECTEDThe variable in question is read-only.

Definition at line 814 of file VarCheckUefiLibNullClass.c.

◆ VarCheckUefiIsHexaDecimalDigitCharacter()

BOOLEAN EFIAPI VarCheckUefiIsHexaDecimalDigitCharacter ( IN CHAR16  Char)

Check if a Unicode character is an upper case hexadecimal character.

This function checks if a Unicode character is an upper case hexadecimal character. The valid upper case hexadecimal character is L'0' to L'9', or L'A' to L'F'.

Parameters
[in]CharThe character to check against.
Return values
TRUEIf the Char is an upper case hexadecmial character.
FALSEIf the Char is not an upper case hexadecmial character.

Definition at line 703 of file VarCheckUefiLibNullClass.c.

◆ VarCheckUefiLibNullClassConstructor()

RETURN_STATUS EFIAPI VarCheckUefiLibNullClassConstructor ( VOID  )

Constructor function of VarCheckUefiLib to set property and register SetVariable check handler for UEFI defined variables.

Return values
EFI_SUCCESSThe constructor executed correctly.

Definition at line 939 of file VarCheckUefiLibNullClass.c.

◆ VariablePropertySetUefiDefined()

VOID VariablePropertySetUefiDefined ( VOID  )

Variable property set for UEFI defined variables.

Definition at line 884 of file VarCheckUefiLibNullClass.c.

Variable Documentation

◆ mGlobalVariableList

UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList[]

Definition at line 225 of file VarCheckUefiLibNullClass.c.

◆ mGlobalVariableList2

UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[]

Definition at line 569 of file VarCheckUefiLibNullClass.c.

◆ mHwErrRecVariable

UEFI_DEFINED_VARIABLE_ENTRY mHwErrRecVariable
Initial value:
= {
L"HwErrRec####",
{
VAR_CHECK_VARIABLE_PROPERTY_REVISION,
0,
VARIABLE_ATTRIBUTE_NV_BS_RT_HR,
1,
MAX_UINTN
},
}
#define NULL
Definition: Base.h:319

Definition at line 669 of file VarCheckUefiLibNullClass.c.

◆ mImageSecurityVariableList

UEFI_DEFINED_VARIABLE_ENTRY mImageSecurityVariableList[]

Definition at line 630 of file VarCheckUefiLibNullClass.c.

◆ mUefiDefinedGuid

EFI_GUID* mUefiDefinedGuid[]
Initial value:
= {
&gEfiGlobalVariableGuid,
&gEfiImageSecurityDatabaseGuid,
&gEfiHardwareErrorVariableGuid
}

Definition at line 681 of file VarCheckUefiLibNullClass.c.