--- /dev/null
+/** @file\r
+ MM driver instance of SmiHandlerProfile Library.\r
+\r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) Microsoft Corporation.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <PiMm.h>\r
+#include <Library/SmiHandlerProfileLib.h>\r
+#include <Library/MmServicesTableLib.h>\r
+#include <Guid/SmiHandlerProfile.h>\r
+\r
+SMI_HANDLER_PROFILE_PROTOCOL *mSmiHandlerProfile;\r
+\r
+/**\r
+ This function is called by SmmChildDispatcher module to report\r
+ a new SMI handler is registered, to SmmCore.\r
+\r
+ @param HandlerGuid The GUID to identify the type of the handler.\r
+ For the SmmChildDispatch protocol, the HandlerGuid\r
+ must be the GUID of SmmChildDispatch protocol.\r
+ @param Handler The SMI handler.\r
+ @param CallerAddress The address of the module who registers the SMI handler.\r
+ @param Context The context of the SMI handler.\r
+ For the SmmChildDispatch protocol, the Context\r
+ must match the one defined for SmmChildDispatch protocol.\r
+ @param ContextSize The size of the context in bytes.\r
+ For the SmmChildDispatch protocol, the Context\r
+ must match the one defined for SmmChildDispatch protocol.\r
+\r
+ @retval EFI_SUCCESS The information is recorded.\r
+ @retval EFI_UNSUPPORTED The feature is unsupported.\r
+ @retval EFI_OUT_OF_RESOURCES There is no enough resource to record the information.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmiHandlerProfileRegisterHandler (\r
+ IN EFI_GUID *HandlerGuid,\r
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,\r
+ IN PHYSICAL_ADDRESS CallerAddress,\r
+ IN VOID *Context, OPTIONAL\r
+ IN UINTN ContextSize OPTIONAL\r
+ )\r
+{\r
+ if (mSmiHandlerProfile != NULL) {\r
+ return mSmiHandlerProfile->RegisterHandler (mSmiHandlerProfile, HandlerGuid, Handler, CallerAddress, Context, ContextSize);\r
+ }\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+ This function is called by SmmChildDispatcher module to report\r
+ an existing SMI handler is unregistered, to SmmCore.\r
+\r
+ @param HandlerGuid The GUID to identify the type of the handler.\r
+ For the SmmChildDispatch protocol, the HandlerGuid\r
+ must be the GUID of SmmChildDispatch protocol.\r
+ @param Handler The SMI handler.\r
+ @param Context The context of the SMI handler.\r
+ If it is NOT NULL, it will be used to check what is registered.\r
+ @param ContextSize The size of the context in bytes.\r
+ If Context is NOT NULL, it will be used to check what is registered.\r
+\r
+ @retval EFI_SUCCESS The original record is removed.\r
+ @retval EFI_UNSUPPORTED The feature is unsupported.\r
+ @retval EFI_NOT_FOUND There is no record for the HandlerGuid and handler.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmiHandlerProfileUnregisterHandler (\r
+ IN EFI_GUID *HandlerGuid,\r
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,\r
+ IN VOID *Context, OPTIONAL\r
+ IN UINTN ContextSize OPTIONAL\r
+ )\r
+{\r
+ if (mSmiHandlerProfile != NULL) {\r
+ return mSmiHandlerProfile->UnregisterHandler (mSmiHandlerProfile, HandlerGuid, Handler, Context, ContextSize);\r
+ }\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+ The common constructor function for SMI handler profile.\r
+\r
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
+**/\r
+EFI_STATUS\r
+MmSmiHandlerProfileLibInitialization (\r
+ VOID\r
+ )\r
+{\r
+ gMmst->MmLocateProtocol (\r
+ &gSmiHandlerProfileGuid,\r
+ NULL,\r
+ (VOID **) &mSmiHandlerProfile\r
+ );\r
+ return EFI_SUCCESS;\r
+}\r
+\r
--- /dev/null
+/** @file\r
+ MM driver instance of SmiHandlerProfile Library.\r
+\r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) Microsoft Corporation.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _MM_SMI_HANDLER_PROFILE_LIB_H_\r
+#define _MM_SMI_HANDLER_PROFILE_LIB_H_\r
+\r
+/**\r
+ The common constructor function for SMI handler profile.\r
+\r
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
+**/\r
+EFI_STATUS\r
+MmSmiHandlerProfileLibInitialization (\r
+ VOID\r
+ );\r
+\r
+#endif //_SMM_SMI_HANDLER_PROFILE_LIB_H_\r
SMM driver instance of SmiHandlerProfile Library.\r
\r
Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) Microsoft Corporation.\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
-#include <PiSmm.h>\r
-#include <Library/SmiHandlerProfileLib.h>\r
-#include <Library/SmmServicesTableLib.h>\r
-#include <Guid/SmiHandlerProfile.h>\r
+#include <PiMm.h>\r
\r
-SMI_HANDLER_PROFILE_PROTOCOL *mSmiHandlerProfile;\r
+#include "MmSmiHandlerProfileLib.h"\r
\r
/**\r
- This function is called by SmmChildDispatcher module to report\r
- a new SMI handler is registered, to SmmCore.\r
-\r
- @param HandlerGuid The GUID to identify the type of the handler.\r
- For the SmmChildDispatch protocol, the HandlerGuid\r
- must be the GUID of SmmChildDispatch protocol.\r
- @param Handler The SMI handler.\r
- @param CallerAddress The address of the module who registers the SMI handler.\r
- @param Context The context of the SMI handler.\r
- For the SmmChildDispatch protocol, the Context\r
- must match the one defined for SmmChildDispatch protocol.\r
- @param ContextSize The size of the context in bytes.\r
- For the SmmChildDispatch protocol, the Context\r
- must match the one defined for SmmChildDispatch protocol.\r
-\r
- @retval EFI_SUCCESS The information is recorded.\r
- @retval EFI_UNSUPPORTED The feature is unsupported.\r
- @retval EFI_OUT_OF_RESOURCES There is no enough resource to record the information.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmiHandlerProfileRegisterHandler (\r
- IN EFI_GUID *HandlerGuid,\r
- IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,\r
- IN PHYSICAL_ADDRESS CallerAddress,\r
- IN VOID *Context, OPTIONAL\r
- IN UINTN ContextSize OPTIONAL\r
- )\r
-{\r
- if (mSmiHandlerProfile != NULL) {\r
- return mSmiHandlerProfile->RegisterHandler (mSmiHandlerProfile, HandlerGuid, Handler, CallerAddress, Context, ContextSize);\r
- }\r
- return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
- This function is called by SmmChildDispatcher module to report\r
- an existing SMI handler is unregistered, to SmmCore.\r
-\r
- @param HandlerGuid The GUID to identify the type of the handler.\r
- For the SmmChildDispatch protocol, the HandlerGuid\r
- must be the GUID of SmmChildDispatch protocol.\r
- @param Handler The SMI handler.\r
- @param Context The context of the SMI handler.\r
- If it is NOT NULL, it will be used to check what is registered.\r
- @param ContextSize The size of the context in bytes.\r
- If Context is NOT NULL, it will be used to check what is registered.\r
-\r
- @retval EFI_SUCCESS The original record is removed.\r
- @retval EFI_UNSUPPORTED The feature is unsupported.\r
- @retval EFI_NOT_FOUND There is no record for the HandlerGuid and handler.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmiHandlerProfileUnregisterHandler (\r
- IN EFI_GUID *HandlerGuid,\r
- IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,\r
- IN VOID *Context, OPTIONAL\r
- IN UINTN ContextSize OPTIONAL\r
- )\r
-{\r
- if (mSmiHandlerProfile != NULL) {\r
- return mSmiHandlerProfile->UnregisterHandler (mSmiHandlerProfile, HandlerGuid, Handler, Context, ContextSize);\r
- }\r
- return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
- The constructor function for SMI handler profile.\r
+ The constructor function for traditional MM SMI handler profile.\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
EFI_STATUS\r
EFIAPI\r
SmmSmiHandlerProfileLibConstructor (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- gSmst->SmmLocateProtocol (\r
- &gSmiHandlerProfileGuid,\r
- NULL,\r
- (VOID **) &mSmiHandlerProfile\r
- );\r
- return EFI_SUCCESS;\r
+ return MmSmiHandlerProfileLibInitialization ();\r
}\r
-\r
#\r
\r
[Sources]\r
+ MmSmiHandlerProfileLib.c\r
+ MmSmiHandlerProfileLib.h\r
SmmSmiHandlerProfileLib.c\r
\r
[Packages]\r
MdeModulePkg/MdeModulePkg.dec\r
\r
[LibraryClasses]\r
- SmmServicesTableLib\r
+ MmServicesTableLib\r
\r
[Guids]\r
gSmiHandlerProfileGuid ## CONSUMES ## GUID # Locate protocol\r
--- /dev/null
+/** @file\r
+ Standalone MM driver instance of SmiHandlerProfile Library.\r
+\r
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) Microsoft Corporation.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <PiMm.h>\r
+\r
+#include "MmSmiHandlerProfileLib.h"\r
+\r
+/**\r
+ The constructor function for standalone MM SMI handler profile.\r
+\r
+ @param ImageHandle The firmware allocated handle for the EFI image.\r
+ @param SystemTable A pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+StandaloneMmSmiHandlerProfileLibConstructor (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_MM_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ return MmSmiHandlerProfileLibInitialization ();\r
+}\r
+\r
--- /dev/null
+## @file\r
+# Standalone MM driver instance of SmiHandlerProfile Library.\r
+#\r
+# This library instance provides real functionality for SmmChildDispatcher module.\r
+#\r
+# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) Microsoft Corporation.\r
+#\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = StandaloneMmSmiHandlerProfileLib\r
+ FILE_GUID = 1F2ED27B-A01D-4867-B993-9B710E5926C5\r
+ MODULE_TYPE = MM_STANDALONE\r
+ VERSION_STRING = 1.0\r
+ PI_SPECIFICATION_VERSION = 0x10000032\r
+ LIBRARY_CLASS = SmiHandlerProfileLib|MM_STANDALONE\r
+ CONSTRUCTOR = StandaloneMmSmiHandlerProfileLibConstructor\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
+ MmSmiHandlerProfileLib.c\r
+ MmSmiHandlerProfileLib.h\r
+ StandaloneMmSmiHandlerProfileLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ MmServicesTableLib\r
+\r
+[Guids]\r
+ gSmiHandlerProfileGuid ## CONSUMES ## GUID # Locate protocol\r
+\r
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxStandaloneMmLib.inf\r
MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
MdeModulePkg/Library/SmmSmiHandlerProfileLib/SmmSmiHandlerProfileLib.inf\r
+ MdeModulePkg/Library/SmmSmiHandlerProfileLib/StandaloneMmSmiHandlerProfileLib.inf\r
MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCustomDecompressLib.inf\r
MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf\r
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r