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>
Subject: [PATCH v2 2/2] MdeModulePkg: Change SMM PPIs to shim MM PPIs.
Date: Tue, 24 Jul 2018 12:09:50 +0000	[thread overview]
Message-ID: <VI1PR0801MB1790937D22054BF7815580CE80550@VI1PR0801MB1790.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <cover.1532434029.git.Marvin.Haeuser@outlook.com>

The new PI MM PPIs deprecate MdeModulePkg's SMM PPIs entirely.
Shim the MM headers onto the previous SMM definitions.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 MdeModulePkg/Include/Ppi/SmmAccess.h        | 114 +-------------------
 MdeModulePkg/Include/Ppi/SmmCommunication.h |  36 +------
 MdeModulePkg/Include/Ppi/SmmControl.h       |  65 +----------
 3 files changed, 9 insertions(+), 206 deletions(-)

diff --git a/MdeModulePkg/Include/Ppi/SmmAccess.h b/MdeModulePkg/Include/Ppi/SmmAccess.h
index 795c8815a9c1..e1f144ee2293 100644
--- a/MdeModulePkg/Include/Ppi/SmmAccess.h
+++ b/MdeModulePkg/Include/Ppi/SmmAccess.h
@@ -27,119 +27,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _SMM_ACCESS_PPI_H_
 #define _SMM_ACCESS_PPI_H_
 
-#define PEI_SMM_ACCESS_PPI_GUID \
-  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 }}
+#include <Ppi/MmAccess.h>
 
-typedef struct _PEI_SMM_ACCESS_PPI  PEI_SMM_ACCESS_PPI;
+#define PEI_SMM_ACCESS_PPI_GUID  EFI_PEI_MM_ACCESS_PPI_GUID
 
