/** @file\r
SMM Core Main Entry Point\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
EFI_STATUS Status;\r
EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;\r
\r
+ PERF_START (NULL, "SMM", NULL, 0) ;\r
+\r
//\r
// Update SMST using the context\r
//\r
CopyMem (&gSmmCoreSmst.SmmStartupThisAp, SmmEntryContext, sizeof (EFI_SMM_ENTRY_CONTEXT));\r
\r
+ //\r
+ // Call platform hook before Smm Dispatch\r
+ //\r
+ PlatformHookBeforeSmmDispatch ();\r
+\r
//\r
// If a legacy boot has occured, then make sure gSmmCorePrivate is not accessed\r
//\r
//\r
SmiManage (NULL, NULL, NULL, NULL);\r
}\r
+ \r
+ //\r
+ // Call platform hook after Smm Dispatch\r
+ //\r
+ PlatformHookAfterSmmDispatch ();\r
\r
//\r
// Clear the InSmm flag as we are going to leave SMM\r
//\r
gSmmCorePrivate->InSmm = FALSE;\r
+\r
+ PERF_END (NULL, "SMM", NULL, 0) ;\r
}\r
\r
/**\r
The internal header file includes the common header files, defines\r
internal structure and functions used by SmmCore module.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
#include <Library/UefiLib.h> \r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/PcdLib.h>\r
+#include <Library/SmmCorePlatformHookLib.h>\r
+#include <Library/PerformanceLib.h>\r
\r
#include "PiSmmCorePrivateData.h"\r
\r
## @file\r
# This module provide an SMM CIS compliant implementation of SMM Core.\r
#\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
UefiBootServicesTableLib \r
MemoryAllocationLib\r
PcdLib\r
- \r
+ SmmCorePlatformHookLib\r
+ PerformanceLib\r
+\r
[Protocols]\r
gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r
--- /dev/null
+/** @file\r
+ Smm Core Platform Hook Library. This library class defines a set of platform\r
+ hooks called by the SMM Core.\r
+\r
+Copyright (c) 2011, 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
+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_CORE_PLATFORM_HOOK_LIB__\r
+#define __SMM_CORE_PLATFORM_HOOK_LIB__\r
+\r
+/**\r
+ Performs platform specific tasks before invoking registered SMI handlers.\r
+ \r
+ This function performs platform specific tasks before invoking registered SMI handlers.\r
+ \r
+ @retval EFI_SUCCESS The platform hook completes successfully.\r
+ @retval Other values The paltform hook cannot complete due to some error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformHookBeforeSmmDispatch (\r
+ VOID\r
+ );\r
+\r
+\r
+/**\r
+ Performs platform specific tasks after invoking registered SMI handlers.\r
+ \r
+ This function performs platform specific tasks after invoking registered SMI handlers.\r
+ \r
+ @retval EFI_SUCCESS The platform hook completes successfully.\r
+ @retval Other values The paltform hook cannot complete due to some error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformHookAfterSmmDispatch (\r
+ VOID\r
+ );\r
+ \r
+#endif\r
--- /dev/null
+/** @file\r
+ Null instance of SmmCorePlatformHookLibNull.\r
+\r
+ Copyright (c) 2011, 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
+#include <Library/SmmCorePlatformHookLib.h>\r
+\r
+/**\r
+ Performs platform specific tasks before invoking registered SMI handlers.\r
+ \r
+ This function performs platform specific tasks before invoking registered SMI handlers.\r
+ \r
+ @retval EFI_SUCCESS The platform hook completes successfully.\r
+ @retval Other values The paltform hook cannot complete due to some error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformHookBeforeSmmDispatch (\r
+ VOID\r
+ )\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
+/**\r
+ Performs platform specific tasks after invoking registered SMI handlers.\r
+ \r
+ This function performs platform specific tasks after invoking registered SMI handlers.\r
+ \r
+ @retval EFI_SUCCESS The platform hook completes successfully.\r
+ @retval Other values The paltform hook cannot complete due to some error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformHookAfterSmmDispatch (\r
+ VOID\r
+ )\r
+{\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+## @file\r
+# SMM Core Platform Hook Null Library instance\r
+#\r
+# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+#\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
+# 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
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = SmmCorePlatformHookLibNull\r
+ FILE_GUID = FED6583D-2418-4760-AC96-B5E18F0A6326\r
+ MODULE_TYPE = SMM_CORE\r
+ VERSION_STRING = 1.0\r
+ PI_SPECIFICATION_VERSION = 0x0001000A\r
+ LIBRARY_CLASS = SmmCorePlatformHookLib|SMM_CORE\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64\r
+#\r
+\r
+[Sources]\r
+ SmmCorePlatformHookLibNull.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
## @libraryclass Provide platform specific hooks.\r
#\r
PlatformHookLib|Include/Library/PlatformHookLib.h\r
+\r
+ ## @libraryclass Provide platform specific hooks for SMM core.\r
+ #\r
+ SmmCorePlatformHookLib|Include/Library/SmmCorePlatformHookLib.h\r
\r
[Guids]\r
## MdeModule package token space guid\r
[LibraryClasses.common.SMM_CORE]\r
MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf\r
- \r
+ SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf \r
+\r
[LibraryClasses.common.DXE_SMM_DRIVER]\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf\r
MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf\r
MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf\r
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf\r
+ MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
\r