]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add PI1.2.1 EndOfDxe support.
authorjyao1 <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Dec 2012 05:07:35 +0000 (05:07 +0000)
committerjyao1 <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Dec 2012 05:07:35 +0000 (05:07 +0000)
Signed-off-by: jiewen.yao@intel.com
Reviewed-by: michael.d.kinney@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14009 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
MdePkg/Include/Guid/EventGroup.h
MdePkg/Include/Protocol/SmmEndOfDxe.h [new file with mode: 0644]
MdePkg/MdePkg.dec

index c1b3563d013d277be9e7dd36446171ef7947818b..a7220e4235ab87847f8533d3791c2651239ca15f 100644 (file)
@@ -78,6 +78,7 @@ SMM_CORE_SMI_HANDLERS  mSmmCoreSmiHandlers[] = {
   { SmmDriverDispatchHandler, &gEfiEventDxeDispatchGuid,          NULL, TRUE  },\r
   { SmmReadyToLockHandler,    &gEfiDxeSmmReadyToLockProtocolGuid, NULL, TRUE }, \r
   { SmmLegacyBootHandler,     &gEfiEventLegacyBootGuid,           NULL, FALSE },\r
+  { SmmEndOfDxeHandler,       &gEfiEndOfDxeEventGroupGuid,        NULL, FALSE },\r
   { NULL,                     NULL,                               NULL, FALSE }\r
 };\r
 \r
@@ -228,6 +229,46 @@ SmmReadyToLockHandler (
   return Status;\r
 }\r
 \r
