From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1D0982249273D for ; Thu, 1 Mar 2018 21:54:19 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 22:00:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,411,1515484800"; d="scan'208";a="21968696" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 01 Mar 2018 22:00:27 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Mar 2018 22:00:27 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Fri, 2 Mar 2018 14:00:25 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH 2/3] MdeModulePkg PiSmmCore: Register SMI handler to install S3SmmInitDone Thread-Index: AQHTseWNmV3/tu3Ex0Or4WYvvYuzi6O8c6sQ Date: Fri, 2 Mar 2018 06:00:24 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AAD9DD2@shsmsx102.ccr.corp.intel.com> References: <1519967749-5112-1-git-send-email-star.zeng@intel.com> <1519967749-5112-3-git-send-email-star.zeng@intel.com> In-Reply-To: <1519967749-5112-3-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDlhYjcxM2YtMjE2ZC00NjFhLTk0NjgtMzE3NDRiYzE4ZDVlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ1NGFqQWlsc2lvRVF0NHFNRHZyeEVTZVFnakNyQjZWcFwvYm9iT2psK2YzR0JBSFpcL2s3ZUt0STN3WFNvNE5nUDYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/3] MdeModulePkg PiSmmCore: Register SMI handler to install S3SmmInitDone 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: , X-List-Received-Date: Fri, 02 Mar 2018 05:54:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Friday, March 2, 2018 1:16 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH 2/3] MdeModulePkg PiSmmCore: Register SMI handler to inst= all > S3SmmInitDone >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Core/PiSmmCore/PiSmmCore.c | 62 > ++++++++++++++++++++++++++++++- > MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 26 ++++++++++++- > MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 3 +- > 3 files changed, 88 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c > b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c > index d2f0207b5c83..686b9b45a556 100644 > --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c > +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c > @@ -1,7 +1,7 @@ > /** @file > SMM Core Main Entry Point >=20 > - Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -87,6 +87,7 @@ SMM_CORE_SMI_HANDLERS mSmmCoreSmiHandlers[] > =3D { > { SmmExitBootServicesHandler, &gEfiEventExitBootServicesGuid, NUL= L, > FALSE }, > { SmmReadyToBootHandler, &gEfiEventReadyToBootGuid, > NULL, FALSE }, > { SmmEndOfDxeHandler, &gEfiEndOfDxeEventGroupGuid, > NULL, TRUE }, > + { SmmS3SmmInitDoneHandler, &gEdkiiS3SmmInitDoneGuid, > NULL, FALSE }, > { SmmEndOfS3ResumeHandler, &gEdkiiEndOfS3ResumeGuid, > NULL, FALSE }, > { NULL, NULL, > NULL, FALSE } > }; > @@ -472,6 +473,65 @@ SmmEndOfDxeHandler ( > } >=20 > /** > + Software SMI handler that is called when the S3SmmInitDone signal is > triggered. > + This function installs the SMM S3SmmInitDone Protocol so SMM Drivers a= re > informed that > + S3 SMM initialization has been done. > + > + @param DispatchHandle The unique handle assigned to this handler by > SmiHandlerRegister(). > + @param Context Points to an optional handler context which > was specified when the handler was registered. > + @param CommBuffer A pointer to a collection of data in memory > that will > + be conveyed from a non-SMM environment into > an SMM environment. > + @param CommBufferSize The size of the CommBuffer. > + > + @return Status Code > + > +**/ > +EFI_STATUS > +EFIAPI > +SmmS3SmmInitDoneHandler ( > + IN EFI_HANDLE DispatchHandle, > + IN CONST VOID *Context, OPTIONAL > + IN OUT VOID *CommBuffer, OPTIONAL > + IN OUT UINTN *CommBufferSize OPTIONAL > + ) > +{ > + EFI_STATUS Status; > + EFI_HANDLE SmmHandle; > + > + DEBUG ((DEBUG_INFO, "SmmS3SmmInitDoneHandler\n")); > + > + if (!mDuringS3Resume) { > + DEBUG ((DEBUG_ERROR, "It is not during S3 resume\n")); > + return EFI_SUCCESS; > + } > + > + // > + // Install SMM S3SmmInitDone protocol > + // > + SmmHandle =3D NULL; > + Status =3D SmmInstallProtocolInterface ( > + &SmmHandle, > + &gEdkiiS3SmmInitDoneGuid, > + EFI_NATIVE_INTERFACE, > + NULL > + ); > + ASSERT_EFI_ERROR (Status); > + > + // > + // Uninstall the protocol here because the comsumer just hook the > + // installation event. > + // > + Status =3D SmmUninstallProtocolInterface ( > + SmmHandle, > + &gEdkiiS3SmmInitDoneGuid, > + NULL > + ); > + ASSERT_EFI_ERROR (Status); > + > + return Status; > +} > + > +/** > Software SMI handler that is called when the EndOfS3Resume signal is > triggered. > This function installs the SMM EndOfS3Resume Protocol so SMM Drivers a= re > informed that > S3 resume has finished. > diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > index 8c10d833e2ae..2f6032646f46 100644 > --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > @@ -2,7 +2,7 @@ > The internal header file includes the common header files, defines > internal structure and functions used by SmmCore module. >=20 > - Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include >=20 > #include > #include > @@ -811,6 +812,29 @@ SmmReadyToBootHandler ( > ); >=20 > /** > + Software SMI handler that is called when the S3SmmInitDone signal is > triggered. > + This function installs the SMM S3SmmInitDone Protocol so SMM Drivers a= re > informed that > + S3 SMM initialization has been done. > + > + @param DispatchHandle The unique handle assigned to this handler by > SmiHandlerRegister(). > + @param Context Points to an optional handler context which > was specified when the handler was registered. > + @param CommBuffer A pointer to a collection of data in memory > that will > + be conveyed from a non-SMM environment into > an SMM environment. > + @param CommBufferSize The size of the CommBuffer. > + > + @return Status Code > + > +**/ > +EFI_STATUS > +EFIAPI > +SmmS3SmmInitDoneHandler ( > + IN EFI_HANDLE DispatchHandle, > + IN CONST VOID *Context, OPTIONAL > + IN OUT VOID *CommBuffer, OPTIONAL > + IN OUT UINTN *CommBufferSize OPTIONAL > + ); > + > +/** > Software SMI handler that is called when the EndOfS3Resume event is > trigged. > This function installs the SMM EndOfS3Resume Protocol so SMM Drivers a= re > informed that > S3 resume has finished. > diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf > b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf > index 5c04e851f94b..09cffb879e6f 100644 > --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf > +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf > @@ -1,7 +1,7 @@ > ## @file > # This module provide an SMM CIS compliant implementation of SMM Core. > # > -# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> +# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the = BSD > License > @@ -124,6 +124,7 @@ [Guids] > ## SOMETIMES_PRODUCES ## GUID # SmiHandlerRegister > gSmiHandlerProfileGuid > gEdkiiEndOfS3ResumeGuid ## SOMETIMES_PRODUCES ## GUID # Install > protocol > + gEdkiiS3SmmInitDoneGuid ## SOMETIMES_PRODUCES ## GUID # Install > protocol >=20 > [UserExtensions.TianoCore."ExtraFiles"] > PiSmmCoreExtra.uni > -- > 2.7.0.windows.1