From nobody Fri Nov 1 12:36:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1517553993943498.858541036896; Thu, 1 Feb 2018 22:46:33 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 19CAC223AF823; Thu, 1 Feb 2018 22:40:08 -0800 (PST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 62280223AF81C for ; Thu, 1 Feb 2018 22:40:06 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 22:45:44 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.19]) by fmsmga008.fm.intel.com with ESMTP; 01 Feb 2018 22:45:43 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="14900538" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 2 Feb 2018 14:45:30 +0800 Message-Id: <20180202064530.407028-11-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.1.windows.2 In-Reply-To: <20180202064530.407028-1-ruiyu.ni@intel.com> References: <20180202064530.407028-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 10/10] MdeModulePkg/ResetSystemPei: Add reset notifications in PEI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Star Zeng , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Bret Barkelew The Reset Notification protocol is added in UEFI spec to support reset notification mechanism in the DXE phase. This patch adds similar EDKII specific Reset Notification PPI to PEI phase to provide the same support. Cc: Liming Gao Cc: Michael D Kinney Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bret Barkelew Signed-off-by: Ruiyu Ni --- .../Ppi/PlatformSpecificResetNotification.h | 31 ++++++++++++++++++= ++++ MdeModulePkg/MdeModulePkg.dec | 3 +++ .../Universal/ResetSystemPei/ResetSystem.c | 16 +++++++++++ .../Universal/ResetSystemPei/ResetSystem.h | 1 + .../Universal/ResetSystemPei/ResetSystemPei.inf | 7 ++--- 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetNotificat= ion.h diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h b= /MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h new file mode 100644 index 0000000000..ea53e24133 --- /dev/null +++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h @@ -0,0 +1,31 @@ +/** @file + This PPI provides services to register a platform specific notification = callback for + ResetSystem(). The registered handlers are processed after + EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications. + + Copyright (c) 2017 Intel Corporation. All rights reserved.
+ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
+ + This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#ifndef _PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_H_ +#define _PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_H_ + +#include + +#define EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_GUID \ + { 0xe09f355d, 0xdae8, 0x4910, { 0xb1, 0x4a, 0x92, 0x78, 0x0f, 0xdc, 0xf7= , 0xcb } } + +typedef EFI_RESET_NOTIFICATION_PROTOCOL EDKII_PLATFORM_SPECIFIC_RESET_NOT= IFICATION_PPI; + +extern EFI_GUID gEdkiiPlatformSpecificResetNotificationPpiGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 1b971d599f..297b02ffa9 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -444,6 +444,9 @@ [Ppis] ## Include/Ppi/PlatformSpecificResetFilter.h gEdkiiPlatformSpecificResetFilterPpiGuid =3D { 0x8c9f4de3, 0x7b90, 0x47e= f, { 0x93, 0x8, 0x28, 0x7c, 0xec, 0xd6, 0x6d, 0xe8 } } =20 + ## Include/Ppi/PlatformSpecificResetNotification.h + gEdkiiPlatformSpecificResetNotificationPpiGuid =3D { 0xe09f355d, 0xdae8,= 0x4910, { 0xb1, 0x4a, 0x92, 0x78, 0xf, 0xdc, 0xf7, 0xcb } } + ## Include/Ppi/PlatformSpecificResetHandler.h gEdkiiPlatformSpecificResetHandlerPpiGuid =3D { 0x75cf14ae, 0x3441, 0x49= dc, { 0xaa, 0x10, 0xbb, 0x35, 0xa7, 0xba, 0x8b, 0xab } } =20 diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c b/MdeModul= ePkg/Universal/ResetSystemPei/ResetSystem.c index 720593de6a..4dfe303f77 100644 --- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c +++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c @@ -25,6 +25,7 @@ EFI_PEI_RESET2_PPI mPpiReset2 =3D { =20 EFI_GUID *mProcessingOrder[] =3D { &gEdkiiPlatformSpecificResetFilterPpiGuid, + &gEdkiiPlatformSpecificResetNotificationPpiGuid, &gEdkiiPlatformSpecificResetHandlerPpiGuid }; =20 @@ -36,6 +37,14 @@ RESET_FILTER_INSTANCE mResetFilter =3D { &gEdkiiPlatformSpecificResetFilterPpiGuid }; =20 +RESET_FILTER_INSTANCE mResetNotification =3D { + { + RegisterResetNotify, + UnregisterResetNotify + }, + &gEdkiiPlatformSpecificResetNotificationPpiGuid +}; + RESET_FILTER_INSTANCE mResetHandler =3D { { RegisterResetNotify, @@ -55,6 +64,11 @@ EFI_PEI_PPI_DESCRIPTOR mPpiListReset[] =3D { &gEdkiiPlatformSpecificResetFilterPpiGuid, &mResetFilter.ResetFilter }, + { + EFI_PEI_PPI_DESCRIPTOR_PPI, + &gEdkiiPlatformSpecificResetNotificationPpiGuid, + &mResetNotification.ResetFilter + }, { EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, &gEdkiiPlatformSpecificResetHandlerPpiGuid, @@ -101,6 +115,7 @@ RegisterResetNotify ( =20 ResetFilter =3D (RESET_FILTER_INSTANCE *) This; ASSERT (CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetFilt= erPpiGuid) || + CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetNoti= ficationPpiGuid) || CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetHand= lerPpiGuid) ); =20 @@ -187,6 +202,7 @@ UnregisterResetNotify ( =20 ResetFilter =3D (RESET_FILTER_INSTANCE *)This; ASSERT (CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetFilt= erPpiGuid) || + CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetNotificati= onPpiGuid) || CompareGuid (ResetFilter->Guid, &gEdkiiPlatformSpecificResetHandlerPpi= Guid) ); =20 diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h b/MdeModul= ePkg/Universal/ResetSystemPei/ResetSystem.h index 2fcc3592b6..b623a4c381 100644 --- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h +++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h @@ -21,6 +21,7 @@ =20 #include #include +#include #include =20 #include diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf b/Mde= ModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf index 38fdd16ceb..a88e2018b7 100644 --- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf +++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf @@ -48,9 +48,10 @@ [LibraryClasses] ReportStatusCodeLib =20 [Ppis] - gEfiPeiReset2PpiGuid ## PRODUCES - gEdkiiPlatformSpecificResetFilterPpiGuid ## PRODUCES - gEdkiiPlatformSpecificResetHandlerPpiGuid ## PRODUCES + gEfiPeiReset2PpiGuid ## PRODUCES + gEdkiiPlatformSpecificResetFilterPpiGuid ## PRODUCES + gEdkiiPlatformSpecificResetHandlerPpiGuid ## PRODUCES + gEdkiiPlatformSpecificResetNotificationPpiGuid ## PRODUCES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies --=20 2.15.1.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel