From nobody Fri Apr 26 10:58:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52980+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52980+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1578394241; cv=none; d=zohomail.com; s=zohoarc; b=CqMN6vqERQz7uxaBdAHPwnBz+eFkA4zcZPa3yJoLNCtW4mfbyMLKSmB/utuC6EXOu/2jErLkvKCMAjXwDbNkUAYdC5DlVBxKxPQl5tqmsKgqfGO6DSFi3OwusoFmsMuAmxKj8ALiIg5d+chDmpvB0xy/AnOwjl4gOoXhu3nAisQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578394241; h=Content-Type:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bkDEVGVjb3gYTlKI6uqDPX2NxTc3iTz3NlrrPSssFAI=; b=FodrS/TgPMyw+F7J46nymietwOevcKoh/ARhGKXx4M5TuPwsAVYS0AWweuAIze8WxD6fqJ6jC2Ps+93KpfxrPuEhBCIhOEDq9gDo9E5mo08nYiLVsxSiE8qO8hwH7SHjDn7Uc5MfN/GY59mRPT27GdS7q4mwqlczG+9PLqbW8u0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52980+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1578394241248477.9041894705821; Tue, 7 Jan 2020 02:50:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3xCzYY1788612xSkFccAUqYA; Tue, 07 Jan 2020 02:50:40 -0800 X-Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by mx.groups.io with SMTP id smtpd.web11.4198.1578394238720129652 for ; Tue, 07 Jan 2020 02:50:39 -0800 Date: Tue, 07 Jan 2020 10:50:32 +0000 To: devel@edk2.groups.io From: "Vitaly Cheptsov via Groups.Io" Reply-To: devel@edk2.groups.io,vit9696@protonmail.com Subject: [edk2-devel] [PATCH v2 1/1] MdePkg: Do not use CreateEventEx unless required Message-ID: <20200107105028.65035-2-vit9696@protonmail.com> In-Reply-To: <20200107105028.65035-1-vit9696@protonmail.com> References: <20200107105028.65035-1-vit9696@protonmail.com> Feedback-ID: p9QuX-L1wMgUm6nrSvNrf8juLupNs0VSnzXGVXuYDxlEahFdWtaedWDMB9zpwGDklGt7kzs1-RBc0cqz327Gcg==:Ext:ProtonMail MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io X-Gm-Message-State: YYHXFYTmBf6LhvkTNk3aQJYRx1787277AA= Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------112fd564b2d091fdcbd28d3755ec432f"; charset=UTF-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1578394240; bh=L5K3qsWMDxzrKxl3MUhLU6ELSgvE0OHdBfF0UxARdp0=; h=Content-Type:Date:From:Reply-To:Subject:To; b=SZCs1NeVI7zFlVBomMYa2r4cJmOc50f3ZMA+F/1oaXDqAI6wIfRNRg2E3IX+Q+VUN6w ENhtQu2GpEN2KUpTVbb6NKIhh61pEFSLnPodSG0/WTd+RUPhQeOIeJrub09QKt6q14LWw KPDSuDBd1iV/0IlfzbOXEPdDNSo/9B+cqPA= X-Zoho-Virus-Status: 1 X-ZohoMail-DKIM: pass (identity @groups.io) -----------------------112fd564b2d091fdcbd28d3755ec432f Content-Transfer-Encoding: quoted-printable Date: Tue, 7 Jan 2020 13:50:28 +0300 From: Vitaly Cheptsov In-Reply-To: <20200107105028.65035-1-vit9696@protonmail.com> Message-Id: <20200107105028.65035-2-vit9696@protonmail.com> Mime-Version: 1.0 References: <20200107105028.65035-1-vit9696@protonmail.com> Subject: [PATCH v2 1/1] MdePkg: Do not use CreateEventEx unless required To: devel@edk2.groups.io X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2446 There are many firmwares in the wild not supporting CreateEventEx, including devices less than 5 years old. Signed-off-by: Vitaly Cheptsov Reviewed-by: Liming Gao --- MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.i= nf | 3 --- MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf = | 4 ---- MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLibSegmentInfo= .inf | 3 --- MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf = | 3 --- MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol= .inf | 3 --- MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf = | 3 --- MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf = | 5 ----- MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c = | 3 +-- MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c = | 5 ++--- MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c = | 5 ++--- MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c = | 5 ++--- MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c = | 5 ++--- MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c = | 5 ++--- MdePkg/Library/UefiRuntimeLib/RuntimeLib.c = | 10 ++++------ 14 files changed, 15 insertions(+), 47 deletions(-) diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLib= SerialPort.inf b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebu= gLibSerialPort.inf index 655c1c14c1..31d169ad7c 100644 --- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialP= ort.inf +++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialP= ort.inf @@ -41,9 +41,6 @@ [LibraryClasses] PrintLib SerialPortLib =20 -[Guids] - gEfiEventExitBootServicesGuid ## CONSUMES ## Eve= nt - [Pcd] gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSU= MES gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES diff --git a/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib= .inf b/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf index 45bfe9dc6f..8d2ba1d187 100644 --- a/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf +++ b/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf @@ -47,7 +47,3 @@ [LibraryClasses] =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES - -[Guids] - gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event - diff --git a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLi= bSegmentInfo.inf b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSeg= mentLibSegmentInfo.inf index f6445f4abb..ae9f11b697 100644 --- a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLibSegmen= tInfo.inf +++ b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLibSegmen= tInfo.inf @@ -45,6 +45,3 @@ [LibraryClasses] MemoryAllocationLib DxeServicesTableLib UefiBootServicesTableLib - -[Guids] - gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event diff --git a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf b/Mde= Pkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf index b577d52ac6..53bbc8ce3f 100644 --- a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf +++ b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf @@ -46,9 +46,6 @@ [LibraryClasses] PrintLib DebugPrintErrorLevelLib =20 -[Guids] - gEfiEventExitBootServicesGuid ## CONSUMES - [Pcd] gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CO= NSUMES gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebug= PortProtocol.inf b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLi= bDebugPortProtocol.inf index ff09a12ce4..e12a1025c6 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortPro= tocol.inf +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortPro= tocol.inf @@ -46,9 +46,6 @@ [LibraryClasses] PrintLib DebugPrintErrorLevelLib =20 -[Guids] - gEfiEventExitBootServicesGuid ## CONSUMES - [Protocols] gEfiDebugPortProtocolGuid ## CONSUMES =20 diff --git a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf b/Mde= Pkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf index 11f7594626..5ecb971a0a 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf +++ b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf @@ -44,9 +44,6 @@ [LibraryClasses] PrintLib DebugPrintErrorLevelLib =20 -[Guids] - gEfiEventExitBootServicesGuid ## CONSUMES - [Pcd] gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf b/MdePkg/Libr= ary/UefiRuntimeLib/UefiRuntimeLib.inf index 5527f9f02f..cc4ee15110 100644 --- a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf +++ b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf @@ -39,8 +39,3 @@ [LibraryClasses] UefiBootServicesTableLib UefiRuntimeServicesTableLib DebugLib - -[Guids] - gEfiEventExitBootServicesGuid ## CONSUMES ## Event - gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event - diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c b/MdePk= g/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c index 862c6bff09..cc79843b1c 100644 --- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c @@ -77,9 +77,8 @@ DxeRuntimeDebugLibSerialPortConstructor ( return Status; } =20 - return SystemTable->BootServices->CreateEventEx (EVT_NOTIFY_SIGNAL, + return SystemTable->BootServices->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERV= ICES, TPL_NOTIFY, ExitBootServicesEvent, N= ULL, - &gEfiEventExitBootServicesGuid, &mEfiExitBootServicesEvent); } =20 diff --git a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c b/MdePk= g/Library/DxeRuntimePciExpressLib/PciExpressLib.c index 6e784763be..7e5852e641 100644 --- a/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c +++ b/MdePkg/Library/DxeRuntimePciExpressLib/PciExpressLib.c @@ -124,12 +124,11 @@ DxeRuntimePciExpressLibConstructor ( // // Register SetVirtualAddressMap () notify function // - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + Status =3D gBS->CreateEvent ( + EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, TPL_NOTIFY, DxeRuntimePciExpressLibVirtualNotify, NULL, - &gEfiEventVirtualAddressChangeGuid, &mDxeRuntimePciExpressLibVirtualNotifyEvent ); ASSERT_EFI_ERROR (Status); diff --git a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLi= b.c b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c index 2f503ecffe..b0dbdec0cf 100644 --- a/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c +++ b/MdePkg/Library/PciSegmentLibSegmentInfo/DxeRuntimePciSegmentLib.c @@ -109,12 +109,11 @@ DxeRuntimePciSegmentLibConstructor ( // // Register SetVirtualAddressMap () notify function // - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + Status =3D gBS->CreateEvent ( + EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, TPL_NOTIFY, DxeRuntimePciSegmentLibVirtualNotify, NULL, - &gEfiEventVirtualAddressChangeGuid, &mDxeRuntimePciSegmentLibVirtualNotifyEvent ); ASSERT_EFI_ERROR (Status); diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c b/MdeP= kg/Library/UefiDebugLibConOut/DebugLibConstructor.c index ed73f92818..b4ac17cf55 100644 --- a/MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c @@ -64,12 +64,11 @@ DxeDebugLibConstructor( { mDebugST =3D SystemTable; =20 - SystemTable->BootServices->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + SystemTable->BootServices->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesCallback, NULL, - &gEfiEventExitBootServicesGuid, &mExitBootServicesEvent ); =20 diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstruct= or.c b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c index 6ea0912f2b..96fc1c422f 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c @@ -64,12 +64,11 @@ DxeDebugLibConstructor( { mDebugBS =3D SystemTable->BootServices; =20 - mDebugBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + mDebugBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesCallback, NULL, - &gEfiEventExitBootServicesGuid, &mExitBootServicesEvent ); =20 diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c b/MdeP= kg/Library/UefiDebugLibStdErr/DebugLibConstructor.c index ed73f92818..b4ac17cf55 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c @@ -64,12 +64,11 @@ DxeDebugLibConstructor( { mDebugST =3D SystemTable; =20 - SystemTable->BootServices->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + SystemTable->BootServices->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesCallback, NULL, - &gEfiEventExitBootServicesGuid, &mExitBootServicesEvent ); =20 diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c b/MdePkg/Library/Ue= fiRuntimeLib/RuntimeLib.c index 933e0099ce..a2eadafac8 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c @@ -93,23 +93,21 @@ RuntimeDriverLibConstruct ( // // Register SetVirtualAddressMap () notify function // - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + Status =3D gBS->CreateEvent ( + EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, TPL_NOTIFY, RuntimeLibVirtualNotifyEvent, NULL, - &gEfiEventVirtualAddressChangeGuid, &mEfiVirtualNotifyEvent ); =20 ASSERT_EFI_ERROR (Status); =20 - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, + Status =3D gBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, RuntimeLibExitBootServicesEvent, NULL, - &gEfiEventExitBootServicesGuid, &mEfiExitBootServicesEvent ); =20 --=20 2.21.0 (Apple Git-122.2) -=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 (#52980): https://edk2.groups.io/g/devel/message/52980 Mute This Topic: https://groups.io/mt/69499713/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- -----------------------112fd564b2d091fdcbd28d3755ec432f Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJeFGJ3CRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xaoHB/9rLjCy VfM8YGUZY03UB9stikTJwbPbQ7aZHe2L4xfiRQkp1T8rlgSRsvLVo3I7P6DH OvxBiOBS/kjCoTq3FhMRsJorivOpiMvnhiGQCzZBFfZfnE4R9kVr+8EwO8wW 3lWrOcrVEnOuOl3UTtDYOd5sn27aCw8RDFf1oMXE9/9UIZ8+pXyg1Fsc3Yt2 0aQKWyn2Jo/EiAQtwkYdrAzIrK3OcmxF6ygpb+LJRllY6t3yrWqr6w/6ukWt lvKdaWFFjc6rDJxVX1y0Icu4zzxBwjcksWu+cM+Bu3mA8bfJ+ygqYY7PLH2K gznOiMiwIs4EceFaq3SBszZDM4W/7JmETPij =rkwu -----END PGP SIGNATURE----- -----------------------112fd564b2d091fdcbd28d3755ec432f--