summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-03-10 10:13:32 +0800
committerHao Wu <hao.a.wu@intel.com>2017-03-13 09:15:47 +0800
commit96b17e00b9f180fad1ab7983475174c8c933d576 (patch)
tree91876b28001030027ffc5178c63c8c6d411b1897 /MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
parentc103e09b52695bfbc497780793b04bb64484a85d (diff)
downloadedk2-96b17e00b9f180fad1ab7983475174c8c933d576.zip
edk2-96b17e00b9f180fad1ab7983475174c8c933d576.tar.gz
edk2-96b17e00b9f180fad1ab7983475174c8c933d576.tar.bz2
MdeModulePkg/CapsuleLib: Add lib destructors to handle unclosed events
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c')
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 7f500a9..6344214 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -47,9 +47,8 @@
#include <Protocol/FirmwareManagement.h>
#include <Protocol/DevicePath.h>
-EFI_SYSTEM_RESOURCE_TABLE *mEsrtTable = NULL;
-BOOLEAN mIsVirtualAddrConverted = FALSE;
-BOOLEAN mDxeCapsuleLibEndOfDxe = FALSE;
+BOOLEAN mDxeCapsuleLibEndOfDxe = FALSE;
+EFI_EVENT mDxeCapsuleLibEndOfDxeEvent = NULL;
/**
Initialize capsule related variables.
@@ -1654,7 +1653,6 @@ DxeCapsuleLibConstructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_EVENT EndOfDxeEvent;
EFI_STATUS Status;
Status = gBS->CreateEventEx (
@@ -1663,7 +1661,7 @@ DxeCapsuleLibConstructor (
DxeCapsuleLibEndOfDxe,
NULL,
&gEfiEndOfDxeEventGroupGuid,
- &EndOfDxeEvent
+ &mDxeCapsuleLibEndOfDxeEvent
);
ASSERT_EFI_ERROR (Status);
@@ -1671,3 +1669,29 @@ DxeCapsuleLibConstructor (
return EFI_SUCCESS;
}
+
+/**
+ The destructor function closes the End of DXE event.
+
+ @param ImageHandle The firmware allocated handle for the EFI image.
+ @param SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The destructor completed successfully.
+**/
+EFI_STATUS
+EFIAPI
+DxeCapsuleLibDestructor (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Close the End of DXE event.
+ //
+ Status = gBS->CloseEvent (mDxeCapsuleLibEndOfDxeEvent);
+ ASSERT_EFI_ERROR (Status);
+
+ return EFI_SUCCESS;
+}