From 4aea90ea53fd6541033be6c834ca21fa61d08435 Mon Sep 17 00:00:00 2001 From: xieyuanh Date: Mon, 3 Jun 2024 10:52:53 +0800 Subject: [PATCH] MdeModulePkg: Relocation of mVarCheckHiiBin declaration Relocate the declaration of mVarCheckHiiBin to support for standalone MM modules utilizing the same mVarCheckHiiBin. Cc: Liming Gao Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Star Zeng Cc: Hongbin1 Zhang Cc: Wei6 Xu Cc: Dun Tan Cc: Dandan Bi Signed-off-by: Yuanhao Xie --- MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h | 5 +---- MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c | 6 ++++-- MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h | 4 +++- .../Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c | 5 +---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h index 89de54ddf4..f6894c9cb3 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h @@ -1,7 +1,7 @@ /** @file Include file for Var Check Hii handler and bin. -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -51,7 +51,4 @@ DumpVarCheckHii ( IN UINTN VarCheckHiiBinSize ); -extern VAR_CHECK_HII_VARIABLE_HEADER *mVarCheckHiiBin; -extern UINTN mVarCheckHiiBinSize; - #endif diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c index ca8227df6b..5e54e19bc1 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c @@ -1,14 +1,16 @@ /** @file Var Check Hii bin generation. -Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "VarCheckHiiGen.h" -LIST_ENTRY mVarCheckHiiList = INITIALIZE_LIST_HEAD_VARIABLE (mVarCheckHiiList); +VAR_CHECK_HII_VARIABLE_HEADER *mVarCheckHiiBin = NULL; +UINTN mVarCheckHiiBinSize = 0; +LIST_ENTRY mVarCheckHiiList = INITIALIZE_LIST_HEAD_VARIABLE (mVarCheckHiiList); #define VAR_CHECK_HII_VARIABLE_NODE_SIGNATURE SIGNATURE_32 ('V', 'C', 'H', 'V') diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h index c70bf726cd..ace1fe6430 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h @@ -1,7 +1,7 @@ /** @file Include file for Var Check Hii bin generation. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define _VAR_CHECK_HII_GEN_H_ #include "VarCheckHii.h" +extern VAR_CHECK_HII_VARIABLE_HEADER *mVarCheckHiiBin; +extern UINTN mVarCheckHiiBinSize; /** Dump Hii Package. diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c index ee2d98c7d1..9de0b9d6e3 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "VarCheckHii.h" - +#include "VarCheckHiiGen.h" GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mVarCheckHiiHex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /** @@ -258,9 +258,6 @@ VarCheckHiiQuestion ( return TRUE; } -VAR_CHECK_HII_VARIABLE_HEADER *mVarCheckHiiBin = NULL; -UINTN mVarCheckHiiBinSize = 0; - /** SetVariable check handler HII.