public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Star Zeng <star.zeng@intel.com>, edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>, Eric Dong <eric.dong@intel.com>
Subject: Re: [PATCH] MdeModulePkg: Rename SmmEndOfS3ResumeProtocolGuid to EndOfS3ResumeGuid
Date: Mon, 11 Dec 2017 17:28:03 +0100	[thread overview]
Message-ID: <0fa6b8b3-a66f-5326-105f-50cb4ca8f6a5@redhat.com> (raw)
In-Reply-To: <1512981336-3508-1-git-send-email-star.zeng@intel.com>

On 12/11/17 09:35, Star Zeng wrote:
> Rename SmmEndOfS3ResumeProtocolGuid to EndOfS3ResumeGuid as the GUID
> may be used to install PPI in future to notify PEI phase code.
> 
> The references in UefiCpuPkg are also being updated.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  MdeModulePkg/Core/PiSmmCore/PiSmmCore.c                      | 10 +++++-----
>  MdeModulePkg/Core/PiSmmCore/PiSmmCore.h                      |  2 +-
>  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf                    |  2 +-
>  .../{Protocol/SmmEndOfS3Resume.h => Guid/EndOfS3Resume.h}    | 12 ++++++------
>  MdeModulePkg/MdeModulePkg.dec                                |  6 +++---
>  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c            |  9 ++++-----
>  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf      |  6 ++----
>  7 files changed, 22 insertions(+), 25 deletions(-)
>  rename MdeModulePkg/Include/{Protocol/SmmEndOfS3Resume.h => Guid/EndOfS3Resume.h} (67%)
> 
> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> index 4c1e3e719524..0b9c7958c75c 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> @@ -81,7 +81,7 @@ SMM_CORE_SMI_HANDLERS  mSmmCoreSmiHandlers[] = {
>    { SmmExitBootServicesHandler, &gEfiEventExitBootServicesGuid,      NULL, FALSE },
>    { SmmReadyToBootHandler,      &gEfiEventReadyToBootGuid,           NULL, FALSE },
>    { SmmEndOfDxeHandler,         &gEfiEndOfDxeEventGroupGuid,         NULL, TRUE },
> -  { SmmEndOfS3ResumeHandler,    &gEdkiiSmmEndOfS3ResumeProtocolGuid, NULL, FALSE },
> +  { SmmEndOfS3ResumeHandler,    &gEdkiiEndOfS3ResumeGuid,            NULL, FALSE },
>    { NULL,                       NULL,                                NULL, FALSE }
>  };
>  
> @@ -384,7 +384,7 @@ SmmEndOfDxeHandler (
>  }
>  
>  /**
> -  Software SMI handler that is called when the EndOfS3Resume event is trigged.
> +  Software SMI handler that is called when the EndOfS3Resume signal is triggered.
>    This function installs the SMM EndOfS3Resume Protocol so SMM Drivers are informed that
>    S3 resume has finished.
>  
> @@ -417,19 +417,19 @@ SmmEndOfS3ResumeHandler (
>    SmmHandle = NULL;
>    Status = SmmInstallProtocolInterface (
>               &SmmHandle,
> -             &gEdkiiSmmEndOfS3ResumeProtocolGuid,
> +             &gEdkiiEndOfS3ResumeGuid,
>               EFI_NATIVE_INTERFACE,
>               NULL
>               );
>    ASSERT_EFI_ERROR (Status);
>  
>    //
> -  // Uninstall the protocol here because the comsume just hook the
> +  // Uninstall the protocol here because the comsumer just hook the
>    // installation event.
>    //
>    Status = SmmUninstallProtocolInterface (
>             SmmHandle,
> -           &gEdkiiSmmEndOfS3ResumeProtocolGuid,
> +           &gEdkiiEndOfS3ResumeGuid,
>             NULL
>             );
>    ASSERT_EFI_ERROR (Status);
> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
> index cdc491c32429..2729a434d8f8 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
> @@ -32,7 +32,6 @@
>  #include <Protocol/SmmExitBootServices.h>
>  #include <Protocol/SmmLegacyBoot.h>
>  #include <Protocol/SmmReadyToBoot.h>
> -#include <Protocol/SmmEndOfS3Resume.h>
>  #include <Protocol/SmmMemoryAttribute.h>
>  
>  #include <Guid/Apriori.h>
> @@ -41,6 +40,7 @@
>  #include <Guid/MemoryProfile.h>
>  #include <Guid/LoadModuleAtFixedAddress.h>
>  #include <Guid/SmiHandlerProfile.h>
> +#include <Guid/EndOfS3Resume.h>
>  
>  #include <Library/BaseLib.h>
>  #include <Library/BaseMemoryLib.h>
> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> index 01d706d0e312..de0037fe4a99 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> @@ -81,7 +81,6 @@ [Protocols]
>    gEdkiiSmmExitBootServicesProtocolGuid         ## SOMETIMES_PRODUCES
>    gEdkiiSmmLegacyBootProtocolGuid               ## SOMETIMES_PRODUCES
>    gEdkiiSmmReadyToBootProtocolGuid              ## PRODUCES
> -  gEdkiiSmmEndOfS3ResumeProtocolGuid            ## SOMETIMES_PRODUCES
>  
>    gEfiSmmSwDispatch2ProtocolGuid                ## SOMETIMES_CONSUMES
>    gEfiSmmSxDispatch2ProtocolGuid                ## SOMETIMES_CONSUMES
> @@ -123,6 +122,7 @@ [Guids]
>    ## SOMETIMES_PRODUCES   ## GUID # Install protocol
>    ## SOMETIMES_PRODUCES   ## GUID # SmiHandlerRegister
>    gSmiHandlerProfileGuid
> +  gEdkiiEndOfS3ResumeGuid ## SOMETIMES_PRODUCES ## GUID # Install protocol
>  
>  [UserExtensions.TianoCore."ExtraFiles"]
>    PiSmmCoreExtra.uni
> diff --git a/MdeModulePkg/Include/Protocol/SmmEndOfS3Resume.h b/MdeModulePkg/Include/Guid/EndOfS3Resume.h
> similarity index 67%
> rename from MdeModulePkg/Include/Protocol/SmmEndOfS3Resume.h
> rename to MdeModulePkg/Include/Guid/EndOfS3Resume.h
> index 9716f6a22ac6..853aa1afbc17 100644
> --- a/MdeModulePkg/Include/Protocol/SmmEndOfS3Resume.h
> +++ b/MdeModulePkg/Include/Guid/EndOfS3Resume.h
> @@ -1,6 +1,6 @@
>  /** @file
> -  This Protocol will be installed at the end of S3 resume phase in SMM environment. 
> -  It allows for smm drivers to hook this point and do the requried tasks.
> +  This GUID will be installed at the end of S3 resume phase as protocol in SMM environment. 
> +  It allows for SMM drivers to hook this point and do the required tasks.
>  
>    Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
>    This program and the accompanying materials                          
> @@ -13,14 +13,14 @@
>  
>  **/
>  
> -#ifndef __SMM_END_OF_S3_RESUME_H__
> -#define __SMM_END_OF_S3_RESUME_H__
> +#ifndef __END_OF_S3_RESUME_H__
> +#define __END_OF_S3_RESUME_H__
>  
> -#define EDKII_SMM_END_OF_S3_RESUME_PROTOCOL_GUID \
> +#define EDKII_END_OF_S3_RESUME_GUID \
>    { \
>      0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } \
>    }
>  
> -extern EFI_GUID gEdkiiSmmEndOfS3ResumeProtocolGuid;
> +extern EFI_GUID gEdkiiEndOfS3ResumeGuid;
>  
>  #endif
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index b3831a21ad08..8efad57766a0 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -392,6 +392,9 @@ [Guids]
>    ## Include/Guid/PlatformHasAcpi.h
>    gEdkiiPlatformHasAcpiGuid = { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04, 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } }
>  
> +  ## Include/Guid/EndofS3Resume.h
> +  gEdkiiEndOfS3ResumeGuid = { 0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } }
> +
>  [Ppis]
>    ## Include/Ppi/AtaController.h
>    gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
> @@ -556,9 +559,6 @@ [Protocols]
>    ## Include/Protocol/IoMmu.h
>    gEdkiiIoMmuProtocolGuid = { 0x4e939de9, 0xd948, 0x4b0f, { 0x88, 0xed, 0xe6, 0xe1, 0xce, 0x51, 0x7c, 0x1e } }
>  
> -  ## Include/Protocol/SmmEndofS3Resume.h
> -  gEdkiiSmmEndOfS3ResumeProtocolGuid = { 0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } }
> -
>    ## Include/Protocol/SmmMemoryAttribute.h
>    gEdkiiSmmMemoryAttributeProtocolGuid = { 0x69b792ea, 0x39ce, 0x402d, { 0xa2, 0xa6, 0xf7, 0x21, 0xde, 0x35, 0x1d, 0xfe } }
>  
> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> index e0c2d366cd0d..b597ac7dc5ff 100644
> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> @@ -23,6 +23,7 @@
>  #include <Guid/AcpiS3Context.h>
>  #include <Guid/BootScriptExecutorVariable.h>
>  #include <Guid/Performance.h>
> +#include <Guid/EndOfS3Resume.h>
>  #include <Ppi/ReadOnlyVariable2.h>
>  #include <Ppi/S3Resume2.h>
>  #include <Ppi/SmmAccess.h>
> @@ -30,8 +31,6 @@
>  #include <Ppi/EndOfPeiPhase.h>
>  #include <Ppi/SmmCommunication.h>
>  
> -#include <Protocol/SmmEndOfS3Resume.h>
> -
>  #include <Library/DebugLib.h>
>  #include <Library/BaseLib.h>
>  #include <Library/TimerLib.h>
> @@ -156,7 +155,7 @@ typedef union {
>  
>  //
>  // Define two type of smm communicate headers.
> -// One for 32 bits  PEI + 64 bits DXE, the other for 32 bits PEI + 32 bits DXE case.
> +// One for 32 bits PEI + 64 bits DXE, the other for 32 bits PEI + 32 bits DXE case.
>  //
>  typedef struct {
>    EFI_GUID  HeaderGuid;
> @@ -471,7 +470,7 @@ SignalEndOfS3Resume (
>    // This buffer consumed in DXE phase, so base on DXE mode to prepare communicate buffer.
>    // Detect whether DXE is 64 bits mode.
>    // if (sizeof(UINTN) == sizeof(UINT64), PEI already 64 bits, assume DXE also 64 bits.
> -  // or (FeaturePcdGet (PcdDxeIplSwitchToLongMode)), Dxe will switch to 64 bits.
> +  // or (FeaturePcdGet (PcdDxeIplSwitchToLongMode)), DXE will switch to 64 bits.
>    //
>    if ((sizeof(UINTN) == sizeof(UINT64)) || (FeaturePcdGet (PcdDxeIplSwitchToLongMode))) {
>      CommBuffer = &Header64;
> @@ -482,7 +481,7 @@ SignalEndOfS3Resume (
>      Header32.MessageLength = 0;
>      CommSize = OFFSET_OF (SMM_COMMUNICATE_HEADER_32, Data);
>    }
> -  CopyGuid (CommBuffer, &gEdkiiSmmEndOfS3ResumeProtocolGuid);
> +  CopyGuid (CommBuffer, &gEdkiiEndOfS3ResumeGuid);
>  
>    Status = PeiServicesLocatePpi (
>               &gEfiPeiSmmCommunicationPpiGuid,
> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
> index 943f114e6932..15fa2d15431c 100644
> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
> @@ -5,7 +5,7 @@
>  # This module will excute the boot script saved during last boot and after that,
>  # control is passed to OS waking up handler.
>  #
> -# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
>  # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
>  #
>  # This program and the accompanying materials are
> @@ -78,6 +78,7 @@ [Guids]
>    ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox
>    gEfiAcpiVariableGuid
>    gEfiAcpiS3ContextGuid                         ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox
> +  gEdkiiEndOfS3ResumeGuid                       ## SOMETIMES_CONSUMES ## UNDEFINED # Used to do smm communication
>  
>  [Ppis]
>    gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
> @@ -87,9 +88,6 @@ [Ppis]
>    gEfiEndOfPeiSignalPpiGuid                     ## SOMETIMES_PRODUCES
>    gEfiPeiSmmCommunicationPpiGuid                ## SOMETIMES_CONSUMES
>  
> -[Protocols]
> -  gEdkiiSmmEndOfS3ResumeProtocolGuid            ## SOMETIMES_CONSUMES
> -
>  [FeaturePcd]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode         ## CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport  ## CONSUMES
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



      parent reply	other threads:[~2017-12-11 16:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11  8:35 [PATCH] MdeModulePkg: Rename SmmEndOfS3ResumeProtocolGuid to EndOfS3ResumeGuid Star Zeng
2017-12-11 13:27 ` Yao, Jiewen
2017-12-11 16:28 ` Laszlo Ersek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0fa6b8b3-a66f-5326-105f-50cb4ca8f6a5@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox