From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.92.40.53]) by mx.groups.io with SMTP id smtpd.web12.18042.1611690451915462052 for ; Tue, 26 Jan 2021 11:47:32 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=Zg5gstsP; spf=pass (domain: outlook.com, ip: 40.92.40.53, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cbKWbeR8lB/WVvCibrXZO+1WBS2FJ0yQKxTew7yrySNYalvFT4YuR8KpobFaD8OcQc3Bz+NBI3MgPHQZEzDor85Ew7KyBaBxC/KnS4QbWrypqBk7o1GU9Kf/V2QVKK+sIFYELpnqoKbZ5uUuftKPy4Nan2w73HG/PSCA5aFI2piYmCRq21LiiAp+vLsKvGXq8PfNPTpMBi9cIMPoy0HbRVsbd3Fg6iCqKZgUy7TtrNPlinLRbC8hQ7c/P8rKpfDF/eb//mw4fSSw8e06Jk4tVyBYrhEJDnAwhcsiWTioxuK/li1oGou+7J+Ugtlu/1E0doNLYDxBSYBDPCqdE5tURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRGhhox/JnrHAADbciIPYiqMIsFoes8HvHjcUghQsfE=; b=dFQsLdK2OkQUXlk4HukxULknQ5JNVVSQDhci0WKxFDc2zHZ2Jy3tqASvgQ7UM/S+mbbgHvGq/9Dv5KDb8Levg4ukG0p0QXz3ci/EzsQ3aXa2uo306Zf9S2mMKjtUDQYTt3y5eTuugaTNFq8D9NkOSKYAcKkcMK7J/G94jJSmybC+b7qT6Icc1jtNI8UNAoOalwyjfA+JzTLAa/mRL5voHivsLa3g1n6ZiYYVpNTWnsnupc2/b5s9hDkTwRMzac6EjdITF1JRNpmLJr9U9hrvKzlu9eTUSudry3UwTGuQjHZtu0UPE1Cy2kGCgiLtYH8etS06jjomvG0k8pJnoDS1GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRGhhox/JnrHAADbciIPYiqMIsFoes8HvHjcUghQsfE=; b=Zg5gstsPb1pAIBM9bAaDVph/zPxZDFLlb4ygVZa7FOfM1f/XHAaDLAt9MleC5aQuQNcOwJPnNpQ9gz+DrDXA/DsqNyIP3GnW3pE5qcf5NyfFENID7EoyGRp6vxcnWdnM2ajVWA4E6X7c0/a0T/oNmoi6yjYnhkmy9LTRD1OrEPju+oMj8Obm5WsNlWEBSsaGggi5SF6aSf1T6H8IfwtOoAA346MoyXz0cjrcdcK6jtu7zUTdvo6GroU1d8B6BYyc22JTTq2ZopjQqYvNg2d5XBIX7HFe8znZzWBPUfhTywQAwaVpWe6T0aCs/6qpbfQmGvT3CTY2FqOKt8+eleiZdg== Received: from BN7NAM10FT059.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::4b) by BN7NAM10HT067.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Tue, 26 Jan 2021 19:47:30 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e8f::4c) by BN7NAM10FT059.mail.protection.outlook.com (2a01:111:e400:7e8f::447) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Tue, 26 Jan 2021 19:47:30 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:47B2188A2F5B23021E669B18422D8F6B2D6974CD73778AA9B6BC9BF5E3B47CB9;UpperCasedChecksum:787B8A544A525BAE3822B649A3BD314660DD0474755CE95AA9D92181EF8210EC;SizeAsReceived:7488;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b%6]) with mapi id 15.20.3784.017; Tue, 26 Jan 2021 19:47:30 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao Subject: [PATCH v4 10/20] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Date: Tue, 26 Jan 2021 11:47:00 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210126194710.2248-1-kun.q@outlook.com> References: <20210126194710.2248-1-kun.q@outlook.com> X-TMN: [3X5SVKwmrWBz7QR/3mQJ0bcPmzzkpSTU] X-ClientProxiedBy: MWHPR11CA0001.namprd11.prod.outlook.com (2603:10b6:301:1::11) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210126194710.2248-8-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MWHPR11CA0001.namprd11.prod.outlook.com (2603:10b6:301:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.14 via Frontend Transport; Tue, 26 Jan 2021 19:47:28 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8618090a-28e1-43bf-644b-08d8c233369d X-MS-TrafficTypeDiagnostic: BN7NAM10HT067: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iUlxrAc61HiSudXkmBVrDxrRbnCPQUGVjOZfILcXU5yx23ACmzdATZf4V4TuPDR+ZFMJ0QdFBxnImKM0+X7apoG+ygN/dAWX6tVcRyh+ZyaRifF23JPDD2gxxZOB9kibpQjVrJUVMaJfQqHKFKMiWLx0U+k4oS4QNHx39AA4BJ9fcSmBC53pvkSv/sSNsXNpNhEUVEClXfemFx3R3poYNuhp5n84aqQ7YulzYDBtyr3WESnXUuNdT/N7LHWdrHZM92I4s4jtA0toJsiGNaIoPFSyMzIZgix4gVcrSc1DErDnsP9TPDIqOcQEuP+ue9Qx/THSm0piIk37KY/W4q2ZZmsJtArpt4zs6jdS4jDkH3mRTd3HsWW/D7NDq01z7BQpFbk055SqGLWr0cLzQvIWIQ== X-MS-Exchange-AntiSpam-MessageData: ns5WiYqlCoWlPfxJrG6K1btudhHVlzukax+uKn0tPu/bUZDadWwLzD3c3VsOQ7+ikHceQ34w39qotUOb5U5KxUWy7ZxkMo2a3IGfTUVJvrwAYTQhmsEQro39/c9Icv1p0KBwYvv2XWZhtUCyn7xAUA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8618090a-28e1-43bf-644b-08d8c233369d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 19:47:29.0868 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN7NAM10FT059.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7NAM10HT067 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This change added support of RSC router under StandaloneMm. It replaces SMM version ReportStatusCode protocol definitions with MM version. This patch also switched to use gMmst instead of gSmst. Lastly, it abstracts standalone and traditional MM driver entrypoints into separate files to allow maximal common implementations. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Kun Qin Reviewed-by: Hao A Wu --- Notes: v4: - Previously reviewed. No change. =20 v3: - Added reviewed-by tag [Hao] - Updated function descriptions to match function interface [Hao] =20 v2: - Removed "EFIAPI" for internally abstracted functions [Hao] - Updated function descriptions [Hao] - Updated ReportDispatcher to make *.h and *.c consistent [Hao] MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/{ReportStatusCodeRouterS= mm.c =3D> ReportStatusCodeRouterCommon.c} | 59 +++++++++----------- MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSt= andaloneMm.c | 33 +++++++++++ MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterTr= aditional.c | 33 +++++++++++ MdeModulePkg/MdeModulePkg.dsc = | 1 + MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/{ReportStatusCodeRouterS= mm.h =3D> ReportStatusCodeRouterCommon.h} | 46 +++++++++------ MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSm= m.inf | 13 +++-- MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSt= andaloneMm.inf | 49 ++++++++++++++++ 7 files changed, 179 insertions(+), 55 deletions(-) diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterSmm.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportS= tatusCodeRouterCommon.c similarity index 74% rename from MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC= odeRouterSmm.c rename to MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod= eRouterCommon.c index c3ab5cd05045..c4843a745d69 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terSmm.c +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terCommon.c @@ -7,7 +7,7 @@ =20 **/ =20 -#include "ReportStatusCodeRouterSmm.h" +#include "ReportStatusCodeRouterCommon.h" =20 LIST_ENTRY mCallbackListHead =3D INITIALIZE_LIST_HEAD_VARIABLE = (mCallbackListHead); =20 @@ -17,11 +17,11 @@ LIST_ENTRY mCallbackListHead =3D INITIALIZE_= LIST_HEAD_VARIABLE (mCallba // UINT32 mStatusCodeNestStatus =3D 0; =20 -EFI_SMM_STATUS_CODE_PROTOCOL mSmmStatusCodeProtocol =3D { +EFI_MM_STATUS_CODE_PROTOCOL mSmmStatusCodeProtocol =3D { ReportDispatcher }; =20 -EFI_SMM_RSC_HANDLER_PROTOCOL mSmmRscHandlerProtocol =3D { +EFI_MM_RSC_HANDLER_PROTOCOL mSmmRscHandlerProtocol =3D { Register, Unregister }; @@ -45,18 +45,18 @@ EFI_SMM_RSC_HANDLER_PROTOCOL mSmmRscHandlerProtocol = =3D { EFI_STATUS EFIAPI Register ( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback + IN EFI_MM_RSC_HANDLER_CALLBACK Callback ) { LIST_ENTRY *Link; - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; =20 if (Callback =3D=3D NULL) { return EFI_INVALID_PARAMETER; } =20 for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackList= Head, Link); Link =3D GetNextNode (&mCallbackListHead, Link)) { - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, SMM_= RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, MM_RS= C_HANDLER_CALLBACK_ENTRY_SIGNATURE); if (CallbackEntry->RscHandlerCallback =3D=3D Callback) { // // If the function was already registered. It can't be registered ag= ain. @@ -65,10 +65,10 @@ Register ( } } =20 - CallbackEntry =3D (SMM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool (sizeof= (SMM_RSC_HANDLER_CALLBACK_ENTRY)); + CallbackEntry =3D (MM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool (sizeof = (MM_RSC_HANDLER_CALLBACK_ENTRY)); ASSERT (CallbackEntry !=3D NULL); =20 - CallbackEntry->Signature =3D SMM_RSC_HANDLER_CALLBACK_ENTRY_SIG= NATURE; + CallbackEntry->Signature =3D MM_RSC_HANDLER_CALLBACK_ENTRY_SIGN= ATURE; CallbackEntry->RscHandlerCallback =3D Callback; =20 InsertTailList (&mCallbackListHead, &CallbackEntry->Node); @@ -92,18 +92,18 @@ Register ( EFI_STATUS EFIAPI Unregister ( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback + IN EFI_MM_RSC_HANDLER_CALLBACK Callback ) { LIST_ENTRY *Link; - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; =20 if (Callback =3D=3D NULL) { return EFI_INVALID_PARAMETER; } =20 for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackList= Head, Link); Link =3D GetNextNode (&mCallbackListHead, Link)) { - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, SMM_= RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, MM_RS= C_HANDLER_CALLBACK_ENTRY_SIGNATURE); if (CallbackEntry->RscHandlerCallback =3D=3D Callback) { // // If the function is found in list, delete it and return. @@ -121,8 +121,8 @@ Unregister ( /** Provides an interface that a software module can call to report a status= code. =20 - @param This EFI_SMM_STATUS_CODE_PROTOCOL instance. - @param Type Indicates the type of status code being reporte= d. + @param This EFI_MM_STATUS_CODE_PROTOCOL instance. + @param CodeType Indicates the type of status code being reporte= d. @param Value Describes the current status of a hardware or s= oftware entity. This included information about the class and s= ubclass that is used to classify the entity as well as an operation. @@ -140,16 +140,16 @@ Unregister ( EFI_STATUS EFIAPI ReportDispatcher ( - IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This, - IN EFI_STATUS_CODE_TYPE Type, + IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This, + IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, - IN CONST EFI_GUID *CallerId OPTIONAL, + IN CONST EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) { LIST_ENTRY *Link; - SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; + MM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry; =20 // // Use atom operation to avoid the reentant of report. @@ -160,13 +160,13 @@ ReportDispatcher ( } =20 for (Link =3D GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackList= Head, Link);) { - CallbackEntry =3D CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, SMM_= RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE); + CallbackEntry =3D CR (Link, MM_RSC_HANDLER_CALLBACK_ENTRY, Node, MM_RS= C_HANDLER_CALLBACK_ENTRY_SIGNATURE); // // The handler may remove itself, so get the next handler in advance. // Link =3D GetNextNode (&mCallbackListHead, Link); CallbackEntry->RscHandlerCallback ( - Type, + CodeType, Value, Instance, (EFI_GUID*)CallerId, @@ -186,20 +186,15 @@ ReportDispatcher ( /** Entry point of Generic Status Code Driver. =20 - This function is the entry point of SMM Status Code Router . - It produces SMM Report Stataus Code Handler and Status Code protocol. - - @param ImageHandle The firmware allocated handle for the EFI imag= e. - @param SystemTable A pointer to the EFI System Table. + This function is the common entry point of MM Status Code Router. + It produces MM Report Status Code Handler and Status Code protocol. =20 @retval EFI_SUCCESS The entry point is executed successfully. =20 **/ EFI_STATUS -EFIAPI -GenericStatusCodeSmmEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable +GenericStatusCodeCommonEntry ( + VOID ) { EFI_STATUS Status; @@ -210,9 +205,9 @@ GenericStatusCodeSmmEntry ( // // Install SmmRscHandler Protocol // - Status =3D gSmst->SmmInstallProtocolInterface ( + Status =3D gMmst->MmInstallProtocolInterface ( &Handle, - &gEfiSmmRscHandlerProtocolGuid, + &gEfiMmRscHandlerProtocolGuid, EFI_NATIVE_INTERFACE, &mSmmRscHandlerProtocol ); @@ -221,9 +216,9 @@ GenericStatusCodeSmmEntry ( // // Install SmmStatusCode Protocol // - Status =3D gSmst->SmmInstallProtocolInterface ( + Status =3D gMmst->MmInstallProtocolInterface ( &Handle, - &gEfiSmmStatusCodeProtocolGuid, + &gEfiMmStatusCodeProtocolGuid, EFI_NATIVE_INTERFACE, &mSmmStatusCodeProtocol ); diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterStandaloneMm.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Sm= m/ReportStatusCodeRouterStandaloneMm.c new file mode 100644 index 000000000000..bd1519fa1506 --- /dev/null +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terStandaloneMm.c @@ -0,0 +1,33 @@ +/** @file + Report Status Code Router Driver which produces MM Report Stataus Code H= andler Protocol + and MM Status Code Protocol. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "ReportStatusCodeRouterCommon.h" + +/** + Entry point of Generic Status Code Driver. + + This function is the entry point of MM Status Code Router . + It produces MM Report Stataus Code Handler and Status Code protocol. + + @param ImageHandle The firmware allocated handle for the EFI imag= e. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +EFIAPI +GenericStatusCodeStandaloneMmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + return GenericStatusCodeCommonEntry (); +} diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterTraditional.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm= /ReportStatusCodeRouterTraditional.c new file mode 100644 index 000000000000..360a0eef6b6d --- /dev/null +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terTraditional.c @@ -0,0 +1,33 @@ +/** @file + Report Status Code Router Driver which produces MM Report Stataus Code H= andler Protocol + and MM Status Code Protocol. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "ReportStatusCodeRouterCommon.h" + +/** + Entry point of Generic Status Code Driver. + + This function is the entry point of SMM Status Code Router . + It produces SMM Report Stataus Code Handler and Status Code protocol. + + @param ImageHandle The firmware allocated handle for the EFI imag= e. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +EFIAPI +GenericStatusCodeTraditionalEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return GenericStatusCodeCommonEntry (); +} diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 34ca571ca662..f95c7cd69ee1 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -479,6 +479,7 @@ [Components.IA32, Components.X64] MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandalone= Mm.inf MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouter= Smm.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouter= StandaloneMm.inf MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllocationPr= ofileLib.inf MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocat= ionProfileLib.inf diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterSmm.h b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportS= tatusCodeRouterCommon.h similarity index 72% rename from MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusC= odeRouterSmm.h rename to MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCod= eRouterCommon.h index f8c48c62e790..4f4d055222d4 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terSmm.h +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terCommon.h @@ -6,28 +6,26 @@ =20 **/ =20 -#ifndef __REPORT_STATUS_CODE_ROUTER_SMM_H__ -#define __REPORT_STATUS_CODE_ROUTER_SMM_H__ +#ifndef __REPORT_STATUS_CODE_ROUTER_COMMON_H__ +#define __REPORT_STATUS_CODE_ROUTER_COMMON_H__ =20 - -#include -#include +#include +#include =20 #include #include #include #include -#include -#include +#include #include =20 -#define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE SIGNATURE_32 ('s', 'h', = 'c', 'e') +#define MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE SIGNATURE_32 ('s', 'h', '= c', 'e') =20 typedef struct { UINTN Signature; - EFI_SMM_RSC_HANDLER_CALLBACK RscHandlerCallback; + EFI_MM_RSC_HANDLER_CALLBACK RscHandlerCallback; LIST_ENTRY Node; -} SMM_RSC_HANDLER_CALLBACK_ENTRY; +} MM_RSC_HANDLER_CALLBACK_ENTRY; =20 /** Register the callback function for ReportStatusCode() notification. @@ -48,7 +46,7 @@ typedef struct { EFI_STATUS EFIAPI Register ( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback + IN EFI_MM_RSC_HANDLER_CALLBACK Callback ); =20 /** @@ -67,14 +65,14 @@ Register ( EFI_STATUS EFIAPI Unregister ( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback + IN EFI_MM_RSC_HANDLER_CALLBACK Callback ); =20 /** Provides an interface that a software module can call to report a status= code. =20 - @param This EFI_SMM_STATUS_CODE_PROTOCOL instance. - @param Type Indicates the type of status code being reporte= d. + @param This EFI_MM_STATUS_CODE_PROTOCOL instance. + @param CodeType Indicates the type of status code being reporte= d. @param Value Describes the current status of a hardware or s= oftware entity. This included information about the class and s= ubclass that is used to classify the entity as well as an operation. @@ -92,12 +90,26 @@ Unregister ( EFI_STATUS EFIAPI ReportDispatcher ( - IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This, - IN EFI_STATUS_CODE_TYPE Type, + IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This, + IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, - IN CONST EFI_GUID *CallerId OPTIONAL, + IN CONST EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ); =20 +/** + Entry point of Generic Status Code Driver. + + This function is the common entry point of MM Status Code Router. + It produces MM Report Status Code Handler and Status Code protocol. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +GenericStatusCodeCommonEntry ( + VOID + ); + #endif diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterSmm.inf b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/Repor= tStatusCodeRouterSmm.inf index 46fdcb7bf959..539badc4c755 100644 --- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terSmm.inf +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terSmm.inf @@ -16,7 +16,7 @@ [Defines] MODULE_TYPE =3D DXE_SMM_DRIVER PI_SPECIFICATION_VERSION =3D 0x0001000A VERSION_STRING =3D 1.0 - ENTRY_POINT =3D GenericStatusCodeSmmEntry + ENTRY_POINT =3D GenericStatusCodeTraditionalEntry =20 # # The following information is for reference only and not required by the = build tools. @@ -25,15 +25,16 @@ [Defines] # =20 [Sources] - ReportStatusCodeRouterSmm.c - ReportStatusCodeRouterSmm.h + ReportStatusCodeRouterCommon.c + ReportStatusCodeRouterCommon.h + ReportStatusCodeRouterTraditional.c =20 [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec =20 [LibraryClasses] - SmmServicesTableLib + MmServicesTableLib UefiDriverEntryPoint DebugLib BaseLib @@ -41,8 +42,8 @@ [LibraryClasses] MemoryAllocationLib =20 [Protocols] - gEfiSmmRscHandlerProtocolGuid ## PRODUCES - gEfiSmmStatusCodeProtocolGuid ## PRODUCES + gEfiMmRscHandlerProtocolGuid ## PRODUCES + gEfiMmStatusCodeProtocolGuid ## PRODUCES =20 [Depex] TRUE diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatus= CodeRouterStandaloneMm.inf b/MdeModulePkg/Universal/ReportStatusCodeRouter/= Smm/ReportStatusCodeRouterStandaloneMm.inf new file mode 100644 index 000000000000..7aa0127e0bec --- /dev/null +++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRou= terStandaloneMm.inf @@ -0,0 +1,49 @@ +## @file +# Report Status Code Router Driver which produces MM Report Stataus Code = Handler Protocol and MM Status Code Protocol. +# +# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D ReportStatusCodeRouterStandaloneMm + FILE_GUID =3D EAEEDEF9-ABE7-4B95-82B0-5A534C899B46 + MODULE_TYPE =3D MM_STANDALONE + PI_SPECIFICATION_VERSION =3D 0x00010032 + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D GenericStatusCodeStandaloneMmEntry + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + ReportStatusCodeRouterCommon.c + ReportStatusCodeRouterCommon.h + ReportStatusCodeRouterStandaloneMm.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + MmServicesTableLib + StandaloneMmDriverEntryPoint + DebugLib + BaseLib + SynchronizationLib + MemoryAllocationLib + +[Protocols] + gEfiMmRscHandlerProtocolGuid ## PRODUCES + gEfiMmStatusCodeProtocolGuid ## PRODUCES + +[Depex] + TRUE --=20 2.30.0.windows.1