MdeModulePkg Variable: Consume the separated VarCheckLib

Since the variable check service has be separated to VarCheckLib
from Variable driver, so update Variable driver to consume the
separated VarCheckLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18286 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Star Zeng
2015-08-25 03:01:56 +00:00
committed by lzeng14
parent 3b01413759
commit 8021f4c716
8 changed files with 108 additions and 1415 deletions

View File

@@ -36,13 +36,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/SynchronizationLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/AuthVariableLib.h>
#include <Library/VarCheckLib.h>
#include <Guid/GlobalVariable.h>
#include <Guid/EventGroup.h>
#include <Guid/VariableFormat.h>
#include <Guid/ImageAuthentication.h>
#include <Guid/SystemNvDataGuid.h>
#include <Guid/FaultTolerantWrite.h>
#include <Guid/HardwareErrorVariable.h>
#include <Guid/VarErrorFlag.h>
#define EFI_VARIABLE_ATTRIBUTES_MASK (EFI_VARIABLE_NON_VOLATILE | \
@@ -109,12 +108,6 @@ typedef struct {
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbInstance;
} VARIABLE_MODULE_GLOBAL;
typedef struct {
LIST_ENTRY Link;
EFI_GUID Guid;
//CHAR16 *Name;
} VARIABLE_ENTRY;
/**
Flush the HOB variable to flash.
@@ -702,53 +695,6 @@ VariableLockRequestToLock (
IN EFI_GUID *VendorGuid
);
/**
Check if a Unicode character is a hexadecimal character.
This function checks if a Unicode character is a
hexadecimal character. The valid hexadecimal character is
L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
@param Char The character to check against.
@retval TRUE If the Char is a hexadecmial character.
@retval FALSE If the Char is not a hexadecmial character.
**/
BOOLEAN
EFIAPI
IsHexaDecimalDigitCharacter (
IN CHAR16 Char
);
/**
Internal SetVariable check.
@param[in] VariableName Name of Variable to set.
@param[in] VendorGuid Variable vendor GUID.
@param[in] Attributes Attribute value of the variable.
@param[in] DataSize Size of Data to set.
@param[in] Data Data pointer.
@retval EFI_SUCCESS The SetVariable check result was success.
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID were supplied,
or the DataSize exceeds the minimum or maximum allowed,
or the Data value is not following UEFI spec for UEFI defined variables.
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
@retval Others The return status from check handler.
**/
EFI_STATUS
EFIAPI
InternalVarCheckSetVariableCheck (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Data
);
/**
Register SetVariable check handler.
@@ -769,45 +715,6 @@ VarCheckRegisterSetVariableCheckHandler (
IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler
);
/**
Internal variable property get.
@param[in] Name Pointer to the variable name.
@param[in] Guid Pointer to the vendor GUID.
@param[out] VariableProperty Pointer to the output variable property.
@retval EFI_SUCCESS The property of variable specified by the Name and Guid was got successfully.
@retval EFI_NOT_FOUND The property of variable specified by the Name and Guid was not found.
**/
EFI_STATUS
EFIAPI
InternalVarCheckVariablePropertyGet (
IN CHAR16 *Name,
IN EFI_GUID *Guid,
OUT VAR_CHECK_VARIABLE_PROPERTY *VariableProperty
);
/**
Internal variable property set.
@param[in] Name Pointer to the variable name.
@param[in] Guid Pointer to the vendor GUID.
@param[in] VariableProperty Pointer to the input variable property.
@retval EFI_SUCCESS The property of variable specified by the Name and Guid was set successfully.
@retval EFI_OUT_OF_RESOURCES There is not enough resource for the variable property set request.
**/
EFI_STATUS
EFIAPI
InternalVarCheckVariablePropertySet (
IN CHAR16 *Name,
IN EFI_GUID *Guid,
IN VAR_CHECK_VARIABLE_PROPERTY *VariableProperty
);
/**
Variable property set.
@@ -862,7 +769,7 @@ InitializeVariableQuota (
extern VARIABLE_MODULE_GLOBAL *mVariableModuleGlobal;
extern AUTH_VAR_LIB_CONTEXT_OUT mContextOut;
extern AUTH_VAR_LIB_CONTEXT_OUT mAuthContextOut;
/**
Finds variable in storage blocks of volatile and non-volatile storage areas.