Revision: 14009
          http://edk2.svn.sourceforge.net/edk2/?rev=14009&view=rev
Author:   jyao1
Date:     2012-12-18 05:07:35 +0000 (Tue, 18 Dec 2012)
Log Message:
-----------
Add PI1.2.1 EndOfDxe support.

Signed-off-by: [email protected]
Reviewed-by: [email protected]

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
    trunk/edk2/MdePkg/Include/Guid/EventGroup.h
    trunk/edk2/MdePkg/MdePkg.dec

Added Paths:
-----------
    trunk/edk2/MdePkg/Include/Protocol/SmmEndOfDxe.h

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c  2012-12-17 11:16:16 UTC 
(rev 14008)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c  2012-12-18 05:07:35 UTC 
(rev 14009)
@@ -78,6 +78,7 @@
   { SmmDriverDispatchHandler, &gEfiEventDxeDispatchGuid,          NULL, TRUE  
},
   { SmmReadyToLockHandler,    &gEfiDxeSmmReadyToLockProtocolGuid, NULL, TRUE 
}, 
   { SmmLegacyBootHandler,     &gEfiEventLegacyBootGuid,           NULL, FALSE 
},
+  { SmmEndOfDxeHandler,       &gEfiEndOfDxeEventGroupGuid,        NULL, FALSE 
},
   { NULL,                     NULL,                               NULL, FALSE }
 };
 
@@ -229,6 +230,46 @@
 }
 
 /**
+  Software SMI handler that is called when the EndOfDxe event is signalled.
+  This function installs the SMM EndOfDxe Protocol so SMM Drivers are informed 
that
+  platform code will invoke 3rd part code.
+
+  @param  DispatchHandle  The unique handle assigned to this handler by 
SmiHandlerRegister().
+  @param  Context         Points to an optional handler context which was 
specified when the handler was registered.
+  @param  CommBuffer      A pointer to a collection of data in memory that will
+                          be conveyed from a non-SMM environment into an SMM 
environment.
+  @param  CommBufferSize  The size of the CommBuffer.
+
+  @return Status Code
+
+**/
+EFI_STATUS
+EFIAPI
+SmmEndOfDxeHandler (
+  IN     EFI_HANDLE  DispatchHandle,
+  IN     CONST VOID  *Context,        OPTIONAL
+  IN OUT VOID        *CommBuffer,     OPTIONAL
+  IN OUT UINTN       *CommBufferSize  OPTIONAL
+  )
+{
+  EFI_STATUS  Status;
+  EFI_HANDLE  SmmHandle;
+
+  DEBUG ((EFI_D_INFO, "SmmEndOfDxeHandler\n"));
+  //
+  // Install SMM EndOfDxe protocol
+  //
+  SmmHandle = NULL;
+  Status = SmmInstallProtocolInterface (
+             &SmmHandle,
+             &gEfiSmmEndOfDxeProtocolGuid,
+             EFI_NATIVE_INTERFACE,
+             NULL
+             );
+  return EFI_SUCCESS;
+}
+
+/**
   The main entry point to SMM Foundation.
 
   Note: This function is only used by SMRAM invocation.  It is never used by 
DXE invocation.

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h  2012-12-17 11:16:16 UTC 
(rev 14008)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h  2012-12-18 05:07:35 UTC 
(rev 14009)
@@ -20,6 +20,7 @@
 
 #include <Protocol/DxeSmmReadyToLock.h>
 #include <Protocol/SmmReadyToLock.h>
+#include <Protocol/SmmEndOfDxe.h>
 #include <Protocol/CpuIo2.h>
 #include <Protocol/SmmCommunication.h>
 #include <Protocol/SmmAccess2.h>
@@ -587,6 +588,28 @@
   );
 
 /**
+  This function is the main entry point for an SMM handler dispatch
+  or communicate-based callback.
+
+  @param  DispatchHandle  The unique handle assigned to this handler by 
SmiHandlerRegister().
+  @param  Context         Points to an optional handler context which was 
specified when the handler was registered.
+  @param  CommBuffer      A pointer to a collection of data in memory that will
+                          be conveyed from a non-SMM environment into an SMM 
environment.
+  @param  CommBufferSize  The size of the CommBuffer.
+
+  @return Status Code
+
+**/
+EFI_STATUS
+EFIAPI
+SmmEndOfDxeHandler (
+  IN     EFI_HANDLE               DispatchHandle,
+  IN     CONST VOID               *Context,        OPTIONAL
+  IN OUT VOID                     *CommBuffer,     OPTIONAL
+  IN OUT UINTN                    *CommBufferSize  OPTIONAL
+  );
+
+/**
   Place holder function until all the SMM System Table Service are available.
 
   @param  Arg1                   Undefined

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf        2012-12-17 
11:16:16 UTC (rev 14008)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf        2012-12-18 
05:07:35 UTC (rev 14009)
@@ -63,6 +63,7 @@
   gEfiSmmReadyToLockProtocolGuid                # PROTOCOL ALWAYS_PRODUCED
   gEfiSmmCpuIo2ProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED
   gEfiFirmwareVolume2ProtocolGuid               # PROTOCOL ALWAYS_CONSUMED
+  gEfiSmmEndOfDxeProtocolGuid                   # PROTOCOL ALWAYS_PRODUCED
   gEfiSecurityArchProtocolGuid                  # PROTOCOL SOMETIMES_CONSUMED
   gEfiSecurity2ArchProtocolGuid                 # PROTOCOL SOMETIMES_CONSUMED
   gEfiLoadedImageProtocolGuid                   # PROTOCOL SOMETIMES_PRODUCED
@@ -76,3 +77,4 @@
   gAprioriGuid                                  # ALWAYS_CONSUMED
   gEfiEventDxeDispatchGuid                      # ALWAYS_CONSUMED
   gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED
+  gEfiEndOfDxeEventGroupGuid                    # ALWAYS_CONSUMED

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   2012-12-17 11:16:16 UTC 
(rev 14008)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   2012-12-18 05:07:35 UTC 
(rev 14009)
@@ -263,6 +263,12 @@
   //
   { TRUE,  TRUE,  &gEfiDxeSmmReadyToLockProtocolGuid, 
SmmIplReadyToLockEventNotify,      &gEfiDxeSmmReadyToLockProtocolGuid, 
TPL_CALLBACK, NULL },
   //
+  // Declare event notification on EndOfDxe event.  When this notification is 
etablished, 
+  // the associated event is immediately signalled, so the notification 
function will be executed and the 
+  // SMM End Of Dxe Protocol will be found if it is already in the handle 
database.
+  //
+  { FALSE, TRUE,  &gEfiEndOfDxeEventGroupGuid,        SmmIplGuidedEventNotify, 
          &gEfiEndOfDxeEventGroupGuid,        TPL_CALLBACK, NULL },
+  //
   // Declare event notification on the DXE Dispatch Event Group.  This event 
is signaled by the DXE Core
   // each time the DXE Core dispatcher has completed its work.  When this 
event is signalled, the SMM Core
   // if notified, so the SMM Core can dispatch SMM drivers.

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf 2012-12-17 11:16:16 UTC 
(rev 14008)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf 2012-12-18 05:07:35 UTC 
(rev 14009)
@@ -64,6 +64,7 @@
   gEfiEventReadyToBootGuid                      # ALWAYS_CONSUMED
   gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED
   gEfiEventVirtualAddressChangeGuid             # ALWAYS_CONSUMED
+  gEfiEndOfDxeEventGroupGuid                    # ALWAYS_CONSUMED
   gLoadFixedAddressConfigurationTableGuid       # SIMETIMES_CONSUMED
 
 [Pcd]

Modified: trunk/edk2/MdePkg/Include/Guid/EventGroup.h
===================================================================
--- trunk/edk2/MdePkg/Include/Guid/EventGroup.h 2012-12-17 11:16:16 UTC (rev 
14008)
+++ trunk/edk2/MdePkg/Include/Guid/EventGroup.h 2012-12-18 05:07:35 UTC (rev 
14009)
@@ -1,7 +1,7 @@
 /** @file
-  GUIDs for gBS->CreateEventEx Event Groups. Defined in UEFI spec 2.0 and PI 
1.2.
+  GUIDs for gBS->CreateEventEx Event Groups. Defined in UEFI spec 2.0 and PI 
1.2.1.
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, 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 that accompanies this 
distribution.  
 The full text of the license may be found at
@@ -44,4 +44,9 @@
 
 extern EFI_GUID gEfiEventDxeDispatchGuid;
 
+#define EFI_END_OF_DXE_EVENT_GROUP_GUID \
+  { 0x2ce967a, 0xdd7e, 0x4ffc, { 0x9e, 0xe7, 0x81, 0xc, 0xf0, 0x47, 0x8, 0x80 
} }
+
+extern EFI_GUID gEfiEndOfDxeEventGroupGuid;
+
 #endif

Added: trunk/edk2/MdePkg/Include/Protocol/SmmEndOfDxe.h
===================================================================
--- trunk/edk2/MdePkg/Include/Protocol/SmmEndOfDxe.h                            
(rev 0)
+++ trunk/edk2/MdePkg/Include/Protocol/SmmEndOfDxe.h    2012-12-18 05:07:35 UTC 
(rev 14009)
@@ -0,0 +1,28 @@
+/** @file
+  SMM End Of Dxe protocol as defined in the PI 1.2.1 specification.
+
+  This protocol is a mandatory protocol published by the PI platform code 
prior to invoking any
+  3rd party content, including options ROM's and UEFI executables that are not 
from the platform manufacturer.
+
+  Copyright (c) 2012, 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
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _SMM_END_OF_DXE_H_
+#define _SMM_END_OF_DXE_H_
+
+#define EFI_SMM_END_OF_DXE_PROTOCOL_GUID \
+  { \
+    0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 0xa, 0xd3, 0xaa, 0x32, 0xe9, 
0x3d } \
+  }
+
+extern EFI_GUID gEfiSmmEndOfDxeProtocolGuid;
+
+#endif

Modified: trunk/edk2/MdePkg/MdePkg.dec
===================================================================
--- trunk/edk2/MdePkg/MdePkg.dec        2012-12-17 11:16:16 UTC (rev 14008)
+++ trunk/edk2/MdePkg/MdePkg.dec        2012-12-18 05:07:35 UTC (rev 14009)
@@ -581,6 +581,12 @@
   ## Include/Guid/FirmwareFileSystem3.h
   gEfiFirmwareFileSystem3Guid      = { 0x5473c07a, 0x3dcb, 0x4dca, { 0xbd, 
0x6f, 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a }}
 
+  #
+  # GUID defined in PI1.2.1
+  #
+  ## Include/Guid/EventGroup.h
+  gEfiEndOfDxeEventGroupGuid        = { 0x2ce967a, 0xdd7e, 0x4ffc, { 0x9e, 
0xe7, 0x81, 0xc, 0xf0, 0x47, 0x8, 0x80 }}
+
 [Guids.IA32, Guids.X64]
   ## Include/Guid/Cper.h
   gEfiIa32X64ErrorTypeCacheCheckGuid = { 0xA55701F5, 0xE3EF, 0x43de, { 0xAC, 
0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }}
@@ -893,6 +899,13 @@
   gEfiSecurity2ArchProtocolGuid   = { 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 
0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68 } }
 
   #
+  # Protocols defined in PI 1.2.1
+  #
+
+  ## Include/Protocol/SmmEndOfDxe.h
+  gEfiSmmEndOfDxeProtocolGuid = { 0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 
0xa, 0xd3, 0xaa, 0x32, 0xe9, 0x3d }}
+
+  #
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1
   #
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to