From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (NAM02-CY1-obe.outbound.protection.outlook.com [40.92.4.91]) by mx.groups.io with SMTP id smtpd.web08.1096.1610663816967516765 for ; Thu, 14 Jan 2021 14:36:57 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=DFKAqw0X; spf=pass (domain: outlook.com, ip: 40.92.4.91, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRo6k37WprqYwgEEM011vt/HxEbui10wKByH1dOJFXwi5gc/Ca95kcRJgeAtoG/FA6vsruF1DDb7sPlmStIz/fOKLB+Rz0vRNaV/zYNmyuUkX3Ocos0M4Dv9hPKW99Xc1PHdH/2PvbMuSbsAVa4j5z2Ddh7T/Tf3aBz2Bo1RzKeU5I7ei4r0S/PLuh0YoU82DzrOtUwIfilbKdnb9vAmNsxA+8FpRDapZW3ptKTXVOOBJkdC0nxAElkTpxsx5FyZzuiYWDrjjvkWHhFl/vlfziZWWOG6SGogOWk7FKXQAHu6LU9QkhSDmGAzcoodnyNnH/w1JftzpecD0gYFu4EZFg== 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=6eGGvbOWv9G2tiSNq6L9QNuzXcu25T0WbTzfN1x7hzY=; b=N3Fjb7HiZdxhrfmQur21bkhvZZvb8Ww0GTGZc3/qxt9kNowx20KVGPrSiWZQCd3b1hCkTZ0+Sg9hX8C8mQvPJuG6hcrRn6pFqAfPCSBZcD+ydGChTqmm5FUTfGSe0L7eR3QD79FGTQFBl78CCiyoteylxGxWV52Pr9ffayWNlOCtSS8U6jay0VpxXrNrhqXOCeKssbu2hO2HVTVd7wXE74QbATjwlov3n8AJ6r987ey4Wo+cM+rFKuO89fFox/ep2Rkeo8+5q9c9KqNurYmZxEuJ1As+YfMT65Fdtq+/7QZN5A/gHvZ+CgUu/qBjNbyKxoddXApuTyY5riQFsKA7eA== 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=6eGGvbOWv9G2tiSNq6L9QNuzXcu25T0WbTzfN1x7hzY=; b=DFKAqw0X8oLvQjfC7X28Mhja6M/lj89fQ0qycFAqR7fv2pmck0mP7heu8W52hDtK2Hq4IVLW47gdW21kkSXviRFTP/OhQL5udAFzOISdCx9eOtOt6/Ff6kTKZ7d02rSWJcm4qRbVCmEB46kMV+qagfc27pV/kqaMK+scT8xibmZLzUVS2FPM+9EoA5aovPQ79LW1nfPNFz5vDE+GvHgienWqB2j6tIKOWwpqcArrZtPrs7/c7AUOnqUxyxg20huyVyarsBUITgxRPiLgyYRZUUoylv9vKJ2dG+CBAhfuIdeAZ8T1o6YBYK7o2FgeM+h2Fwp7QATdR/kh2VPqEDCLIw== Received: from CY1NAM02FT023.eop-nam02.prod.protection.outlook.com (10.152.74.60) by CY1NAM02HT150.eop-nam02.prod.protection.outlook.com (10.152.74.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 14 Jan 2021 22:36:56 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e45::41) by CY1NAM02FT023.mail.protection.outlook.com (2a01:111:e400:7e45::237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 14 Jan 2021 22:36:56 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B45845945F77B918DADB89949E384FD2E88C0BFE5D1834EA40BD92FAD561AA04;UpperCasedChecksum:3D9256030C3EBA844D67DE31EDD860558D0F196E584FEC766DC571F400366D13;SizeAsReceived:7493;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6%5]) with mapi id 15.20.3742.012; Thu, 14 Jan 2021 22:36:56 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao Subject: [PATCH v3 10/18] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Date: Thu, 14 Jan 2021 14:36:29 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210114223637.2737-1-kun.q@outlook.com> References: <20210114223637.2737-1-kun.q@outlook.com> X-TMN: [YqfeWVO37uLFfQFB8BKdYQ5XXyzGoUDA] X-ClientProxiedBy: MW4PR04CA0389.namprd04.prod.outlook.com (2603:10b6:303:81::34) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210114223637.2737-6-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MW4PR04CA0389.namprd04.prod.outlook.com (2603:10b6:303:81::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10 via Frontend Transport; Thu, 14 Jan 2021 22:36:55 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 18f7360a-af1a-4480-19f8-08d8b8dce5c6 X-MS-TrafficTypeDiagnostic: CY1NAM02HT150: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YUZ3N/Nj+0m6MtgdlQVvlVQFBKb8YP+haVoSB6WBMnbzl9KrOykQGf5rWAhnjydd/9y+A/2fUdLDlS2Lz+CgXRgg/t4+p7uC+T8/Rf70MlHMllWMSYhinvTWgHPamaf7pM6UxJ2pSKgbZiNQd5CGQ5Et7l6AlrlL1qY+Lv4b3XdQ7XgVC8DRqUgKt4JFTL8NI6Kghce81sGiO1h7bHm96CWao6hC+wfmmu+ol2kzVYMMdRvG7k3ZriqjyEMS4iJo X-MS-Exchange-AntiSpam-MessageData: qrLtjjA/Th7Ww/IDPp0Pac2tqExlLv9Ir1IJI4Lj6qlVNatz2eakhglXK9UNMzxJH+Hol/+Tx/xchtQOPTpqvuQzBqV3OBPM70G3LonzdTzLDlDw6Kw8axfmxT/745O9GxTXbrfD2D9Kq4b67jYdAg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 22:36:55.9386 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: 18f7360a-af1a-4480-19f8-08d8b8dce5c6 X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT023.eop-nam02.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: CY1NAM02HT150 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: 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