From nobody Sat Nov 2 16:33:26 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 1486571450224595.711059430011; Wed, 8 Feb 2017 08:30:50 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AAE6E820E6; Wed, 8 Feb 2017 08:30:40 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 A917882058 for ; Wed, 8 Feb 2017 08:30:38 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 08 Feb 2017 08:30:38 -0800 Received: from jyao1-mobl.ccr.corp.intel.com ([10.254.185.79]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2017 08:30:38 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="1123833875" From: Jiewen Yao To: edk2-devel@lists.01.org Date: Wed, 8 Feb 2017 08:30:29 -0800 Message-Id: <1486571434-20000-5-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1486571434-20000-1-git-send-email-jiewen.yao@intel.com> References: <1486571434-20000-1-git-send-email-jiewen.yao@intel.com> Subject: [edk2] [PATCH 04/12] MdeModulePkg/include: Add SmiHandlerProfile header file. 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: , Cc: Michael D Kinney , Feng Tian , Laszlo Ersek , Star Zeng 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" This header file defines: 1) An SMI handler profile protocol. So that SmmChildDispatch module can register the hardware SMI handler information. 2) The SMI handler profile communication buffer. So that a shell application can use SMM communication to get the SMI handler profile info. Cc: Feng Tian Cc: Star Zeng Cc: Michael D Kinney Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- MdeModulePkg/Include/Guid/SmiHandlerProfile.h | 177 ++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 5 +- 2 files changed, 181 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Include/Guid/SmiHandlerProfile.h b/MdeModulePkg/I= nclude/Guid/SmiHandlerProfile.h new file mode 100644 index 0000000..b81631d --- /dev/null +++ b/MdeModulePkg/Include/Guid/SmiHandlerProfile.h @@ -0,0 +1,177 @@ +/** @file + Header file for SMI handler profile definition. + +Copyright (c) 2017, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD = License +which accompanies this distribution. The full text of the license may be = found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#ifndef _SMI_HANDLER_PROFILE_H_ +#define _SMI_HANDLER_PROFILE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma pack(1) + +typedef struct { + UINT32 Signature; + UINT32 Length; + UINT32 Revision; +} SMM_CORE_DATABASE_COMMON_HEADER; + +#define SMM_CORE_IMAGE_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','I','D') +#define SMM_CORE_IMAGE_DATABASE_REVISION 0x0001 + +typedef struct { + SMM_CORE_DATABASE_COMMON_HEADER Header; + EFI_GUID FileGuid; + UINTN ImageRef; + UINTN EntryPoint; + UINTN ImageBase; + UINTN ImageSize; + UINT16 PdbStringOffset; + UINT8 Reserved2[6]; +//CHAR8 PdbString[]; +} SMM_CORE_IMAGE_DATABASE_STRUCTURE; + +#define SMM_CORE_SMI_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','S','D') +#define SMM_CORE_SMI_DATABASE_REVISION 0x0001 + +typedef enum { + SmmCoreSmiHandlerCategoryRootHandler, + SmmCoreSmiHandlerCategoryGuidHandler, + SmmCoreSmiHandlerCategoryHardwareHandler, +} SMM_CORE_SMI_HANDLER_CATEGORY; + +// +// Context for SmmCoreSmiHandlerCategoryRootHandler: +// NULL +// Context for SmmCoreSmiHandlerCategoryGuidHandler: +// NULL +// Context for SmmCoreSmiHandlerCategoryHardwareHandler: +// (NOTE: The context field should NOT include any data pointer.) +// gEfiSmmSwDispatch2ProtocolGuid: EFI_SMM_SW_REGISTER_CONTEXT +// gEfiSmmSxDispatch2ProtocolGuid: EFI_SMM_SX_REGISTER_CONTEXT +// gEfiSmmPowerButtonDispatch2ProtocolGuid: EFI_SMM_POWER_BUTTON_REGIS= TER_CONTEXT +// gEfiSmmStandbyButtonDispatch2ProtocolGuid: EFI_SMM_STANDBY_BUTTON_REG= ISTER_CONTEXT +// gEfiSmmPeriodicTimerDispatch2ProtocolGuid: EFI_SMM_PERIODIC_TIMER_CON= TEXT +// gEfiSmmGpiDispatch2ProtocolGuid: EFI_SMM_GPI_REGISTER_CONTE= XT +// gEfiSmmIoTrapDispatch2ProtocolGuid: EFI_SMM_IO_TRAP_REGISTER_C= ONTEXT +// gEfiSmmUsbDispatch2ProtocolGuid: (EFI_SMM_USB_REGISTER_CONT= EXT =3D> SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT) +// Other: GUID specific + +typedef struct { + EFI_USB_SMI_TYPE Type; + UINT32 DevicePathSize; +//UINT8 DevicePath[DevicePathSize]; +} SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT; + +typedef struct { + UINT32 Length; + UINTN CallerAddr; + UINTN Handler; + UINTN ImageRef; + UINT16 ContextBufferOffset; + UINT8 Reserved2[2]; + UINT32 ContextBufferSize; +//UINT8 ContextBuffer[]; +} SMM_CORE_SMI_HANDLER_STRUCTURE; + +typedef struct { + SMM_CORE_DATABASE_COMMON_HEADER Header; + UINT32 HandlerCategory; + EFI_GUID HandlerType; + UINTN HandlerCount; +//SMM_CORE_SMI_HANDLER_STRUCTURE Handler[HandlerCount]; +} SMM_CORE_SMI_DATABASE_STRUCTURE; + +// +// Layout: +// +-------------------------------------+ +// | SMM_CORE_IMAGE_DATABASE_STRUCTURE | +// +-------------------------------------+ +// | SMM_CORE_SMI_DATABASE_STRUCTURE | +// +-------------------------------------+ +// + + + +// +// SMM_CORE dump command +// +#define SMI_HANDLER_PROFILE_COMMAND_GET_INFO 0x1 +#define SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET 0x2 + +typedef struct { + UINT32 Command; + UINT32 DataLength; + UINT64 ReturnStatus; +} SMI_HANDLER_PROFILE_PARAMETER_HEADER; + +typedef struct { + SMI_HANDLER_PROFILE_PARAMETER_HEADER Header; + UINT64 DataSize; +} SMI_HANDLER_PROFILE_PARAMETER_GET_INFO; + +typedef struct { + SMI_HANDLER_PROFILE_PARAMETER_HEADER Header; + // + // On input, data buffer size. + // On output, actual data buffer size copied. + // + UINT64 DataSize; + PHYSICAL_ADDRESS DataBuffer; + // + // On input, data buffer offset to copy. + // On output, next time data buffer offset to copy. + // + UINT64 DataOffset; +} SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET; + +#define SMI_HANDLER_PROFILE_GUID {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe,= 0x65, 0xfd, 0xa8, 0x53, 0x89, 0xf5}} + +#pragma pack() + +extern EFI_GUID gSmiHandlerProfileGuid; + +typedef struct _SMI_HANDLER_PROFILE_PROTOCOL SMI_HANDLER_PROFILE_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *SMI_HANDLER_PROFILE_REGISTER_HANDLER) ( + IN SMI_HANDLER_PROFILE_PROTOCOL *This, + IN EFI_GUID *HandlerGuid, + IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, + IN PHYSICAL_ADDRESS CallerAddress, + IN VOID *Context, OPTIONAL + IN UINTN ContextSize OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *SMI_HANDLER_PROFILE_UNREGISTER_HANDLER) ( + IN SMI_HANDLER_PROFILE_PROTOCOL *This, + IN EFI_GUID *HandlerGuid, + IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler + ); + +struct _SMI_HANDLER_PROFILE_PROTOCOL { + SMI_HANDLER_PROFILE_REGISTER_HANDLER RegisterHandler; + SMI_HANDLER_PROFILE_UNREGISTER_HANDLER UnregisterHandler; +}; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 7307191..393b4a7 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -3,7 +3,7 @@ # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and libr= ary classes) # and libraries instances, which are used for those modules. # -# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
# Copyright (c) 2016, Linaro Ltd. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# This program and the accompanying materials are licensed and made availa= ble under @@ -366,6 +366,9 @@ ## Include/Guid/PiSmmMemoryAttributesTable.h gEdkiiPiSmmMemoryAttributesTableGuid =3D { 0x6b9fd3f7, 0x16df, 0x45e8, {= 0xbd, 0x39, 0xb9, 0x4a, 0x66, 0x54, 0x1a, 0x5d}} =20 + ## Include/Guid/SmiHandlerProfile.h + gSmiHandlerProfileGuid =3D {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe, 0x6= 5, 0xfd, 0xa8, 0x53, 0x89, 0xf5}} + ## Include/Guid/NonDiscoverableDevice.h gEdkiiNonDiscoverableAhciDeviceGuid =3D { 0xC7D35798, 0xE4D2, 0x4A93, {0= xB1, 0x45, 0x54, 0x88, 0x9F, 0x02, 0x58, 0x4B } } gEdkiiNonDiscoverableAmbaDeviceGuid =3D { 0x94440339, 0xCC93, 0x4506, {0= xB4, 0xC6, 0xEE, 0x8D, 0x0F, 0x4C, 0xA1, 0x91 } } --=20 2.7.4.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel