TianoCore EDK2 master
Loading...
Searching...
No Matches
VariableExLib.c File Reference
#include "Variable.h"
#include "VariableParsing.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI VariableExLibFindVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT AUTH_VARIABLE_INFO *AuthVariableInfo)
 
EFI_STATUS EFIAPI VariableExLibFindNextVariable (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT AUTH_VARIABLE_INFO *AuthVariableInfo)
 
EFI_STATUS EFIAPI VariableExLibUpdateVariable (IN AUTH_VARIABLE_INFO *AuthVariableInfo)
 
EFI_STATUS EFIAPI VariableExLibGetScratchBuffer (IN OUT UINTN *ScratchBufferSize, OUT VOID **ScratchBuffer)
 
BOOLEAN EFIAPI VariableExLibCheckRemainingSpaceForConsistency (IN UINT32 Attributes,...)
 
BOOLEAN EFIAPI VariableExLibAtRuntime (VOID)
 

Detailed Description

Provides variable driver extended services.

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

Definition in file VariableExLib.c.

Function Documentation

◆ VariableExLibAtRuntime()

BOOLEAN EFIAPI VariableExLibAtRuntime ( VOID  )

Return TRUE if at OS runtime.

Return values
TRUEIf at OS runtime.
FALSEIf at boot time.

Definition at line 253 of file VariableExLib.c.

◆ VariableExLibCheckRemainingSpaceForConsistency()

BOOLEAN EFIAPI VariableExLibCheckRemainingSpaceForConsistency ( IN UINT32  Attributes,
  ... 
)

This function is to check if the remaining variable space is enough to set all Variables from argument list successfully. The purpose of the check is to keep the consistency of the Variables to be in variable storage.

Note: Variables are assumed to be in same storage. The set sequence of Variables will be same with the sequence of VariableEntry from argument list, so follow the argument sequence to check the Variables.

Parameters
[in]AttributesVariable attributes for Variable entries.
...The variable argument list with type VARIABLE_ENTRY_CONSISTENCY *. A NULL terminates the list. The VariableSize of VARIABLE_ENTRY_CONSISTENCY is the variable data size as input. It will be changed to variable total size as output.
Return values
TRUEHave enough variable space to set the Variables successfully.
FALSENo enough variable space to set the Variables successfully.

Definition at line 227 of file VariableExLib.c.

◆ VariableExLibFindNextVariable()

EFI_STATUS EFIAPI VariableExLibFindNextVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
OUT AUTH_VARIABLE_INFO AuthVariableInfo 
)

Finds next variable in storage blocks of volatile and non-volatile storage areas.

This code finds next variable in storage blocks of volatile and non-volatile storage areas. If VariableName is an empty string, then we just return the first qualified variable without comparing VariableName and VendorGuid.

Parameters
[in]VariableNameName of the variable to be found.
[in]VendorGuidVariable vendor GUID to be found.
[out]AuthVariableInfoPointer to AUTH_VARIABLE_INFO structure for output of the next variable.
Return values
EFI_INVALID_PARAMETERIf VariableName is not an empty string, while VendorGuid is NULL.
EFI_SUCCESSVariable successfully found.
EFI_NOT_FOUNDVariable not found

Definition at line 92 of file VariableExLib.c.

◆ VariableExLibFindVariable()

EFI_STATUS EFIAPI VariableExLibFindVariable ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
OUT AUTH_VARIABLE_INFO AuthVariableInfo 
)

Finds variable in storage blocks of volatile and non-volatile storage areas.

This code finds variable in storage blocks of volatile and non-volatile storage areas. If VariableName is an empty string, then we just return the first qualified variable without comparing VariableName and VendorGuid.

Parameters
[in]VariableNameName of the variable to be found.
[in]VendorGuidVariable vendor GUID to be found.
[out]AuthVariableInfoPointer to AUTH_VARIABLE_INFO structure for output of the variable found.
Return values
EFI_INVALID_PARAMETERIf VariableName is not an empty string, while VendorGuid is NULL.
EFI_SUCCESSVariable successfully found.
EFI_NOT_FOUNDVariable not found

Definition at line 32 of file VariableExLib.c.

◆ VariableExLibGetScratchBuffer()

EFI_STATUS EFIAPI VariableExLibGetScratchBuffer ( IN OUT UINTN ScratchBufferSize,
OUT VOID **  ScratchBuffer 
)

Get scratch buffer.

Parameters
[in,out]ScratchBufferSizeScratch buffer size. If input size is greater than the maximum supported buffer size, this value contains the maximum supported buffer size as output.
[out]ScratchBufferPointer to scratch buffer address.
Return values
EFI_SUCCESSGet scratch buffer successfully.
EFI_UNSUPPORTEDIf input size is greater than the maximum supported buffer size.

Definition at line 189 of file VariableExLib.c.

◆ VariableExLibUpdateVariable()

EFI_STATUS EFIAPI VariableExLibUpdateVariable ( IN AUTH_VARIABLE_INFO AuthVariableInfo)

Update the variable region with Variable information.

Parameters
[in]AuthVariableInfoPointer AUTH_VARIABLE_INFO structure for input of the variable.
Return values
EFI_SUCCESSThe update operation is success.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_WRITE_PROTECTEDVariable is write-protected.
EFI_OUT_OF_RESOURCESThere is not enough resource.

Definition at line 155 of file VariableExLib.c.