+/**\r
+  Software SMI handler that is called when the EndOfDxe event is signalled.\r
+  This function installs the SMM EndOfDxe Protocol so SMM Drivers are informed that\r
+  platform code will invoke 3rd part code.\r
+\r
+  @param  DispatchHandle  The unique handle assigned to this handler by SmiHandlerRegister().\r
+  @param  Context         Points to an optional handler context which was specified when the handler was registered.\r
+  @param  CommBuffer      A pointer to a collection of data in memory that will\r
+                          be conveyed from a non-SMM environment into an SMM environment.\r
+  @param  CommBufferSize  The size of the CommBuffer.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmEndOfDxeHandler (\r
+  IN     EFI_HANDLE  DispatchHandle,\r
+  IN     CONST VOID  *Context,        OPTIONAL\r
+  IN OUT VOID        *CommBuffer,     OPTIONAL\r
+  IN OUT UINTN       *CommBufferSize  OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  SmmHandle;\r
+\r
+  DEBUG ((EFI_D_INFO, "SmmEndOfDxeHandler\n"));\r
+  //\r
+  // Install SMM EndOfDxe protocol\r
+  //\r
+  SmmHandle = NULL;\r
+  Status = SmmInstallProtocolInterface (\r
+             &SmmHandle,\r
+             &gEfiSmmEndOfDxeProtocolGuid,\r
+             EFI_NATIVE_INTERFACE,\r
+             NULL\r
+             );\r
+  return EFI_SUCCESS;\r
+}\r
+\r
 /**\r
   The main entry point to SMM Foundation.\r
 \r
index 055363e1ad538bc5bfb9bed2289b4e7eeabd4e07..5392fb231519960e4ebf16dd85991bbfa203d07f 100644 (file)
@@ -20,6 +20,7 @@
 \r
 #include <Protocol/DxeSmmReadyToLock.h>\r
 #include <Protocol/SmmReadyToLock.h>\r
+#include <Protocol/SmmEndOfDxe.h>\r
 #include <Protocol/CpuIo2.h>\r
 #include <Protocol/SmmCommunication.h>\r
 #include <Protocol/SmmAccess2.h>\r
@@ -586,6 +587,28 @@ SmmReadyToLockHandler (
   IN OUT UINTN                    *CommBufferSize  OPTIONAL\r
   );\r
 \r
+/**\r
+  This function is the main entry point for an SMM handler dispatch\r
+  or communicate-based callback.\r
+\r
+  @param  DispatchHandle  The unique handle assigned to this handler by SmiHandlerRegister().\r
+  @param  Context         Points to an optional handler context which was specified when the handler was registered.\r
+  @param  CommBuffer      A pointer to a collection of data in memory that will\r
+                          be conveyed from a non-SMM environment into an SMM environment.\r
+  @param  CommBufferSize  The size of the CommBuffer.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmEndOfDxeHandler (\r
+  IN     EFI_HANDLE               DispatchHandle,\r
+  IN     CONST VOID               *Context,        OPTIONAL\r
+  IN OUT VOID                     *CommBuffer,     OPTIONAL\r
+  IN OUT UINTN                    *CommBufferSize  OPTIONAL\r
+  );\r
+\r
 /**\r
   Place holder function until all the SMM System Table Service are available.\r
 \r
index 1c15c7ec0d9f26c73c97381b23d6299ede8af0ad..e2ef13e3c1513a7da62b9f169730f9c625498c19 100644 (file)
@@ -63,6 +63,7 @@
   gEfiSmmReadyToLockProtocolGuid                # PROTOCOL ALWAYS_PRODUCED\r
   gEfiSmmCpuIo2ProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED\r
   gEfiFirmwareVolume2ProtocolGuid               # PROTOCOL ALWAYS_CONSUMED\r
+  gEfiSmmEndOfDxeProtocolGuid                   # PROTOCOL ALWAYS_PRODUCED\r
   gEfiSecurityArchProtocolGuid                  # PROTOCOL SOMETIMES_CONSUMED\r
   gEfiSecurity2ArchProtocolGuid                 # PROTOCOL SOMETIMES_CONSUMED\r
   gEfiLoadedImageProtocolGuid                   # PROTOCOL SOMETIMES_PRODUCED\r
@@ -76,3 +77,4 @@
   gAprioriGuid                                  # ALWAYS_CONSUMED\r
   gEfiEventDxeDispatchGuid                      # ALWAYS_CONSUMED\r
   gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED\r
+  gEfiEndOfDxeEventGroupGuid                    # ALWAYS_CONSUMED\r
index bda9996dc82da0b1c0d5377409b55fe0403a7d68..4686470423cfd9053c9aece3ff701c912623a531 100644 (file)
@@ -263,6 +263,12 @@ SMM_IPL_EVENT_NOTIFICATION  mSmmIplEvents[] = {
   //\r
   { TRUE,  TRUE,  &gEfiDxeSmmReadyToLockProtocolGuid, SmmIplReadyToLockEventNotify,      &gEfiDxeSmmReadyToLockProtocolGuid, TPL_CALLBACK, NULL },\r
   //\r
+  // Declare event notification on EndOfDxe event.  When this notification is etablished, \r
+  // the associated event is immediately signalled, so the notification function will be executed and the \r
+  // SMM End Of Dxe Protocol will be found if it is already in the handle database.\r
+  //\r
+  { FALSE, TRUE,  &gEfiEndOfDxeEventGroupGuid,        SmmIplGuidedEventNotify,           &gEfiEndOfDxeEventGroupGuid,        TPL_CALLBACK, NULL },\r
+  //\r
   // Declare event notification on the DXE Dispatch Event Group.  This event is signaled by the DXE Core\r
   // each time the DXE Core dispatcher has completed its work.  When this event is signalled, the SMM Core\r
   // if notified, so the SMM Core can dispatch SMM drivers.\r
index 125a02114859158eb6b072107b8798c111176e8a..6af4f65b460de7771990658bcca05ec868df2e4e 100644 (file)
@@ -64,6 +64,7 @@
   gEfiEventReadyToBootGuid                      # ALWAYS_CONSUMED\r
   gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED\r
   gEfiEventVirtualAddressChangeGuid             # ALWAYS_CONSUMED\r
+  gEfiEndOfDxeEventGroupGuid                    # ALWAYS_CONSUMED\r
   gLoadFixedAddressConfigurationTableGuid       # SIMETIMES_CONSUMED\r
 \r
 [Pcd]\r
index dba9fc27e405f6d32146dfb7513bf2fbd81eb68b..831465d0aae243c07210301fd1a55a3143d7920f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  GUIDs for gBS->CreateEventEx Event Groups. Defined in UEFI spec 2.0 and PI 1.2.\r
+  GUIDs for gBS->CreateEventEx Event Groups. Defined in UEFI spec 2.0 and PI 1.2.1.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -44,4 +44,9 @@ extern EFI_GUID gEfiEventReadyToBootGuid;
 \r
 extern EFI_GUID gEfiEventDxeDispatchGuid;\r
 \r
+#define EFI_END_OF_DXE_EVENT_GROUP_GUID \\r
+  { 0x2ce967a, 0xdd7e, 0x4ffc, { 0x9e, 0xe7, 0x81, 0xc, 0xf0, 0x47, 0x8, 0x80 } }\r
+\r
+extern EFI_GUID gEfiEndOfDxeEventGroupGuid;\r
+\r
 #endif\r
diff --git a/MdePkg/Include/Protocol/SmmEndOfDxe.h b/MdePkg/Include/Protocol/SmmEndOfDxe.h
new file mode 100644 (file)
index 0000000..702d742
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  SMM End Of Dxe protocol as defined in the PI 1.2.1 specification.\r
+\r
+  This protocol is a mandatory protocol published by the PI platform code prior to invoking any\r
+  3rd party content, including options ROM's and UEFI executables that are not from the platform manufacturer.\r
+\r
+  Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+  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_END_OF_DXE_H_\r
+#define _SMM_END_OF_DXE_H_\r
+\r
+#define EFI_SMM_END_OF_DXE_PROTOCOL_GUID \\r
+  { \\r
+    0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 0xa, 0xd3, 0xaa, 0x32, 0xe9, 0x3d } \\r
+  }\r
+\r
+extern EFI_GUID gEfiSmmEndOfDxeProtocolGuid;\r
+\r
+#endif\r
index aefba3ffb18dfa1525630cae50c3e0bef7737d6c..3de6ff5aea799e3d74b60d4b7def92de69b5f68a 100644 (file)
   ## Include/Guid/FirmwareFileSystem3.h\r
   gEfiFirmwareFileSystem3Guid      = { 0x5473c07a, 0x3dcb, 0x4dca, { 0xbd, 0x6f, 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a }}\r
 \r
+  #\r
+  # GUID defined in PI1.2.1\r
+  #\r
+  ## Include/Guid/EventGroup.h\r
+  gEfiEndOfDxeEventGroupGuid        = { 0x2ce967a, 0xdd7e, 0x4ffc, { 0x9e, 0xe7, 0x81, 0xc, 0xf0, 0x47, 0x8, 0x80 }}\r
+\r
 [Guids.IA32, Guids.X64]\r
   ## Include/Guid/Cper.h\r
   gEfiIa32X64ErrorTypeCacheCheckGuid = { 0xA55701F5, 0xE3EF, 0x43de, { 0xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }}\r
   ## Include/Protocol/Security2.h\r
   gEfiSecurity2ArchProtocolGuid   = { 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68 } }\r
 \r
+  #\r
+  # Protocols defined in PI 1.2.1\r
+  #\r
+\r
+  ## Include/Protocol/SmmEndOfDxe.h\r
+  gEfiSmmEndOfDxeProtocolGuid = { 0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 0xa, 0xd3, 0xaa, 0x32, 0xe9, 0x3d }}\r
+\r
   #\r
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1\r
   #\r