From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CFF5E803AA for ; Thu, 9 Mar 2017 23:35:08 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2017 23:35:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,139,1486454400"; d="scan'208";a="234483243" Received: from jyao1-mobl.ccr.corp.intel.com ([10.239.192.59]) by fmsmga004.fm.intel.com with ESMTP; 09 Mar 2017 23:35:07 -0800 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Jeff Fan , Liming Gao , Michael D Kinney , Bret Barkelew Date: Fri, 10 Mar 2017 15:35:01 +0800 Message-Id: <1489131303-3732-2-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1489131303-3732-1-git-send-email-jiewen.yao@intel.com> References: <1489131303-3732-1-git-send-email-jiewen.yao@intel.com> Subject: [PATCH 1/3] MdePkg/SmiHandlerProfile: Add Context support in Unregister X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2017 07:35:09 -0000 The reason is that we observe that a platform may use same Handler for different context. In order to support Unregister such handler, we have to input context information as well. Cc: Jeff Fan Cc: Liming Gao Cc: Michael D Kinney Cc: Bret Barkelew Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- MdePkg/Include/Library/SmiHandlerProfileLib.h | 8 +++++++- MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Library/SmiHandlerProfileLib.h b/MdePkg/Include/Library/SmiHandlerProfileLib.h index 10b7323..77d19f9 100644 --- a/MdePkg/Include/Library/SmiHandlerProfileLib.h +++ b/MdePkg/Include/Library/SmiHandlerProfileLib.h @@ -66,6 +66,10 @@ SmiHandlerProfileRegisterHandler ( For the SmmChildDispatch protocol, the HandlerGuid must be the GUID of SmmChildDispatch protocol. @param Handler The SMI handler. + @param Context The context of the SMI handler. + If it is NOT NULL, it will be used to check what is registered. + @param ContextSize The size of the context in bytes. + If Context is NOT NULL, it will be used to check what is registered. @retval EFI_SUCCESS The original record is removed. @retval EFI_UNSUPPORTED The feature is unsupported. @@ -75,7 +79,9 @@ EFI_STATUS EFIAPI SmiHandlerProfileUnregisterHandler ( IN EFI_GUID *HandlerGuid, - IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler + IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, + IN VOID *Context, OPTIONAL + IN UINTN ContextSize OPTIONAL ); #endif diff --git a/MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.c b/MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.c index 6ae4718..7f4855b 100644 --- a/MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.c +++ b/MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.c @@ -56,6 +56,10 @@ SmiHandlerProfileRegisterHandler ( For the SmmChildDispatch protocol, the HandlerGuid must be the GUID of SmmChildDispatch protocol. @param Handler The SMI handler. + @param Context The context of the SMI handler. + If it is NOT NULL, it will be used to check what is registered. + @param ContextSize The size of the context in bytes. + If Context is NOT NULL, it will be used to check what is registered. @retval EFI_SUCCESS The original record is removed. @retval EFI_UNSUPPORTED The feature is unsupported. @@ -65,7 +69,9 @@ EFI_STATUS EFIAPI SmiHandlerProfileUnregisterHandler ( IN EFI_GUID *HandlerGuid, - IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler + IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, + IN VOID *Context, OPTIONAL + IN UINTN ContextSize OPTIONAL ) { return EFI_UNSUPPORTED; -- 2.7.4.windows.1