From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by mx.groups.io with SMTP id smtpd.web12.95.1578074561765819262 for ; Fri, 03 Jan 2020 10:02:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@protonmail.com header.s=default header.b=m7G7LDuV; spf=pass (domain: protonmail.com, ip: 185.70.40.22, mailfrom: vit9696@protonmail.com) Date: Fri, 03 Jan 2020 18:02:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1578074558; bh=P8zkcqKNjX6NoW9sAsdsXJ2AO1ALed6zCaHV3kV0o1M=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:Feedback-ID: From; b=m7G7LDuV52+hYLN8N0KZCrci4hR4vjrlbBHe1HzSU3xrExed7QtPSwe1a9bpdasGJ 3lnkMKEz4nkJgwAyVdrwkrXQ/W5EEteiZEUQpaYbXtrut3pHe4lD1UgYnEkJH3Egoo 22gS4kGQrZpPk1J0W6MHxuSxKdq796eQJiFI62b8= To: devel@edk2.groups.io From: "Vitaly Cheptsov" Reply-To: Vitaly Cheptsov Subject: [PATCH v1 1/1] MdePkg: Do not use CreateEventEx unless required Message-ID: <20200103180232.65292-2-vit9696@protonmail.com> In-Reply-To: <20200103180232.65292-1-vit9696@protonmail.com> References: <20200103180232.65292-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 X-Groupsio-MsgNum: 52841 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------df644e72294dc24283ea457bf816ae3b"; charset=UTF-8 -----------------------df644e72294dc24283ea457bf816ae3b Content-Transfer-Encoding: quoted-printable Date: Fri, 3 Jan 2020 21:02:32 +0300 From: Vitaly Cheptsov In-Reply-To: <20200103180232.65292-1-vit9696@protonmail.com> Message-Id: <20200103180232.65292-2-vit9696@protonmail.com> Mime-Version: 1.0 References: <20200103180232.65292-1-vit9696@protonmail.com> Subject: [PATCH v1 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) 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 --- 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 ++= ++------ 7 files changed, 15 insertions(+), 23 deletions(-) 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) -----------------------df644e72294dc24283ea457bf816ae3b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJeD4G6CRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xfcNB/wNxfqV AJXYy9w1C47e/L0aoJsBjm6CyHenQ/MakPEyhXNwPBRN3ocK5M2hB+K0jzax AnMIARnYqvdi16dFJGHUGbZZfukdPHSLhK6z/kQRMJ5Tcw7/Ttv662jcTr97 MWl9vlUQiCGnBOhiBPwlQhTa8Ypb3c6t7cQEiI4Ji569eyzwuCGNKipWWZQx 78CdUuam1bnIMfah8O4QaBYuLxuW2B1DdQvJQRcgoK7oofDGoqbq+e6p2/oH 2cwWH9S2/dU0o2YGk+HdPnxMqKTTbo4Nb8LVLcgoj91kvdQEMYQAwV14LfM0 7zg9MvRBgaAMBm8xqSXSv4wd+oAvjCq2WKfA =BYud -----END PGP SIGNATURE----- -----------------------df644e72294dc24283ea457bf816ae3b--