public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "michael.d.kinney@intel.com" <michael.d.kinney@intel.com>,
	"liming.gao@intel.com" <liming.gao@intel.com>,
	"star.zeng@intel.com" <star.zeng@intel.com>,
	"eric.dong@intel.com" <eric.dong@intel.com>,
	"ruiyu.ni@intel.com" <ruiyu.ni@intel.com>,
	"lersek@redhat.com" <lersek@redhat.com>,
	"kelly.steele@intel.com" <kelly.steele@intel.com>,
	"jordan.l.justen@intel.com" <jordan.l.justen@intel.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>
Subject: [PATCH 3/8] UefiCpuPkg/PiSmmCommunicationPei: Update MM PPI usages.
Date: Tue, 24 Jul 2018 01:40:36 +0000	[thread overview]
Message-ID: <VI1PR0801MB1790A37F01CDECBF6B88530C80550@VI1PR0801MB1790.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <d625966ce7c0ac98b65f1e946b2cf833f6801706.1532395896.git.Marvin.Haeuser@outlook.com>

Update all references to the SMM PPIs from MdeModulePkg to rather use
MdePkg's MM PPI declarations.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c   | 70 ++++++++++----------
 UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c   |  4 +-
 UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf | 10 +--
 UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf |  2 +-
 4 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
index aaeaa0672939..5c90f5193185 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
@@ -22,9 +22,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/HobLib.h>
 #include <Library/DebugLib.h>
 #include <Protocol/SmmCommunication.h>
-#include <Ppi/SmmCommunication.h>
-#include <Ppi/SmmAccess.h>
-#include <Ppi/SmmControl.h>
+#include <Ppi/MmCommunication.h>
+#include <Ppi/MmAccess.h>
+#include <Ppi/MmControl.h>
 #include <Guid/AcpiS3Context.h>
 
 #include "PiSmmCommunicationPrivate.h"
@@ -113,7 +113,7 @@ typedef EFI_CONFIGURATION_TABLE EFI_CONFIGURATION_TABLE64;
 
   This function provides a service to send and receive messages from a registered UEFI service.
 
-  @param[in] This                The EFI_PEI_SMM_COMMUNICATION_PPI instance.
+  @param[in] This                The EFI_PEI_MM_COMMUNICATION_PPI instance.
   @param[in, out] CommBuffer     A pointer to the buffer to convey into SMRAM.
   @param[in, out] CommSize       The size of the data buffer being passed in.On exit, the size of data
                                  being returned. Zero if the handler does not wish to reply with any data.
@@ -125,17 +125,17 @@ typedef EFI_CONFIGURATION_TABLE EFI_CONFIGURATION_TABLE64;
 EFI_STATUS
 EFIAPI
 Communicate (
-  IN CONST EFI_PEI_SMM_COMMUNICATION_PPI   *This,
+  IN CONST EFI_PEI_MM_COMMUNICATION_PPI    *This,
   IN OUT VOID                              *CommBuffer,
   IN OUT UINTN                             *CommSize
   );
 
