summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorNhi Pham <nhi@os.amperecomputing.com>2024-06-18 16:41:53 +0700
committerLiming Gao <gaoliming@byosoft.com.cn>2024-06-19 08:53:42 +0800
commit26a30abdd0f7fe5a9d2421cba6efe9397185ad98 (patch)
treef6b7de3b1c8ac5a575e6cadf09d513fcf5ca3c4b /MdeModulePkg
parentc1d1910be6e04a8b1a73090cf2881fb698947a6e (diff)
downloadedk2-26a30abdd0f7fe5a9d2421cba6efe9397185ad98.zip
edk2-26a30abdd0f7fe5a9d2421cba6efe9397185ad98.tar.gz
edk2-26a30abdd0f7fe5a9d2421cba6efe9397185ad98.tar.bz2
MdeModulePkg/DxeCapsuleLibFmp: Fix compilation error
The commit "MdeModulePkg/DxeCapsuleLibFmp: Fix crash if no ESRT is found" leads to a compilation error in MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf. The issue occurs because the variable mDxeCapsuleLibReadyToBootEvent which is declared as extern does not exist, while it is defined in DxeCapsuleRuntime.c, a file not included in DxeCapsuleLib.inf. This patch is to fix this by moving the variable defintion to DxeCapsuleLib.c and declare it as extern in DxeCapsuleRuntime.c. Reported-by: Gua Guo <gua.guo@intel.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c2
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 36efd64..8befbae 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -49,7 +49,7 @@ EFI_EVENT mDxeCapsuleLibEndOfDxeEvent = NULL;
EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL *mFmpProgress = NULL;
-extern BOOLEAN mDxeCapsuleLibReadyToBootEvent;
+BOOLEAN mDxeCapsuleLibReadyToBootEvent = FALSE;
/**
Initialize capsule related variables.
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c
index efff714..855b7a6 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c
@@ -24,7 +24,7 @@
extern EFI_SYSTEM_RESOURCE_TABLE *mEsrtTable;
EFI_EVENT mDxeRuntimeCapsuleLibVirtualAddressChangeEvent = NULL;
EFI_EVENT mDxeRuntimeCapsuleLibReadyToBootEvent = NULL;
-BOOLEAN mDxeCapsuleLibReadyToBootEvent = FALSE;
+extern BOOLEAN mDxeCapsuleLibReadyToBootEvent;
/**
Convert EsrtTable physical address to virtual address.