public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, michael.d.kinney@intel.com,
	liming.gao@intel.com, achin.gupta@arm.com,
	supreeth.venkatesh@arm.com
Subject: [PATCH 2/2] MdePkg: Maintain backwards compatibility between MM/SMM.
Date: Mon, 12 Jun 2017 20:37:32 +0100	[thread overview]
Message-ID: <1497296252-46672-3-git-send-email-supreeth.venkatesh@arm.com> (raw)
In-Reply-To: <1497296252-46672-1-git-send-email-supreeth.venkatesh@arm.com>

PI v1.5 Volume 4 replaces EFI_SMM_COMMUNICATION_PROTOCOL with
EFI_MM_COMMUNICATION_PROTOCOL. Hence, modify the SMM Communication
protocol header file to include the EFI_MM_COMMUNICATION_PROTOCOL
header.
Also, PI v1.5 Volume 4 replaces the data structure
EFI_SMM_COMMUNICATE_HEADER with EFI_MM_COMMUNICATE_HEADER.
Hence, modify UefiAcpiDataTable header file
to maintain backwards compatibility.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
---
 MdePkg/Include/Protocol/SmmCommunication.h | 52 +++++++-----------------------
 MdePkg/Include/Uefi/UefiAcpiDataTable.h    |  4 ++-
 2 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/MdePkg/Include/Protocol/SmmCommunication.h b/MdePkg/Include/Protocol/SmmCommunication.h
index c284e55..8edebc2 100644
--- a/MdePkg/Include/Protocol/SmmCommunication.h
+++ b/MdePkg/Include/Protocol/SmmCommunication.h
@@ -5,10 +5,12 @@
   handlers inside of SMM.  
 
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
-  This program and the accompanying materials                          
-  are licensed and made available under the terms and conditions of the BSD License         
-  which accompanies this distribution.  The full text of the license may be found at        
-  http://opensource.org/licenses/bsd-license.php                                            
+  Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.<BR>
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  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 IMPLIED.             
@@ -19,45 +21,15 @@
 #define _SMM_COMMUNICATION_H_
 
 //
-// Need include this header file for EFI_SMM_COMMUNICATE_HEADER data structure.
+// Include the EFI_MM_COMMUNICATION_PROTOCOL header for actual definitions. This
+// header is used to maintain backwards compatibility.
 //
-#include <Uefi/UefiAcpiDataTable.h>
-
-#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID \
-  { \
-    0xc68ed8e2, 0x9dc6, 0x4cbd, { 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32 } \
-  }
-
-typedef struct _EFI_SMM_COMMUNICATION_PROTOCOL  EFI_SMM_COMMUNICATION_PROTOCOL;
+#include <Protocol/MmCommunication.h>
 
-/**
-  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_SMM_COMMUNICATION_PROTOCOL 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_SMM_COMMUNICATE2)(
-  IN CONST EFI_SMM_COMMUNICATION_PROTOCOL  *This,
-  IN OUT VOID                              *CommBuffer,
-  IN OUT UINTN                             *CommSize
-  );
+#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID EFI_MM_COMMUNICATION_PROTOCOL_GUID
 
-///
-/// EFI SMM Communication Protocol provides runtime services for communicating
-/// between DXE drivers and a registered SMI handler.
-///
-struct _EFI_SMM_COMMUNICATION_PROTOCOL {
-  EFI_SMM_COMMUNICATE2  Communicate;
-};
+typedef EFI_MM_COMMUNICATION_PROTOCOL       EFI_SMM_COMMUNICATION_PROTOCOL;
+typedef EFI_MM_COMMUNICATE                  EFI_SMM_COMMUNICATE2;
 
 extern EFI_GUID gEfiSmmCommunicationProtocolGuid;
 
diff --git a/MdePkg/Include/Uefi/UefiAcpiDataTable.h b/MdePkg/Include/Uefi/UefiAcpiDataTable.h
index 957721f..f0043a3 100644
--- a/MdePkg/Include/Uefi/UefiAcpiDataTable.h
+++ b/MdePkg/Include/Uefi/UefiAcpiDataTable.h
@@ -52,7 +52,9 @@ typedef struct {
   /// Designates an array of bytes that is MessageLength in size.
   ///
   UINT8     Data[1];
-} EFI_SMM_COMMUNICATE_HEADER;
+} EFI_MM_COMMUNICATE_HEADER;
+
+typedef EFI_MM_COMMUNICATE_HEADER EFI_SMM_COMMUNICATE_HEADER;
 
 #pragma pack()
 
-- 
2.7.4



      parent reply	other threads:[~2017-06-12 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 19:37 [PATCH 0/2] EFI_MM_COMMUNICATION_PROTOCOL as defined in PI v1.5 Vol 4 Supreeth Venkatesh
2017-06-12 19:37 ` [PATCH 1/2] MdePkg: Initial Version of MM Communication Protocol Supreeth Venkatesh
2017-06-12 19:37 ` Supreeth Venkatesh [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=1497296252-46672-3-git-send-email-supreeth.venkatesh@arm.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