-EFI_PEI_SMM_COMMUNICATION_PPI      mSmmCommunicationPpi = { Communicate };
+EFI_PEI_MM_COMMUNICATION_PPI       mMmCommunicationPpi = { Communicate };
 
 EFI_PEI_PPI_DESCRIPTOR mPpiList = {
   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
-  &gEfiPeiSmmCommunicationPpiGuid,
-  &mSmmCommunicationPpi
+  &gEfiPeiMmCommunicationPpiGuid,
+  &mMmCommunicationPpi
 };
 
 /**
@@ -151,7 +151,7 @@ GetCommunicationContext (
   EFI_HOB_GUID_TYPE                *GuidHob;
   EFI_SMM_COMMUNICATION_CONTEXT    *SmmCommunicationContext;
 
-  GuidHob = GetFirstGuidHob (&gEfiPeiSmmCommunicationPpiGuid);
+  GuidHob = GetFirstGuidHob (&gEfiPeiMmCommunicationPpiGuid);
   ASSERT (GuidHob != NULL);
 
   SmmCommunicationContext = (EFI_SMM_COMMUNICATION_CONTEXT *)GET_GUID_HOB_DATA (GuidHob);
@@ -174,7 +174,7 @@ SetCommunicationContext (
 
   BufferSize = sizeof (*SmmCommunicationContext);
   Hob.Raw = BuildGuidHob (
-              &gEfiPeiSmmCommunicationPpiGuid,
+              &gEfiPeiMmCommunicationPpiGuid,
               BufferSize
               );
   ASSERT (Hob.Raw);
@@ -257,7 +257,7 @@ InitCommunicationContext (
   SmmCommunicationContext = (EFI_SMM_COMMUNICATION_CONTEXT *)InternalSmstGetVendorTableByGuid (
                                                                SmmS3ResumeState->Signature,
                                                                (EFI_SMM_SYSTEM_TABLE2 *)(UINTN)SmmS3ResumeState->Smst,
-                                                               &gEfiPeiSmmCommunicationPpiGuid
+                                                               &gEfiPeiMmCommunicationPpiGuid
                                                                );
   ASSERT (SmmCommunicationContext != NULL);
 
@@ -271,7 +271,7 @@ InitCommunicationContext (
 
   This function provides a service to send and receive messages from a registered UEFI service.
 
-  @param[in] This                The EFI_PEI_SMM_COMMUNICATION_PPI instance.
+  @param[in] This                The EFI_PEI_MM_COMMUNICATION_PPI instance.
   @param[in, out] CommBuffer     A pointer to the buffer to convey into SMRAM.
   @param[in, out] CommSize       The size of the data buffer being passed in.On exit, the size of data
                                  being returned. Zero if the handler does not wish to reply with any data.
@@ -283,14 +283,14 @@ InitCommunicationContext (
 EFI_STATUS
 EFIAPI
 Communicate (
-  IN CONST EFI_PEI_SMM_COMMUNICATION_PPI   *This,
+  IN CONST EFI_PEI_MM_COMMUNICATION_PPI    *This,
   IN OUT VOID                              *CommBuffer,
   IN OUT UINTN                             *CommSize
   )
 {
   EFI_STATUS                       Status;
-  PEI_SMM_CONTROL_PPI              *SmmControl;
-  PEI_SMM_ACCESS_PPI               *SmmAccess;
+  EFI_PEI_MM_CONTROL_PPI           *MmControl;
+  EFI_PEI_MM_ACCESS_PPI            *MmAccess;
   UINT8                            SmiCommand;
   UINTN                            Size;
   EFI_SMM_COMMUNICATION_CONTEXT    *SmmCommunicationContext;
@@ -305,20 +305,20 @@ Communicate (
   // Get needed resource
   //
   Status = PeiServicesLocatePpi (
-             &gPeiSmmControlPpiGuid,
+             &gEfiPeiMmControlPpiGuid,
              0,
              NULL,
-             (VOID **)&SmmControl
+             (VOID **)&MmControl
              );
   if (EFI_ERROR (Status)) {
     return EFI_NOT_STARTED;
   }
 
   Status = PeiServicesLocatePpi (
-             &gPeiSmmAccessPpiGuid,
+             &gEfiPeiMmAccessPpiGuid,
              0,
              NULL,
-             (VOID **)&SmmAccess
+             (VOID **)&MmAccess
              );
   if (EFI_ERROR (Status)) {
     return EFI_NOT_STARTED;
@@ -327,8 +327,8 @@ Communicate (
   //
   // Check SMRAM locked, it should be done after SMRAM lock.
   //
-  if (!SmmAccess->LockState) {
-    DEBUG ((EFI_D_INFO, "PiSmmCommunicationPei LockState - %x\n", (UINTN)SmmAccess->LockState));
+  if (!MmAccess->LockState) {
+    DEBUG ((EFI_D_INFO, "PiSmmCommunicationPei LockState - %x\n", (UINTN)MmAccess->LockState));
     return EFI_NOT_STARTED;
   }
 
@@ -346,14 +346,14 @@ Communicate (
   //
   SmiCommand = (UINT8)SmmCommunicationContext->SwSmiNumber;
   Size = sizeof(SmiCommand);
-  Status = SmmControl->Trigger (
-                         (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
-                         SmmControl,
-                         (INT8 *)&SmiCommand,
-                         &Size,
-                         FALSE,
-                         0
-                         );
+  Status = MmControl->Trigger (
+                        (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+                        MmControl,
+                        (INT8 *)&SmiCommand,
+                        &Size,
+                        FALSE,
+                        0
+                        );
   ASSERT_EFI_ERROR (Status);
 
   //
@@ -383,7 +383,7 @@ PiSmmCommunicationPeiEntryPoint (
   )
 {
   EFI_STATUS                      Status;
-  PEI_SMM_ACCESS_PPI              *SmmAccess;
+  EFI_PEI_MM_ACCESS_PPI           *MmAccess;
   EFI_BOOT_MODE                   BootMode;
   UINTN                           Index;
 
@@ -393,10 +393,10 @@ PiSmmCommunicationPeiEntryPoint (
   }
 
   Status = PeiServicesLocatePpi (
-             &gPeiSmmAccessPpiGuid,
+             &gEfiPeiMmAccessPpiGuid,
              0,
              NULL,
-             (VOID **)&SmmAccess
+             (VOID **)&MmAccess
              );
   if (EFI_ERROR (Status)) {
     return EFI_NOT_STARTED;
@@ -405,8 +405,8 @@ PiSmmCommunicationPeiEntryPoint (
   //
   // Check SMRAM locked, it should be done before SMRAM lock.
   //
-  if (SmmAccess->LockState) {
-    DEBUG ((EFI_D_INFO, "PiSmmCommunicationPei LockState - %x\n", (UINTN)SmmAccess->LockState));
+  if (MmAccess->LockState) {
+    DEBUG ((EFI_D_INFO, "PiSmmCommunicationPei LockState - %x\n", (UINTN)MmAccess->LockState));
     return EFI_ACCESS_DENIED;
   }
 
@@ -414,7 +414,7 @@ PiSmmCommunicationPeiEntryPoint (
   // Open all SMRAM
   //
   for (Index = 0; !EFI_ERROR (Status); Index++) {
-    Status = SmmAccess->Open ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index);
+    Status = MmAccess->Open ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), MmAccess, Index);
   }
 
   InitCommunicationContext ();
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
index 2b395f38da64..5f747f04a34d 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/SmmMemLib.h>
 #include <Protocol/SmmSwDispatch2.h>
 #include <Protocol/SmmCommunication.h>
-#include <Ppi/SmmCommunication.h>
+#include <Ppi/MmCommunication.h>
 
 #include "PiSmmCommunicationPrivate.h"
 
@@ -43,7 +43,7 @@ SetCommunicationContext (
 
   Status = gSmst->SmmInstallConfigurationTable (
                     gSmst,
-                    &gEfiPeiSmmCommunicationPpiGuid,
+                    &gEfiPeiMmCommunicationPpiGuid,
                     &mSmmCommunicationContext,
                     sizeof(mSmmCommunicationContext)
                     );
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf
index 5cb596c5644d..aff80009fcb7 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf
@@ -54,16 +54,16 @@ [Guids]
 [Ppis]
   ## PRODUCES
   ## UNDEFINED # HOB # SMM Configuration Table
-  gEfiPeiSmmCommunicationPpiGuid
-  gPeiSmmAccessPpiGuid               ## CONSUMES
-  gPeiSmmControlPpiGuid              ## CONSUMES
+  gEfiPeiMmCommunicationPpiGuid
+  gEfiPeiMmAccessPpiGuid             ## CONSUMES
+  gEfiPeiMmControlPpiGuid            ## CONSUMES
 
 # [BootMode]
 #   S3_RESUME                        ## CONSUMES
 
 [Depex]
-  gPeiSmmAccessPpiGuid AND
-  gPeiSmmControlPpiGuid AND
+  gEfiPeiMmAccessPpiGuid AND
+  gEfiPeiMmControlPpiGuid AND
   gEfiPeiMasterBootModePpiGuid
 
 [UserExtensions.TianoCore."ExtraFiles"]
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
index 67799e9436cd..598cc878a7cb 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
@@ -49,7 +49,7 @@ [LibraryClasses]
   SmmMemLib
 
 [Ppis]
-  gEfiPeiSmmCommunicationPpiGuid     ## UNDEFINED # SMM Configuration Table
+  gEfiPeiMmCommunicationPpiGuid      ## UNDEFINED # SMM Configuration Table
 
 [Protocols]
   gEfiSmmSwDispatch2ProtocolGuid     ## CONSUMES
-- 
2.18.0.windows.1



  parent reply	other threads:[~2018-07-24  1:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d625966ce7c0ac98b65f1e946b2cf833f6801706.1532395896.git.Marvin.Haeuser@outlook.com>
2018-07-24  1:40 ` [PATCH 2/8] MdeModulePkg/SmmLockBoxPeiLib: Update MM PPI usages Marvin Häuser
2018-07-24  1:40 ` Marvin Häuser [this message]
2018-07-24  1:40 ` [PATCH 4/8] UefiCpuPkg/S3Resume2Pei: " Marvin Häuser
2018-07-24  1:40 ` [PATCH 5/8] QuarkSocPkg/SmmAccessPei: " Marvin Häuser
2018-07-24  1:40 ` [PATCH 6/8] QuarkSocPkg/SmmControlPei: " Marvin Häuser
2018-07-24  1:40 ` [PATCH 7/8] OvmfPkg/SmmAccessPei: " Marvin Häuser
2018-07-24  9:20   ` Laszlo Ersek
2018-07-24 12:16     ` Marvin Häuser
2018-07-24 12:39       ` Laszlo Ersek
2018-07-24  1:40 ` [PATCH 8/8] MdeModulePkg: Deprecate Smm* PPIs Marvin Häuser
2018-07-24  6:38   ` Gao, Liming
2018-07-24 10:04     ` Zeng, Star
2018-07-24 10:28     ` Laszlo Ersek

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=VI1PR0801MB1790A37F01CDECBF6B88530C80550@VI1PR0801MB1790.eurprd08.prod.outlook.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