TianoCore EDK2 master
|
#include "VariableParsing.h"
Go to the source code of this file.
Functions in this module are associated with variable parsing operations and are intended to be usable across variable driver source files.
Copyright (c) 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VariableParsing.c.
UINTN DataSizeOfVariable | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the size of variable data.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 184 of file VariableParsing.c.
EFI_STATUS FindVariableEx | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN BOOLEAN | IgnoreRtCheck, | ||
IN OUT VARIABLE_POINTER_TRACK * | PtrTrack, | ||
IN BOOLEAN | AuthFormat | ||
) |
Find the variable in the specified variable store.
[in] | VariableName | Name of the variable to be found |
[in] | VendorGuid | Vendor GUID to be found. |
[in] | IgnoreRtCheck | Ignore EFI_VARIABLE_RUNTIME_ACCESS attribute check at runtime when searching variable. |
[in,out] | PtrTrack | Variable Track Pointer structure that contains Variable Information. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
EFI_SUCCESS | Variable found successfully |
EFI_NOT_FOUND | Variable not found |
Definition at line 463 of file VariableParsing.c.
VARIABLE_HEADER * GetEndPointer | ( | IN VARIABLE_STORE_HEADER * | VarStoreHeader | ) |
Gets the pointer to the end of the variable storage area.
This function gets pointer to the end of the variable storage area, according to the input variable store header.
[in] | VarStoreHeader | Pointer to the Variable Store Header. |
Definition at line 406 of file VariableParsing.c.
VARIABLE_HEADER * GetNextVariablePtr | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the pointer to the next variable header.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 356 of file VariableParsing.c.
VARIABLE_HEADER * GetStartPointer | ( | IN VARIABLE_STORE_HEADER * | VarStoreHeader | ) |
Gets the pointer to the first variable header in given variable store area.
[in] | VarStoreHeader | Pointer to the Variable Store Header. |
Definition at line 383 of file VariableParsing.c.
UINTN GetVariableDataOffset | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the variable data offset related to variable header.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 327 of file VariableParsing.c.
UINT8 * GetVariableDataPtr | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the pointer to the variable data.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 299 of file VariableParsing.c.
This code gets the size of variable header.
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 88 of file VariableParsing.c.
CHAR16 * GetVariableNamePtr | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the pointer to the variable name.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 253 of file VariableParsing.c.
VARIABLE_STORE_STATUS GetVariableStoreStatus | ( | IN VARIABLE_STORE_HEADER * | VarStoreHeader | ) |
This code gets the current status of Variable Store.
[in] | VarStoreHeader | Pointer to the Variable Store Header. |
EfiRaw | Variable store status is raw. |
EfiValid | Variable store status is valid. |
EfiInvalid | Variable store status is invalid. |
Definition at line 52 of file VariableParsing.c.
EFI_GUID * GetVendorGuidPtr | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the pointer to the variable guid.
[in] | Variable | Pointer to the Variable Header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 272 of file VariableParsing.c.
BOOLEAN IsValidVariableHeader | ( | IN VARIABLE_HEADER * | Variable, |
IN VARIABLE_HEADER * | VariableStoreEnd | ||
) |
This code checks if variable header is valid or not.
[in] | Variable | Pointer to the Variable Header. |
[in] | VariableStoreEnd | Pointer to the Variable Store End. |
TRUE | Variable header is valid. |
FALSE | Variable header is not valid. |
Definition at line 24 of file VariableParsing.c.
UINTN NameSizeOfVariable | ( | IN VARIABLE_HEADER * | Variable, |
IN BOOLEAN | AuthFormat | ||
) |
This code gets the size of name of variable.
[in] | Variable | Pointer to the variable header. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 115 of file VariableParsing.c.
VOID SetDataSizeOfVariable | ( | IN VARIABLE_HEADER * | Variable, |
IN UINTN | DataSize, | ||
IN BOOLEAN | AuthFormat | ||
) |
This code sets the size of variable data.
[in] | Variable | Pointer to the Variable Header. |
[in] | DataSize | Data size to set. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 225 of file VariableParsing.c.
VOID SetNameSizeOfVariable | ( | IN VARIABLE_HEADER * | Variable, |
IN UINTN | NameSize, | ||
IN BOOLEAN | AuthFormat | ||
) |
This code sets the size of name of variable.
[in] | Variable | Pointer to the Variable Header. |
[in] | NameSize | Name size to set. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
Definition at line 156 of file VariableParsing.c.
VOID UpdateVariableInfo | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN BOOLEAN | Volatile, | ||
IN BOOLEAN | Read, | ||
IN BOOLEAN | Write, | ||
IN BOOLEAN | Delete, | ||
IN BOOLEAN | Cache, | ||
IN OUT VARIABLE_INFO_ENTRY ** | VariableInfo | ||
) |
Routine used to track statistical information about variable usage. The data is stored in the EFI system table so it can be accessed later. VariableInfo.efi can dump out the table. Only Boot Services variable accesses are tracked by this code. The PcdVariableCollectStatistics build flag controls if this feature is enabled.
A read that hits in the cache will have Read and Cache true for the transaction. Data is allocated by this routine, but never freed.
[in] | VariableName | Name of the Variable to track. |
[in] | VendorGuid | Guid of the Variable to track. |
[in] | Volatile | TRUE if volatile FALSE if non-volatile. |
[in] | Read | TRUE if GetVariable() was called. |
[in] | Write | TRUE if SetVariable() was called. |
[in] | Delete | TRUE if deleted via SetVariable(). |
[in] | Cache | TRUE for a cache hit. |
[in,out] | VariableInfo | Pointer to a pointer of VARIABLE_INFO_ENTRY structures. |
Definition at line 729 of file VariableParsing.c.
Compare two EFI_TIME data.
[in] | FirstTime | A pointer to the first EFI_TIME data. |
[in] | SecondTime | A pointer to the second EFI_TIME data. |
TRUE | The FirstTime is not later than the SecondTime. |
FALSE | The FirstTime is later than the SecondTime. |
Definition at line 428 of file VariableParsing.c.
EFI_STATUS EFIAPI VariableServiceGetNextVariableInternal | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN VARIABLE_STORE_HEADER ** | VariableStoreList, | ||
OUT VARIABLE_HEADER ** | VariablePtr, | ||
IN BOOLEAN | AuthFormat | ||
) |
This code finds the next available variable.
Caution: This function may receive untrusted input. This function may be invoked in SMM mode. This function will do basic validation, before parse the data.
[in] | VariableName | Pointer to variable name. |
[in] | VendorGuid | Variable Vendor Guid. |
[in] | VariableStoreList | A list of variable stores that should be used to get the next variable. The maximum number of entries is the max value of VARIABLE_STORE_TYPE. |
[out] | VariablePtr | Pointer to variable header address. |
[in] | AuthFormat | TRUE indicates authenticated variables are used. FALSE indicates authenticated variables are not used. |
EFI_SUCCESS | The function completed successfully. |
EFI_NOT_FOUND | The next variable was not found. |
EFI_INVALID_PARAMETER | If VariableName is not an empty string, while VendorGuid is NULL. |
EFI_INVALID_PARAMETER | The input values of VariableName and VendorGuid are not a name and GUID of an existing variable. |
Definition at line 544 of file VariableParsing.c.