MdeModulePkg/VarCheckUefiLib: permit use by MM_STANDALONE modules

Permit CheckUefiLib to be used by MM_STANDALONE modules. Since this
library has a constructor, change the library's module type into
BASE so its constructor prototype is compatible with MM_STANDALONE
as well.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ard Biesheuvel 2019-01-16 22:22:20 +01:00
parent c5386c7898
commit 070c5a66cd
2 changed files with 7 additions and 9 deletions

View File

@ -19,9 +19,9 @@
BASE_NAME = VarCheckUefiLib BASE_NAME = VarCheckUefiLib
MODULE_UNI_FILE = VarCheckUefiLib.uni MODULE_UNI_FILE = VarCheckUefiLib.uni
FILE_GUID = AC24A4C7-F845-4665-90E5-6431D6E28DC0 FILE_GUID = AC24A4C7-F845-4665-90E5-6431D6E28DC0
MODULE_TYPE = DXE_RUNTIME_DRIVER MODULE_TYPE = BASE
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = NULL|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER LIBRARY_CLASS = NULL|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER MM_STANDALONE
CONSTRUCTOR = VarCheckUefiLibNullClassConstructor CONSTRUCTOR = VarCheckUefiLibNullClassConstructor
# #

View File

@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#include <Uefi/UefiBaseType.h>
#include <Library/VarCheckLib.h> #include <Library/VarCheckLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
@ -921,21 +923,17 @@ VariablePropertySetUefiDefined (
Constructor function of VarCheckUefiLib to set property and Constructor function of VarCheckUefiLib to set property and
register SetVariable check handler for UEFI defined variables. register SetVariable check handler for UEFI defined variables.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor executed correctly. @retval EFI_SUCCESS The constructor executed correctly.
**/ **/
EFI_STATUS RETURN_STATUS
EFIAPI EFIAPI
VarCheckUefiLibNullClassConstructor ( VarCheckUefiLibNullClassConstructor (
IN EFI_HANDLE ImageHandle, VOID
IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
VariablePropertySetUefiDefined (); VariablePropertySetUefiDefined ();
VarCheckLibRegisterSetVariableCheckHandler (SetVariableCheckHandlerUefiDefined); VarCheckLibRegisterSetVariableCheckHandler (SetVariableCheckHandlerUefiDefined);
return EFI_SUCCESS; return RETURN_SUCCESS;
} }