From nobody Sat Nov 2 14:35:49 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489673107645557.1567508995923; Thu, 16 Mar 2017 07:05:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 96EA780404; Thu, 16 Mar 2017 07:05:00 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 45FE880402 for ; Thu, 16 Mar 2017 07:04:59 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 16 Mar 2017 07:04:59 -0700 Received: from wduan1-mobl.ccr.corp.intel.com (HELO jyao1-MOBL.ccr.corp.intel.com) ([10.254.215.154]) by fmsmga002.fm.intel.com with ESMTP; 16 Mar 2017 07:04:57 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,172,1486454400"; d="scan'208";a="1143304317" From: Jiewen Yao To: edk2-devel@lists.01.org Date: Thu, 16 Mar 2017 22:04:42 +0800 Message-Id: <1489673083-10856-2-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1489673083-10856-1-git-send-email-jiewen.yao@intel.com> References: <1489673083-10856-1-git-send-email-jiewen.yao@intel.com> Subject: [edk2] [PATCH 1/2] QuarkSocPkg/SmmChildDispatch: Add SmiHandlerProfile support. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Michael D Kinney Cc: Kelly Steele Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c = | 41 +++++++++++++++++++- QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmDispatcher= .inf | 3 +- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCS= mmCore.c b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmm= Core.c index c2f75f8..0a8239c 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c +++ b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c @@ -2,7 +2,7 @@ This driver is responsible for the registration of child drivers and the abstraction of the QNC SMI sources. =20 -Copyright (c) 2013-2016 Intel Corporation. +Copyright (c) 2013-2017 Intel Corporation. =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License @@ -23,6 +23,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include "QNCSmm.h" #include "QNCSmmHelpers.h" =20 +#include + // // ///////////////////////////////////////////////////////////////////////= ////// // MODULE / GLOBAL DATA @@ -331,6 +333,7 @@ Returns: DATABASE_RECORD *Record; QNC_SMM_QUALIFIED_PROTOCOL *Qualified; INTN Index; + UINTN ContextSize; =20 // // Check for invalid parameter @@ -363,6 +366,7 @@ Returns: // Perform linked list housekeeping // Record->Signature =3D DATABASE_RECORD_SIGNATURE; + ContextSize =3D 0; =20 switch (Qualified->Type) { // @@ -383,6 +387,7 @@ Returns: =20 InsertTailList (&mPrivateData.CallbackDataBase, &Record->Link); CopyMem (&Record->SrcDesc, &SX_SOURCE_DESC, sizeof (Record->SrcDesc)); + ContextSize =3D sizeof(Record->ChildContext.Sx); // // use default clear source function // @@ -425,6 +430,7 @@ Returns: InsertTailList (&mPrivateData.CallbackDataBase, &Record->Link); CopyMem (&Record->SrcDesc, &SW_SOURCE_DESC, sizeof (Record->SrcDesc)); Record->BufferSize =3D sizeof (EFI_SMM_SW_REGISTER_CONTEXT); + ContextSize =3D sizeof(Record->ChildContext.Sw); // // use default clear source function // @@ -434,6 +440,7 @@ Returns: =20 InsertTailList (&mPrivateData.CallbackDataBase, &Record->Link); CopyMem (&Record->SrcDesc, &GPI_SOURCE_DESC, sizeof (Record->SrcDesc)); + ContextSize =3D sizeof(Record->ChildContext.Gpi); // // use default clear source function // @@ -450,6 +457,7 @@ Returns: InsertTailList (&mPrivateData.CallbackDataBase, &Record->Link); CopyMem (&Record->SrcDesc, &QNCN_SOURCE_DESCS[Record->ChildContext.QNC= n.Type], sizeof (Record->SrcDesc)); Record->ClearSource =3D QNCSmmQNCnClearSource; + ContextSize =3D sizeof(Record->ChildContext.QNCn); break; =20 case PeriodicTimerType: @@ -462,6 +470,7 @@ Returns: InsertTailList (&mPrivateData.CallbackDataBase, &Record->Link); Record->BufferSize =3D sizeof (EFI_SMM_PERIODIC_TIMER_CONTEXT); Record->ClearSource =3D QNCSmmPeriodicTimerClearSource; + ContextSize =3D sizeof(Record->ChildContext.PeriodicTimer); break; =20 default: @@ -488,6 +497,8 @@ Returns: // *DispatchHandle =3D (EFI_HANDLE) (&Record->Link); =20 + SmiHandlerProfileRegisterHandler (Qualified->Guid, DispatchFunction, (UI= NTN)RETURN_ADDRESS (0), RegisterContext, ContextSize); + return EFI_SUCCESS; =20 Error: @@ -522,6 +533,8 @@ Returns: DATABASE_RECORD *RecordToDelete; DATABASE_RECORD *RecordInDb; LIST_ENTRY *LinkInDb; + QNC_SMM_QUALIFIED_PROTOCOL *Qualified; + UINTN ContextSize; =20 if (DispatchHandle =3D=3D NULL) { return EFI_INVALID_PARAMETER; @@ -552,7 +565,31 @@ Returns: } if (SafeToDisable) { QNCSmmDisableSource( &RecordToDelete->SrcDesc ); -} + } + + Qualified =3D QUALIFIED_PROTOCOL_FROM_GENERIC (This); + switch (Qualified->Type) { + case SxType: + ContextSize =3D sizeof(RecordToDelete->ChildContext.Sx); + break; + case SwType: + ContextSize =3D sizeof(RecordToDelete->ChildContext.Sw); + break; + case GpiType: + ContextSize =3D sizeof(RecordToDelete->ChildContext.Gpi); + break; + case QNCnType: + ContextSize =3D sizeof(RecordToDelete->ChildContext.QNCn); + break; + case PeriodicTimerType: + ContextSize =3D sizeof(RecordToDelete->ChildContext.PeriodicTimer); + break; + default: + ASSERT(FALSE); + ContextSize =3D 0; + break; + } + SmiHandlerProfileUnregisterHandler (Qualified->Guid, RecordToDelete->Cal= lback, RecordToDelete->CallbackContext, ContextSize); =20 FreePool (RecordToDelete); =20 diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCS= mmDispatcher.inf b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatche= r/QNCSmmDispatcher.inf index ed94825..23b806a 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmDispa= tcher.inf +++ b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmDispa= tcher.inf @@ -3,7 +3,7 @@ # # This driver is responsible for the registration of child drivers # and the abstraction of the ICH SMI sources. -# Copyright (c) 2013-2015 Intel Corporation. +# Copyright (c) 2013-2017 Intel Corporation. # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License @@ -66,6 +66,7 @@ DevicePathLib S3IoLib QNCAccessLib + SmiHandlerProfileLib =20 [Protocols] gEfiSmmCpuProtocolGuid # PROTOCOL ALWAYS_CONSUMED --=20 2.7.4.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel