From nobody Mon Feb 9 01:19:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44434+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44434+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564110668; cv=none; d=zoho.com; s=zohoarc; b=UltkgLWigPYbS0wt6skSUO+2I94EPuqTA7RC0P9g+pBDVnbRffsbhKfWEj6aqAjQuwfQGjZ4eXUmLZZ5sQQYNEHpYTb0FhRiYZ3zvxZ0/+KN8n9kvkkMIYAcoCVfFSqkK9qeDLyeek+tW/KQws+2Wl9dyIdgauNXJKtJgx1+/Mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564110668; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=qf+oEFsCrRLrHqpJLCC1r8y6u/8cjzQLXzn9v8p23zs=; b=B+P3YRg+Lw0n7EuWsPBeLfNAFSEruz2dv+NQ0t/pvQdW3//vEm9YuHMBsKXrUYRiVdXLGPo79+OJepX26w/InoxKzHRS6ZgDT9JieTT05vHSlHEHPm+8Ii0NWXPfMg3uW9T1SxhQED2PHAf7Q4xb8FAjLGZBPrmo+X1K0FnwgfQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44434+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564110668042385.7107570551931; Thu, 25 Jul 2019 20:11:08 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Thu, 25 Jul 2019 20:11:07 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 20:11:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,309,1559545200"; d="scan'208";a="170497789" X-Received: from shwdeopenpsi174.ccr.corp.intel.com ([10.239.157.39]) by fmsmga008.fm.intel.com with ESMTP; 25 Jul 2019 20:11:06 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [edk2-devel][Patch 2/3] MdePkg/UefiDebugLibDebugPortProtocol: Add destructor to CloseEvent Date: Fri, 26 Jul 2019 11:10:54 +0800 Message-Id: <20190726031055.10020-3-wei6.xu@intel.com> In-Reply-To: <20190726031055.10020-1-wei6.xu@intel.com> References: <20190726031055.10020-1-wei6.xu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564110667; bh=vKOJcGVmk2wV02WQ8ijzQUXvwLV2YC4Q70QHBG3XFZk=; h=Cc:Date:From:Reply-To:Subject:To; b=QzHCON5Dl0o2vLHmcxoHzYRSj2183wh2axqOehuX2m+1px/O3ataxmFjVVQTCXzhzvN /NHOB2DH9c/bMMCeU7cV7Dre0MT1EC66T7Ro26mrhtEYGX/IVziSzkHPwfEyJKIYAiX+u HoQFViyl01vosNAg+BSxrnU9bSYOoNwN3T0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2012 When driver is unloaded, the ExitBootSerivesEvent must be closed at the same time. Otherwise exception will occur when ExitBootServices. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Wei6 Xu --- .../DebugLibConstructor.c | 23 ++++++++++++++++++= ++++ .../UefiDebugLibDebugPortProtocol.inf | 1 + 2 files changed, 24 insertions(+) diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstruct= or.c b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c index de60d339a8..6ea0912f2b 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c @@ -73,5 +73,28 @@ DxeDebugLibConstructor( &mExitBootServicesEvent ); =20 return EFI_SUCCESS; } + +/** + The destructor closes Exit Boot Services 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 always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +DxeDebugLibDestructor( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + if (mExitBootServicesEvent !=3D NULL) { + SystemTable->BootServices->CloseEvent (mExitBootServicesEvent); + } + + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebug= PortProtocol.inf b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLi= bDebugPortProtocol.inf index 10a8f2a857..ff09a12ce4 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortPro= tocol.inf +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortPro= tocol.inf @@ -20,10 +20,11 @@ MODULE_TYPE =3D UEFI_DRIVER VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D DebugLib|DXE_CORE DXE_DRIVER DXE_RUNT= IME_DRIVER UEFI_APPLICATION UEFI_DRIVER =20 CONSTRUCTOR =3D DxeDebugLibConstructor + DESTRUCTOR =3D DxeDebugLibDestructor =20 # # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44434): https://edk2.groups.io/g/devel/message/44434 Mute This Topic: https://groups.io/mt/32605739/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-