]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Change RegisterProtocolNotify for dependent protocols to [Depex] expression
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 21 Feb 2010 20:55:00 +0000 (20:55 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 21 Feb 2010 20:55:00 +0000 (20:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10036 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h [deleted file]
EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf

index 085ad0ca8ea7df3cc1fcff084fbf85aeb9bb6a70..942167067da17ba4b3c9a47a4367025d60a12f36 100644 (file)
 \r
 **/\r
 \r
-#include  "SmmBaseOnSmmBase2Thunk.h"\r
+#include <PiDxe.h>\r
+#include <FrameworkSmm.h>\r
 \r
-EFI_SMM_BASE_PROTOCOL gSmmBase = {\r
+#include <Protocol/SmmBase2.h>\r
+#include <Protocol/SmmCommunication.h>\r
+#include <Protocol/SmmBaseHelperReady.h>\r
+\r
+#include <Guid/SmmBaseThunkCommunication.h>\r
+#include <Guid/EventGroup.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/UefiRuntimeLib.h>\r
+\r
+//\r
+// SMM Base Protocol function ptoyotypes\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseRegister (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  IN      EFI_DEVICE_PATH_PROTOCOL  *FilePath,\r
+  IN      VOID                      *SourceBuffer,\r
+  IN      UINTN                     SourceSize,\r
+  OUT     EFI_HANDLE                *ImageHandle,\r
+  IN      BOOLEAN                   LegacyIA32Binary\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseUnregister (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  IN      EFI_HANDLE                ImageHandle\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseCommunicate (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  IN      EFI_HANDLE                ImageHandle,\r
+  IN OUT  VOID                      *CommunicationBuffer,\r
+  IN OUT  UINTN                     *BufferSize\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseRegisterCallback (\r
+  IN      EFI_SMM_BASE_PROTOCOL         *This,\r
+  IN      EFI_HANDLE                    SmmImageHandle,\r
+  IN      EFI_SMM_CALLBACK_ENTRY_POINT  CallbackAddress,\r
+  IN      BOOLEAN                       MakeLast,\r
+  IN      BOOLEAN                       FloatingPointSave\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseInSmm (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  OUT     BOOLEAN                   *InSmm\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseSmmAllocatePool (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  IN      EFI_MEMORY_TYPE           PoolType,\r
+  IN      UINTN                     Size,\r
+  OUT     VOID                      **Buffer\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseSmmFreePool (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  IN      VOID                      *Buffer\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+SmmBaseGetSmstLocation (\r
+  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
+  OUT     EFI_SMM_SYSTEM_TABLE      **Smst\r
+  );\r
+\r
+///\r
+/// SMM Base Protocol instance\r
+///\r
+EFI_SMM_BASE_PROTOCOL  mSmmBase = {\r
   SmmBaseRegister,\r
   SmmBaseUnregister,\r
   SmmBaseCommunicate,\r
@@ -32,12 +119,12 @@ EFI_SMM_BASE_PROTOCOL gSmmBase = {
   SmmBaseGetSmstLocation\r
 };\r
 \r
-SMMBASETHUNK_COMMUNICATION_DATA gCommunicationData = {\r
+SMMBASETHUNK_COMMUNICATION_DATA  mCommunicationData = {\r
   EFI_SMM_BASE_THUNK_COMMUNICATION_GUID,\r
   sizeof (SMMBASE_FUNCTION_DATA)\r
 };\r
 \r
-EFI_HANDLE                         mImageHandle;\r
+EFI_HANDLE                         mSmmBaseHandle = NULL;\r
 EFI_SMM_BASE2_PROTOCOL             *mSmmBase2 = NULL;\r
 EFI_SMM_COMMUNICATION_PROTOCOL     *mSmmCommunication = NULL;\r
 EFI_SMM_BASE_HELPER_READY_PROTOCOL *mSmmBaseHelperReady = NULL;\r
@@ -71,7 +158,7 @@ SmmBaseHelperService (
 {\r
   UINTN DataSize;\r
 \r
-  gCommunicationData.FunctionData.Status = EFI_UNSUPPORTED;\r
+  mCommunicationData.FunctionData.Status = EFI_UNSUPPORTED;\r
 \r
   if (IsInSmm()) {\r
     ///\r
@@ -86,7 +173,7 @@ SmmBaseHelperService (
     mSmmBaseHelperReady->ServiceEntry (\r
                            NULL,\r
                            NULL,\r
-                           &gCommunicationData.FunctionData,\r
+                           &mCommunicationData.FunctionData,\r
                            &DataSize\r
                            );\r
   } else {\r
@@ -98,10 +185,10 @@ SmmBaseHelperService (
       return;\r
     }\r
 \r
-    DataSize = (UINTN)(sizeof (gCommunicationData));\r
+    DataSize = (UINTN)(sizeof (mCommunicationData));\r
     mSmmCommunication->Communicate (\r
                          mSmmCommunication,\r
-                         &gCommunicationData,\r
+                         &mCommunicationData,\r
                          &DataSize\r
                          );\r
   }\r
@@ -143,15 +230,15 @@ SmmBaseRegister (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  gCommunicationData.FunctionData.Function = SMMBASE_REGISTER;\r
-  gCommunicationData.FunctionData.Args.Register.FilePath = FilePath;\r
-  gCommunicationData.FunctionData.Args.Register.SourceBuffer = SourceBuffer;\r
-  gCommunicationData.FunctionData.Args.Register.SourceSize = SourceSize;\r
-  gCommunicationData.FunctionData.Args.Register.ImageHandle = ImageHandle;\r
-  gCommunicationData.FunctionData.Args.Register.LegacyIA32Binary = LegacyIA32Binary;\r
+  mCommunicationData.FunctionData.Function = SMMBASE_REGISTER;\r
+  mCommunicationData.FunctionData.Args.Register.FilePath = FilePath;\r
+  mCommunicationData.FunctionData.Args.Register.SourceBuffer = SourceBuffer;\r
+  mCommunicationData.FunctionData.Args.Register.SourceSize = SourceSize;\r
+  mCommunicationData.FunctionData.Args.Register.ImageHandle = ImageHandle;\r
+  mCommunicationData.FunctionData.Args.Register.LegacyIA32Binary = LegacyIA32Binary;\r
 \r
   SmmBaseHelperService ();\r
-  return gCommunicationData.FunctionData.Status;\r
+  return mCommunicationData.FunctionData.Status;\r
 }\r
 \r
 /**\r
@@ -172,11 +259,11 @@ SmmBaseUnregister (
   IN      EFI_HANDLE                ImageHandle\r
   )\r
 {\r
-  gCommunicationData.FunctionData.Function = SMMBASE_UNREGISTER;\r
-  gCommunicationData.FunctionData.Args.UnRegister.ImageHandle = ImageHandle;\r
+  mCommunicationData.FunctionData.Function = SMMBASE_UNREGISTER;\r
+  mCommunicationData.FunctionData.Args.UnRegister.ImageHandle = ImageHandle;\r
 \r
   SmmBaseHelperService ();\r
-  return gCommunicationData.FunctionData.Status;\r
+  return mCommunicationData.FunctionData.Status;\r
 }\r
 \r
 /**\r
@@ -249,14 +336,14 @@ SmmBaseRegisterCallback (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  gCommunicationData.FunctionData.Function = SMMBASE_REGISTER_CALLBACK;\r
-  gCommunicationData.FunctionData.Args.RegisterCallback.SmmImageHandle = SmmImageHandle;\r
-  gCommunicationData.FunctionData.Args.RegisterCallback.CallbackAddress = CallbackAddress;\r
-  gCommunicationData.FunctionData.Args.RegisterCallback.MakeLast = MakeLast;\r
-  gCommunicationData.FunctionData.Args.RegisterCallback.FloatingPointSave = FloatingPointSave;\r
+  mCommunicationData.FunctionData.Function = SMMBASE_REGISTER_CALLBACK;\r
+  mCommunicationData.FunctionData.Args.RegisterCallback.SmmImageHandle = SmmImageHandle;\r
+  mCommunicationData.FunctionData.Args.RegisterCallback.CallbackAddress = CallbackAddress;\r
+  mCommunicationData.FunctionData.Args.RegisterCallback.MakeLast = MakeLast;\r
+  mCommunicationData.FunctionData.Args.RegisterCallback.FloatingPointSave = FloatingPointSave;\r
 \r
   SmmBaseHelperService();\r
-  return gCommunicationData.FunctionData.Status;\r
+  return mCommunicationData.FunctionData.Status;\r
 }\r
 \r
 /**\r
@@ -309,13 +396,13 @@ SmmBaseSmmAllocatePool (
   OUT     VOID                      **Buffer\r
   )\r
 {\r
-  gCommunicationData.FunctionData.Function = SMMBASE_ALLOCATE_POOL;\r
-  gCommunicationData.FunctionData.Args.AllocatePool.PoolType = PoolType;\r
-  gCommunicationData.FunctionData.Args.AllocatePool.Size = Size;\r
-  gCommunicationData.FunctionData.Args.AllocatePool.Buffer = Buffer;\r
+  mCommunicationData.FunctionData.Function = SMMBASE_ALLOCATE_POOL;\r
+  mCommunicationData.FunctionData.Args.AllocatePool.PoolType = PoolType;\r
+  mCommunicationData.FunctionData.Args.AllocatePool.Size = Size;\r
+  mCommunicationData.FunctionData.Args.AllocatePool.Buffer = Buffer;\r
 \r
   SmmBaseHelperService ();\r
-  return gCommunicationData.FunctionData.Status;\r
+  return mCommunicationData.FunctionData.Status;\r
 }\r
 \r
 /**\r
@@ -337,11 +424,11 @@ SmmBaseSmmFreePool (
   IN      VOID                      *Buffer\r
   )\r
 {\r
-  gCommunicationData.FunctionData.Function = SMMBASE_FREE_POOL;\r
-  gCommunicationData.FunctionData.Args.FreePool.Buffer = Buffer;\r
+  mCommunicationData.FunctionData.Function = SMMBASE_FREE_POOL;\r
+  mCommunicationData.FunctionData.Args.FreePool.Buffer = Buffer;\r
 \r
   SmmBaseHelperService ();\r
-  return gCommunicationData.FunctionData.Status;\r
+  return mCommunicationData.FunctionData.Status;\r
 }\r
 \r
 /**\r
@@ -381,81 +468,6 @@ SmmBaseGetSmstLocation (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  SMM Base Protocol notification event handler.\r
-\r
-  @param[in] Event    Event whose notification function is being invoked.\r
-  @param[in] Context  Pointer to the notification function's context.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmmBaseProtocolNotification (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  EFI_STATUS Status;\r
-\r
-  ///\r
-  /// Assume only one instance of SMM Base2 Protocol in the system\r
-  /// Locate SMM Base2 Protocol\r
-  ///\r
-  Status = gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID **) &mSmmBase2);\r
-  if (!EFI_ERROR (Status)) {\r
-    ///\r
-    /// Publish Framework SMM BASE Protocol immediately after SMM Base2 Protocol is installed to\r
-    /// make SMM Base Protocol.InSmm() available as early as possible.\r
-    ///\r
-    Status = gBS->InstallProtocolInterface (\r
-                    &mImageHandle,\r
-                    &gEfiSmmBaseProtocolGuid,\r
-                    EFI_NATIVE_INTERFACE,\r
-                    &gSmmBase\r
-                    );\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-}\r
-\r
-/**\r
-  SMM Communication Protocol notification event handler.\r
-\r
-  @param[in] Event    Event whose notification function is being invoked.\r
-  @param[in] Context  Pointer to the notification function's context.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmmCommunicationProtocolNotification (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  ///\r
-  /// Assume only one instance of SMM Communication Protocol in the system\r
-  /// Locate SMM Communication Protocol\r
-  ///\r
-  gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);\r
-}\r
-\r
-/**\r
-  SMM Base Helper Ready Protocol notification event handler.\r
-\r
-  @param[in] Event    Event whose notification function is being invoked.\r
-  @param[in] Context  Pointer to the notification function's context.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmmBaseHelperReadyProtocolNotification (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  ///\r
-  /// Assume only one instance of SMM Base Helper Ready Protocol in the system\r
-  /// Locate SMM Base Helper Ready Protocol\r
-  ///\r
-  gBS->LocateProtocol (&gEfiSmmBaseHelperReadyProtocolGuid, NULL, (VOID **) &mSmmBaseHelperReady);\r
-}\r
-\r
 /**\r
   Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE\r
 \r
@@ -492,60 +504,53 @@ SmmBaseThunkMain (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
-  VOID       *Registration;\r
-  EFI_EVENT  VirtualAddressChangeEvent;\r
-  EFI_STATUS Status;\r
+  EFI_STATUS  Status;\r
+  EFI_EVENT   Event;\r
 \r
-  mImageHandle = ImageHandle;\r
-\r
-  ///\r
-  /// Install notifications for required protocols\r
-  ///\r
-  /// Note we use protocol notifications here so as that this thunk driver can be\r
-  /// loaded before PI SMM IPL driver. Framework SMM BASE Protocol will be published \r
-  /// immediately after SMM Base2 Protocol is installed to make SMM Base Protocol.InSmm()\r
-  /// available as early as possible because some Framework code's behavior depends on\r
-  /// correct detection of SMM mode via SMM Base Protocol.InSmm().\r
-  ///\r
-  /// Also SMM Base Helper driver is expected to be dispatched\r
-  /// in the earliest round of SMM driver dispatch just after SMM IPL driver loads SMM Foundation.\r
-  /// So the full functionality of SMM Base Protocol is ready immediately after SMM IPL driver is\r
-  /// loaded. Since that point Framework SMM driver can be succesufully supported.\r
-  ///\r
-  EfiCreateProtocolNotifyEvent (\r
-    &gEfiSmmBase2ProtocolGuid,\r
-    TPL_CALLBACK,\r
-    SmmBaseProtocolNotification,\r
-    NULL,\r
-    &Registration\r
-    );\r
-\r
-  EfiCreateProtocolNotifyEvent (\r
-    &gEfiSmmCommunicationProtocolGuid,\r
-    TPL_CALLBACK,\r
-    SmmCommunicationProtocolNotification,\r
-    NULL,\r
-    &Registration\r
-    );\r
-\r
-  EfiCreateProtocolNotifyEvent (\r
-    &gEfiSmmBaseHelperReadyProtocolGuid,\r
-    TPL_CALLBACK,\r
-    SmmBaseHelperReadyProtocolNotification,\r
-    NULL,\r
-    &Registration\r
-    );\r
+  //\r
+  // Assume only one instance of SMM Base2 Protocol in the system\r
+  // Locate SMM Base2 Protocol\r
+  //\r
+  Status = gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID **) &mSmmBase2);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Assume only one instance of SMM Communication Protocol in the system\r
+  // Locate SMM Communication Protocol\r
+  //\r
+  gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Assume only one instance of SMM Base Helper Ready Protocol in the system\r
+  // Locate SMM Base Helper Ready Protocol\r
+  //\r
+  Status = gBS->LocateProtocol (&gEfiSmmBaseHelperReadyProtocolGuid, NULL, (VOID **) &mSmmBaseHelperReady);\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Create event on SetVirtualAddressMap() to convert mSmmCommunication from a physical address to a virtual address\r
+  //\r
   Status = gBS->CreateEventEx (\r
                   EVT_NOTIFY_SIGNAL,\r
                   TPL_NOTIFY,\r
                   SmmBaseAddressChangeEvent,\r
                   NULL,\r
                   &gEfiEventVirtualAddressChangeGuid,\r
-                  &VirtualAddressChangeEvent\r
+                  &Event\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
-\r
+  \r
+  //\r
+  // Publish Framework SMM BASE Protocol immediately after SMM Base2 Protocol is installed to\r
+  // make SMM Base Protocol.InSmm() available as early as possible.\r
+  //\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &mSmmBaseHandle,\r
+                  &gEfiSmmBaseProtocolGuid, &mSmmBase,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+  \r
   return EFI_SUCCESS;\r
 }\r
-\r
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h
deleted file mode 100644 (file)
index ffe6508..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/** @file\r
-  Include file for SMM Base Protocol on SMM Base2 Protocol Thunk driver.\r
-  \r
-  Copyright (c) 2009 - 2010, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef  _SMM_BASE_ON_SMM_BASE2_THUNK_H_\r
-#define  _SMM_BASE_ON_SMM_BASE2_THUNK_H_\r
-\r
-#include <PiDxe.h>\r
-#include <FrameworkSmm.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Guid/SmmBaseThunkCommunication.h>\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/SmmBase2.h>\r
-#include <Protocol/SmmCommunication.h>\r
-#include <Protocol/SmmBaseHelperReady.h>\r
-\r
-/**\r
-  Register a given driver into SMRAM. This is the equivalent of performing\r
-  the LoadImage/StartImage into System Management Mode.\r
-\r
-  @param[in]   This                  Protocol instance pointer.\r
-  @param[in]   FilePath              Location of the image to be installed as the handler.\r
-  @param[in]   SourceBuffer          Optional source buffer in case the image file\r
-                                     is in memory.\r
-  @param[in]   SourceSize            Size of the source image file, if in memory.\r
-  @param[out]  ImageHandle           The handle that the base driver uses to decode \r
-                                     the handler. Unique among SMM handlers only, \r
-                                     not unique across DXE/EFI.\r
-  @param[in]   LegacyIA32Binary      An optional parameter specifying that the associated \r
-                                     file is a real-mode IA-32 binary.\r
-\r
-  @retval      EFI_SUCCESS           The operation was successful.\r
-  @retval      EFI_OUT_OF_RESOURCES  There were no additional SMRAM resources to load the handler\r
-  @retval      EFI_UNSUPPORTED       This platform does not support 16-bit handlers.\r
-  @retval      EFI_UNSUPPORTED       Platform is in runtime.\r
-  @retval      EFI_INVALID_PARAMETER The handlers was not the correct image type\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseRegister (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  IN      EFI_DEVICE_PATH_PROTOCOL  *FilePath,\r
-  IN      VOID                      *SourceBuffer,\r
-  IN      UINTN                     SourceSize,\r
-  OUT     EFI_HANDLE                *ImageHandle,\r
-  IN      BOOLEAN                   LegacyIA32Binary\r
-  );\r
-\r
-/**\r
-  Removes a handler from execution within SMRAM.  This is the equivalent of performing\r
-  the UnloadImage in System Management Mode.\r
-\r
-  @param[in]  This                  Protocol instance pointer.\r
-  @param[in]  ImageHandle           The handler to be removed.\r
-\r
-  @retval     EFI_SUCCESS           The operation was successful\r
-  @retval     EFI_INVALID_PARAMETER The handler did not exist\r
-  @retval     EFI_UNSUPPORTED       Platform is in runtime.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseUnregister (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  IN      EFI_HANDLE                ImageHandle\r
-  );\r
-\r
-/**\r
-  The SMM Inter-module Communicate Service Communicate() function\r
-  provides a service to send/receive messages from a registered\r
-  EFI service.  The BASE protocol driver is responsible for doing\r
-  any of the copies such that the data lives in boot-service-accessible RAM.\r
-\r
-  @param[in]      This                  Protocol instance pointer.\r
-  @param[in]      ImageHandle           The handle of the registered driver.\r
-  @param[in,out]  CommunicationBuffer   Pointer to the buffer to convey into SMRAM.\r
-  @param[in,out]  BufferSize            The size of the data buffer being passed in.\r
-                                        On exit, the size of data being returned.\r
-                                        Zero if the handler does not wish to reply with any data.\r
-\r
-  @retval         EFI_SUCCESS           The message was successfully posted\r
-  @retval         EFI_INVALID_PARAMETER The buffer was NULL\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseCommunicate (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  IN      EFI_HANDLE                ImageHandle,\r
-  IN OUT  VOID                      *CommunicationBuffer,\r
-  IN OUT  UINTN                     *BufferSize\r
-  );\r
-\r
-/**\r
-  Register a callback to execute within SMM.\r
-  This allows receipt of messages created with EFI_SMM_BASE_PROTOCOL.Communicate().\r
-\r
-  @param[in]  This                  Protocol instance pointer.\r
-  @param[in]  SmmImageHandle        Handle of the callback service.\r
-  @param[in]  CallbackAddress       Address of the callback service.\r
-  @param[in]  MakeLast              If present, will stipulate that the handler is posted to \r
-                                    be executed last in the dispatch table.\r
-  @param[in]  FloatingPointSave     An optional parameter that informs the\r
-                                    EFI_SMM_ACCESS_PROTOCOL Driver core if it needs to save\r
-                                    the floating point register state. If any handler\r
-                                    require this, the state will be saved for all handlers.\r
-\r
-  @retval     EFI_SUCCESS           The operation was successful\r
-  @retval     EFI_OUT_OF_RESOURCES  Not enough space in the dispatch queue\r
-  @retval     EFI_UNSUPPORTED       Platform is in runtime.\r
-  @retval     EFI_UNSUPPORTED       The caller is not in SMM.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseRegisterCallback (\r
-  IN      EFI_SMM_BASE_PROTOCOL         *This,\r
-  IN      EFI_HANDLE                    SmmImageHandle,\r
-  IN      EFI_SMM_CALLBACK_ENTRY_POINT  CallbackAddress,\r
-  IN      BOOLEAN                       MakeLast,\r
-  IN      BOOLEAN                       FloatingPointSave\r
-  );\r
-\r
-/**\r
-  This routine tells caller if execution context is SMM or not.\r
-\r
-  @param[in]   This                   Protocol instance pointer.\r
-  @param[out]  InSmm                  Whether the caller is inside SMM for IA-32\r
-                                      or servicing a PMI for the Itanium processor\r
-                                      family.\r
-\r
-  @retval      EFI_SUCCESS            The operation was successful\r
-  @retval      EFI_INVALID_PARAMETER  InSmm was NULL.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseInSmm (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  OUT     BOOLEAN                   *InSmm\r
-  );\r
-\r
-/**\r
-  The SmmAllocatePool() function allocates a memory region of Size bytes from memory of\r
-  type PoolType and returns the address of the allocated memory in the location referenced\r
-  by Buffer.  This function allocates pages from EFI SMRAM Memory as needed to grow the\r
-  requested pool type.  All allocations are eight-byte aligned.\r
-\r
-  @param[in]   This                  Protocol instance pointer.\r
-  @param[in]   PoolType              The type of pool to allocate.\r
-                                     The only supported type is EfiRuntimeServicesData;\r
-                                     the interface will internally map this runtime request to \r
-                                     SMRAM for IA-32 and leave as this type for the Itanium \r
-                                     processor family. Other types can be ignored.\r
-  @param[in]   Size                  The number of bytes to allocate from the pool.\r
-  @param[out]  Buffer                A pointer to a pointer to the allocated buffer if the call\r
-                                     succeeds; undefined otherwise.\r
-\r
-  @retval      EFI_SUCCESS           The requested number of bytes was allocated.\r
-  @retval      EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.\r
-  @retval      EFI_UNSUPPORTED       Platform is in runtime.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseSmmAllocatePool (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  IN      EFI_MEMORY_TYPE           PoolType,\r
-  IN      UINTN                     Size,\r
-  OUT     VOID                      **Buffer\r
-  );\r
-\r
-/**\r
-  The SmmFreePool() function returns the memory specified by Buffer to the system.\r
-  On return, the memory's type is EFI SMRAM Memory.  The Buffer that is freed must\r
-  have been allocated by SmmAllocatePool().\r
-\r
-  @param[in]  This                  Protocol instance pointer.\r
-  @param[in]  Buffer                Pointer to the buffer allocation.\r
-\r
-  @retval     EFI_SUCCESS           The memory was returned to the system.\r
-  @retval     EFI_INVALID_PARAMETER Buffer was invalid.\r
-  @retval     EFI_UNSUPPORTED       Platform is in runtime.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseSmmFreePool (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  IN      VOID                      *Buffer\r
-  );\r
-\r
-/**\r
-  The GetSmstLocation() function returns the location of the System Management\r
-  Service Table.  The use of the API is such that a driver can discover the\r
-  location of the SMST in its entry point and then cache it in some driver\r
-  global variable so that the SMST can be invoked in subsequent callbacks.\r
-\r
-  @param[in]  This                  Protocol instance pointer.\r
-  @param[in]  Smst                  Pointer to the SMST.\r
-\r
-  @retval     EFI_SUCCESS           The operation was successful\r
-  @retval     EFI_INVALID_PARAMETER Smst was invalid.\r
-  @retval     EFI_UNSUPPORTED       Not in SMM.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmmBaseGetSmstLocation (\r
-  IN      EFI_SMM_BASE_PROTOCOL     *This,\r
-  OUT     EFI_SMM_SYSTEM_TABLE      **Smst\r
-  );\r
-\r
-#endif  \r
index 87bf34409340de796b47ee15c411bbed9ed319d6..67dcfa4f70fb39b849d3b64fc942b085f913d079 100644 (file)
@@ -29,7 +29,6 @@
 \r
 [Sources]\r
   SmmBaseOnSmmBase2Thunk.c\r
-  SmmBaseOnSmmBase2Thunk.h\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   gEfiEventVirtualAddressChangeGuid   # GUID ALWAYS_CONSUMED\r
 \r
 [Protocols]\r
-  gEfiSmmBase2ProtocolGuid            # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiSmmCommunicationProtocolGuid    # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiSmmBaseHelperReadyProtocolGuid  # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiSmmBaseProtocolGuid             # PROTOCOL SOMETIMES_PRODUCED\r
+  gEfiSmmBase2ProtocolGuid            # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiSmmCommunicationProtocolGuid    # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiSmmBaseHelperReadyProtocolGuid  # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiSmmBaseProtocolGuid             # PROTOCOL ALWAYS_PRODUCED\r
 \r
 [Depex]\r
-  TRUE\r
-\r
+  gEfiSmmBase2ProtocolGuid AND gEfiSmmCommunicationProtocolGuid AND gEfiSmmBaseHelperReadyProtocolGuid\r