-/**
-  Opens the SMRAM area to be accessible by a PEIM driver.
-
-  This function "opens" SMRAM so that it is visible while not inside of SMM. The function should
-  return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. The function
-  should return EFI_DEVICE_ERROR if the SMRAM configuration is locked.
-
-  @param  PeiServices            General purpose services available to every PEIM.
-  @param  This                   The pointer to the SMM Access Interface.
-  @param  DescriptorIndex        The region of SMRAM to Open.
-
-  @retval EFI_SUCCESS            The region was successfully opened.
-  @retval EFI_DEVICE_ERROR       The region could not be opened because locked by chipset.
-  @retval EFI_INVALID_PARAMETER  The descriptor index was out of bounds.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_OPEN)(
-  IN EFI_PEI_SERVICES                **PeiServices,
-  IN PEI_SMM_ACCESS_PPI              *This,
-  IN UINTN                           DescriptorIndex
-  );
-
-/**
-  Inhibits access to the SMRAM.
-
-  This function "closes" SMRAM so that it is not visible while outside of SMM. The function should
-  return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.
-
-  @param  PeiServices              General purpose services available to every PEIM.
-  @param  This                     The pointer to the SMM Access Interface.
-  @param  DescriptorIndex          The region of SMRAM to Close.
-
-  @retval EFI_SUCCESS              The region was successfully closed.
-  @retval EFI_DEVICE_ERROR         The region could not be closed because locked by chipset.
-  @retval EFI_INVALID_PARAMETER    The descriptor index was out of bounds.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_CLOSE)(
-  IN EFI_PEI_SERVICES                **PeiServices,
-  IN PEI_SMM_ACCESS_PPI              *This,
-  IN UINTN                           DescriptorIndex
-  );
-
-/**
-  Inhibits access to the SMRAM.
-
-  This function prohibits access to the SMRAM region.  This function is usually implemented such
-  that it is a write-once operation.
-
-  @param  PeiServices              General purpose services available to every PEIM.
-  @param  This                     The pointer to the SMM Access Interface.
-  @param  DescriptorIndex          The region of SMRAM to Close.
-
-  @retval EFI_SUCCESS            The region was successfully locked.
-  @retval EFI_DEVICE_ERROR       The region could not be locked because at least
-                                 one range is still open.
-  @retval EFI_INVALID_PARAMETER  The descriptor index was out of bounds.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_LOCK)(
-  IN EFI_PEI_SERVICES                **PeiServices,
-  IN PEI_SMM_ACCESS_PPI              *This,
-  IN UINTN                           DescriptorIndex
-  );
-
-/**
-  Queries the memory controller for the possible regions that will support SMRAM.
-
-  @param  PeiServices           General purpose services available to every PEIM.
-  @param This                   The pointer to the SmmAccessPpi Interface.
-  @param SmramMapSize           The pointer to the variable containing size of the
-                                buffer to contain the description information.
-  @param SmramMap               The buffer containing the data describing the Smram
-                                region descriptors.
-
-  @retval EFI_BUFFER_TOO_SMALL  The user did not provide a sufficient buffer.
-  @retval EFI_SUCCESS           The user provided a sufficiently-sized buffer.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_CAPABILITIES)(
-  IN EFI_PEI_SERVICES                **PeiServices,
-  IN PEI_SMM_ACCESS_PPI              *This,
-  IN OUT UINTN                       *SmramMapSize,
-  IN OUT EFI_SMRAM_DESCRIPTOR        *SmramMap
-  );
-
-///
-///  EFI SMM Access PPI is used to control the visibility of the SMRAM on the platform.
-///  It abstracts the location and characteristics of SMRAM. The platform should report
-///  all MMRAM via PEI_SMM_ACCESS_PPI. The expectation is that the north bridge or
-///  memory controller would publish this PPI.
-///
-struct _PEI_SMM_ACCESS_PPI {
-  PEI_SMM_OPEN          Open;
-  PEI_SMM_CLOSE         Close;
-  PEI_SMM_LOCK          Lock;
-  PEI_SMM_CAPABILITIES  GetCapabilities;
-  BOOLEAN               LockState;
-  BOOLEAN               OpenState;
-};
+typedef EFI_PEI_MM_ACCESS_PPI PEI_SMM_ACCESS_PPI;
 
 extern EFI_GUID gPeiSmmAccessPpiGuid;
 
diff --git a/MdeModulePkg/Include/Ppi/SmmCommunication.h b/MdeModulePkg/Include/Ppi/SmmCommunication.h
index 8ac86a443a15..e3ef045a18bb 100644
--- a/MdeModulePkg/Include/Ppi/SmmCommunication.h
+++ b/MdeModulePkg/Include/Ppi/SmmCommunication.h
@@ -23,41 +23,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _SMM_COMMUNICATION_PPI_H_
 #define _SMM_COMMUNICATION_PPI_H_
 
-#define EFI_PEI_SMM_COMMUNICATION_PPI_GUID \
-  { \
-    0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \
-  }
+#include <Ppi/MmCommunication.h>
 
-typedef struct _EFI_PEI_SMM_COMMUNICATION_PPI  EFI_PEI_SMM_COMMUNICATION_PPI;
+#define EFI_PEI_SMM_COMMUNICATION_PPI_GUID  EFI_PEI_MM_COMMUNICATION_PPI_GUID
 
-/**
-  Communicates with a registered handler.
-
-  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] CommBuffer          A pointer to the buffer to convey into SMRAM.
-  @param[in] 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.
-
-  @retval EFI_SUCCESS            The message was successfully posted.
-  @retval EFI_INVALID_PARAMETER  The CommBuffer was NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_PEI_SMM_COMMUNICATE)(
-  IN CONST EFI_PEI_SMM_COMMUNICATION_PPI   *This,
-  IN OUT VOID                              *CommBuffer,
-  IN OUT UINTN                             *CommSize
-  );
-
-///
-/// EFI SMM Communication Protocol provides runtime services for communicating
-/// between DXE drivers and a registered SMI handler.
-///
-struct _EFI_PEI_SMM_COMMUNICATION_PPI {
-  EFI_PEI_SMM_COMMUNICATE  Communicate;
-};
+typedef EFI_PEI_MM_COMMUNICATION_PPI EFI_PEI_SMM_COMMUNICATION_PPI;
 
 extern EFI_GUID gEfiPeiSmmCommunicationPpiGuid;
 
diff --git a/MdeModulePkg/Include/Ppi/SmmControl.h b/MdeModulePkg/Include/Ppi/SmmControl.h
index 0c62196fb44c..ff346e9b8af4 100644
--- a/MdeModulePkg/Include/Ppi/SmmControl.h
+++ b/MdeModulePkg/Include/Ppi/SmmControl.h
@@ -26,70 +26,11 @@
 #ifndef _SMM_CONTROL_PPI_H_
 #define _SMM_CONTROL_PPI_H_
 
-#define PEI_SMM_CONTROL_PPI_GUID \
-  { 0x61c68702, 0x4d7e, 0x4f43, 0x8d, 0xef, 0xa7, 0x43, 0x5, 0xce, 0x74, 0xc5 }
+#include <Ppi/MmControl.h>
 
-typedef struct _PEI_SMM_CONTROL_PPI  PEI_SMM_CONTROL_PPI;
+#define PEI_SMM_CONTROL_PPI_GUID  EFI_PEI_MM_CONTROL_PPI_GUID
 
-/**
-  Invokes SMI activation from either the preboot or runtime environment.
-
-  @param  PeiServices           General purpose services available to every PEIM.
-  @param  This                  The PEI_SMM_CONTROL_PPI instance.
-  @param  ArgumentBuffer        The optional sized data to pass into the protocol activation.
-  @param  ArgumentBufferSize    The optional size of the data.
-  @param  Periodic              An optional mechanism to periodically repeat activation.
-  @param  ActivationInterval    An optional parameter to repeat at this period one
-                                time or, if the Periodic Boolean is set, periodically.
-
-  @retval EFI_SUCCESS           The SMI/PMI has been engendered.
-  @retval EFI_DEVICE_ERROR      The timing is unsupported.
-  @retval EFI_INVALID_PARAMETER The activation period is unsupported.
-  @retval EFI_NOT_STARTED       The SMM base service has not been initialized.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_ACTIVATE) (
-  IN EFI_PEI_SERVICES                                **PeiServices,
-  IN PEI_SMM_CONTROL_PPI                             * This,
-  IN OUT INT8                                        *ArgumentBuffer OPTIONAL,
-  IN OUT UINTN                                       *ArgumentBufferSize OPTIONAL,
-  IN BOOLEAN                                         Periodic OPTIONAL,
-  IN UINTN                                           ActivationInterval OPTIONAL
-  );
-
-/**
-  Clears any system state that was created in response to the Active call.
-
-  @param  PeiServices           General purpose services available to every PEIM.
-  @param  This                  The PEI_SMM_CONTROL_PPI instance.
-  @param  Periodic              Optional parameter to repeat at this period one
-                                time or, if the Periodic Boolean is set, periodically.
-
-  @retval EFI_SUCCESS           The SMI/PMI has been engendered.
-  @retval EFI_DEVICE_ERROR      The source could not be cleared.
-  @retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEI_SMM_DEACTIVATE) (
-  IN EFI_PEI_SERVICES                      **PeiServices,
-  IN PEI_SMM_CONTROL_PPI                   * This,
-  IN BOOLEAN                               Periodic OPTIONAL
-  );
-
-///
-///  PEI SMM Control PPI is used to initiate SMI/PMI activations. This protocol could be published by either:
-///  - A processor driver to abstract the SMI/PMI IPI
-///  - The driver that abstracts the ASIC that is supporting the APM port, such as the ICH in an
-///  Intel chipset
-///
-struct _PEI_SMM_CONTROL_PPI {
-  PEI_SMM_ACTIVATE    Trigger;
-  PEI_SMM_DEACTIVATE  Clear;
-};
+typedef EFI_PEI_MM_CONTROL_PPI PEI_SMM_CONTROL_PPI;
 
 extern EFI_GUID gPeiSmmControlPpiGuid;
 
-- 
2.18.0.windows.1



      parent reply	other threads:[~2018-07-24 12:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1532434029.git.Marvin.Haeuser@outlook.com>
2018-07-24 12:09 ` [PATCH v2 1/2] MdePkg: Add PI 1.5 MM PPI declarations Marvin Häuser
2018-07-24 12:09 ` Marvin Häuser [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=VI1PR0801MB1790937D22054BF7815580CE80550@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