From 070c5a66cd858f949f8bd5dd3527bb39ebb0e146 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 16 Jan 2019 22:22:20 +0100 Subject: [PATCH] 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 Reviewed-by: Jian J Wang Reviewed-by: Star Zeng --- .../Library/VarCheckUefiLib/VarCheckUefiLib.inf | 4 ++-- .../VarCheckUefiLib/VarCheckUefiLibNullClass.c | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf index 128c44d695..8873fd51a0 100644 --- a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf +++ b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf @@ -19,9 +19,9 @@ BASE_NAME = VarCheckUefiLib MODULE_UNI_FILE = VarCheckUefiLib.uni FILE_GUID = AC24A4C7-F845-4665-90E5-6431D6E28DC0 - MODULE_TYPE = DXE_RUNTIME_DRIVER + MODULE_TYPE = BASE 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 # diff --git a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c index 80dc6341ad..94aac27785 100644 --- a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ +#include + #include #include #include @@ -921,21 +923,17 @@ VariablePropertySetUefiDefined ( Constructor function of VarCheckUefiLib to set property and 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. **/ -EFI_STATUS +RETURN_STATUS EFIAPI VarCheckUefiLibNullClassConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { VariablePropertySetUefiDefined (); VarCheckLibRegisterSetVariableCheckHandler (SetVariableCheckHandlerUefiDefined); - return EFI_SUCCESS; + return RETURN_SUCCESS; }