]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/Include: Add SmiHandlerProfileLib.h
authorJiewen Yao <jiewen.yao@intel.com>
Mon, 30 Jan 2017 14:40:41 +0000 (06:40 -0800)
committerJiewen Yao <jiewen.yao@intel.com>
Wed, 22 Feb 2017 07:28:09 +0000 (15:28 +0800)
This library should be linked by SmmChildDispatch to
report the hardware SMI handler maintained by SmmChildDispatch.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Library/SmiHandlerProfileLib.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Library/SmiHandlerProfileLib.h b/MdePkg/Include/Library/SmiHandlerProfileLib.h
new file mode 100644 (file)
index 0000000..10b7323
--- /dev/null
@@ -0,0 +1,81 @@
+/** @file\r
+  Provides services to log the SMI handler registration.\r
+\r
+  This API provides services for the SMM Child Dispatch Protocols provider,\r
+  to register SMI handler information to SmmCore.\r
+\r
+  NOTE:\r
+  There is no need to update the consumers of SMST->SmiHandlerRegister() or\r
+  the consumers of SMM Child Dispatch Protocols.\r
+  The SmmCore (who produces SMST) should have ability to register such\r
+  information directly.\r
+  The SmmChildDispatcher (who produces SMM Child Dispatch Protocols) should\r
+  be responsible to call the services to register information to SMM Core.\r
+\r
+Copyright (c) 2017, 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 __SMI_HANDLER_PROFILE_LIB_H__\r
+#define __SMI_HANDLER_PROFILE_LIB_H__\r
+\r
+#include <PiSmm.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
+/**\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
+\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
+  );\r
+\r
+#endif\r
index f2bdb307af9efad512dd5216a752d169b703a6dd..3310029f5fc68ec0b93aa66195123426c557eacf 100644 (file)
@@ -4,7 +4,7 @@
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of\r
 # EFI1.10/UEFI2.6/PI1.4 and some Industry Standards.\r
 #\r
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 #\r
   #\r
   RngLib|Include/Library/RngLib.h\r
 \r
+  ##  @libraryclass  Provides services to log the SMI handler registration.\r
+  SmiHandlerProfileLib|Include/Library/SmiHandlerProfileLib.h\r
+\r
 [LibraryClasses.IPF]\r
   ##  @libraryclass  The SAL Library provides a service to make a SAL CALL.\r
   SalLib|Include/Library/SalLib.h\r